com.hedgehog.x3d.lighting
Class DirectionalLightNode

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.x3d.nodes.X3DNode
          extended by com.hedgehog.x3d.nodes.X3DChildNode
              extended by com.hedgehog.x3d.lighting.X3DLightNode
                  extended by com.hedgehog.x3d.lighting.DirectionalLightNode
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator

public class DirectionalLightNode
extends X3DLightNode

Title: DirectionalLightNode - represents the X3D DirectionalLight node.

Description: Represents the X3D DirectionalLight node.

Copyright: Copyright (c) Hedgehog Software.

Company: Hedgehog Software.

Since:
1.1
Version:
1.1

Field Summary
protected  SFVec3f mDirection
          Light direction vector.
 
Fields inherited from class com.hedgehog.x3d.lighting.X3DLightNode
mAmbientIntensity, mColour, mIntensity, mOn
 
Fields inherited from class com.hedgehog.x3d.nodes.X3DNode
mDefine, mMetadata
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
DirectionalLightNode()
          Default constructor.
DirectionalLightNode(DirectionalLightNode object)
          Copy constructor.
DirectionalLightNode(SFFloat ambientIntensity, SFColour colour, SFFloat intensity, SFBool on, SFVec3f direction)
          Constructor.
DirectionalLightNode(X3DMetadataObject metadata)
          Constructor.
 
Method Summary
 SFVec3f getDirection()
          Returns the direction vector.
 void setDirection(SFVec3f direction)
          Sets the direction vector.
 org.w3c.dom.Element toXMLNode(org.w3c.dom.Document document, org.w3c.dom.Element documentRootNode)
          Converts this X3D node to an XML node.
 
Methods inherited from class com.hedgehog.x3d.lighting.X3DLightNode
getAmbientIntensity, getColour, getIntensity, getOn, setAmbientIntensity, setColour, setIntensity, setOn
 
Methods inherited from class com.hedgehog.x3d.nodes.X3DNode
getDefine, getMeatadata, hasDefine, setDefine, setMetadata
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mDirection

protected SFVec3f mDirection
Light direction vector. Default is (0,0,-1).

Constructor Detail

DirectionalLightNode

public DirectionalLightNode()
Default constructor. Sets the direction vector to (0,0,-1).


DirectionalLightNode

public DirectionalLightNode(SFFloat ambientIntensity,
                            SFColour colour,
                            SFFloat intensity,
                            SFBool on,
                            SFVec3f direction)
Constructor.

Parameters:
ambientIntensity - Ambient intensity.
colour - Colour.
intensity - Intensity.
on - On/off.
direction - Direction.

DirectionalLightNode

public DirectionalLightNode(X3DMetadataObject metadata)
Constructor.

Parameters:
metadata - Metadata object.

DirectionalLightNode

public DirectionalLightNode(DirectionalLightNode object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

getDirection

public SFVec3f getDirection()
Returns the direction vector.

Returns:
The direction vector.

setDirection

public void setDirection(SFVec3f direction)
Sets the direction vector.

Parameters:
direction - New direction vector.

toXMLNode

public org.w3c.dom.Element toXMLNode(org.w3c.dom.Document document,
                                     org.w3c.dom.Element documentRootNode)
                              throws InvalidObjectException
Converts this X3D node to an XML node.

Specified by:
toXMLNode in class X3DNode
Parameters:
document - XML document.
documentRootNode - Document root node; ie .
Returns:
XML node representation of this X3D node.
Throws:
InvalidObjectException - Thrown if this object is invalid.