net.java.joglutils.msg.nodes
Class Color4

java.lang.Object
  extended by net.java.joglutils.msg.nodes.Node
      extended by net.java.joglutils.msg.nodes.Color4

public class Color4
extends Node

Represents a set of 4-valued colors which are applied on a per-vertex basis to any drawn polygons. Currently the color can only be bound to one material parameter of the fixed-function OpenGL pipeline, defaulting to "ambient and diffuse".

For correct rendering results, the colors stored in this node should have their alpha premultiplied; in other words, the red, green, and blue (x, y, and z components of the stored vectors) should be multiplied by the alpha value (the w component) before storing them in this node.


Constructor Summary
Color4()
           
 
Method Summary
 void doAction(Action action)
          Performs the "typical" operation for this node when an action is applied to it.
 Vec4fCollection getData()
           
 void setData(Vec4fCollection data)
          Note: these aren't needed until we have lighting // FIXME: factor this out into a separate ColorBinding node public static final int EMISSION = 1; public static final int AMBIENT = 2; public static final int DIFFUSE = 3; public static final int SPECULAR = 4; public static final int AMBIENT_AND_DIFFUSE = 5; public void setColorBinding(int colorBinding) { if (binding < EMISSION || binding > AMBIENT_AND_DIFFUSE) { throw new IllegalArgumentException("Illegal color binding " + binding); } this.colorBinding = colorBinding; } public int getColorBinding() { return colorBinding; }
 
Methods inherited from class net.java.joglutils.msg.nodes.Node
rayPick, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Color4

public Color4()
Method Detail

setData

public void setData(Vec4fCollection data)
Note: these aren't needed until we have lighting // FIXME: factor this out into a separate ColorBinding node public static final int EMISSION = 1; public static final int AMBIENT = 2; public static final int DIFFUSE = 3; public static final int SPECULAR = 4; public static final int AMBIENT_AND_DIFFUSE = 5; public void setColorBinding(int colorBinding) { if (binding < EMISSION || binding > AMBIENT_AND_DIFFUSE) { throw new IllegalArgumentException("Illegal color binding " + binding); } this.colorBinding = colorBinding; } public int getColorBinding() { return colorBinding; }


getData

public Vec4fCollection getData()

doAction

public void doAction(Action action)
Description copied from class: Node
Performs the "typical" operation for this node when an action is applied to it. The default implementation does nothing.

Overrides:
doAction in class Node