| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Light javax.media.j3d.DirectionalLight
DirectionalLight | public class DirectionalLight extends Light (Code) | | A DirectionalLight node defines an oriented light with an origin at
infinity. It has the same attributes as a Light node, with the
addition of a directional vector to specify the direction in which the
light shines. A directional light has parallel light rays that travel
in one direction along the specified vector. Directional light contributes
to diffuse and specular reflections, which in turn depend on the
orientation of an object's surface but not its position. A directional
light does not contribute to ambient reflections.
|
Field Summary | |
final public static int | ALLOW_DIRECTION_READ Specifies that the Node allows access to its object's direction
information. | final public static int | ALLOW_DIRECTION_WRITE Specifies that the Node allows writing to its object's direction
information. |
Constructor Summary | |
public | DirectionalLight() Constructs a DirectionalLight node with default parameters. | public | DirectionalLight(Color3f color, Vector3f direction) Constructs and initializes a directional light. | public | DirectionalLight(boolean lightOn, Color3f color, Vector3f direction) Constructs and initializes a directional light. |
Method Summary | |
public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode DirectionalLightRetained object that this
DirectionalLight component object will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all DirectionalLight information from
originalNode into
the current node. | public void | getDirection(Vector3f direction) Gets this Light's current direction and places it in the parameter specified. | public void | setDirection(Vector3f direction) Set light direction. | public void | setDirection(float x, float y, float z) Set light direction. |
ALLOW_DIRECTION_READ | final public static int ALLOW_DIRECTION_READ(Code) | | Specifies that the Node allows access to its object's direction
information.
|
ALLOW_DIRECTION_WRITE | final public static int ALLOW_DIRECTION_WRITE(Code) | | Specifies that the Node allows writing to its object's direction
information.
|
DirectionalLight | public DirectionalLight()(Code) | | Constructs a DirectionalLight node with default parameters.
The default values are as follows:
|
DirectionalLight | public DirectionalLight(Color3f color, Vector3f direction)(Code) | | Constructs and initializes a directional light.
Parameters: color - the color of the light source Parameters: direction - the direction vector pointing from the lightto the object |
DirectionalLight | public DirectionalLight(boolean lightOn, Color3f color, Vector3f direction)(Code) | | Constructs and initializes a directional light.
Parameters: lightOn - flag indicating whether this light is on or off Parameters: color - the color of the light source Parameters: direction - the direction vector pointing from the lightto the object |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: Node.cloneNode See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode DirectionalLightRetained object that this
DirectionalLight component object will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all DirectionalLight information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getDirection | public void getDirection(Vector3f direction)(Code) | | Gets this Light's current direction and places it in the parameter specified.
Parameters: direction - the vector that will receive this node's direction exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setDirection | public void setDirection(Vector3f direction)(Code) | | Set light direction.
Parameters: direction - the new direction exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setDirection | public void setDirection(float x, float y, float z)(Code) | | Set light direction.
Parameters: x - the new X direction Parameters: y - the new Y direction Parameters: z - the new Z direction exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
|
|