AlLightNode
The DAG node class for lights.
Synopsis
#include <AlLightNode.h>
class AlLightNode: public AlDagNode
virtual ~AlLightNode();
virtual AlObject * copyWrapper() const;
statusCode deleteObject();
AlObjectType type() const;
AlLight* light() const;
AlLight* light(AlTM&) const;
virtual boolean isInstanceable();
boolean isLookAtNode() const;
boolean isUpNode() const;
boolean isPositionNode() const;
Description
This class is a DAG node class used specifically for lights. Each AlLight object has three light nodes for position, ’look at’ and ’up’ points. (For more information on how AlLights and AlLightNodes work together, see the class description for the AlLight object.)
To create a light node, the user must create a specific type of light, which creates the necessary light nodes. These light nodes are grouped and inserted into the universe’s DAG. The user cannot directly instantiate a light node.
To figure out whether or not a light node represents a position, a ’look at’ or an ’up’ point, the user can use:
the isPositionNode(), isLookAtNode(), isUpNode() methods, or
the type() method of the attached AlLight object.
A light node can be deleted in two ways. When a light node is deleted, its associated light (and other light nodes) are deleted. Alternatively, when a light is deleted, its light nodes are also deleted.
AlLightNode::~AlLightNode()
Description
Deletes an AlLightNode wrapper object.
AlObject *AlLightNode::copyWrapper() const
Description
Returns an exact duplicate of this AliLightNode.
statusCode AlLightNode::deleteObject()
Description
Deletes all objects associated with this light node. It deletes the attached light object, which in turn deletes the other attached light DAG nodes. A light can be deleted in two ways. If AlLight::deleteObject() is called, it deletes the associated AlLightNodes. If AlLightNode::deleteObject() is called, it deletes the associated AlLight.
Return Codes
sSuccess - the light node and light were deleted
sInvalidObject - light node is invalid
sFailure - an error occurred
AlObjectType AlLightNode::type() const
Description
Returns the light node type, kLightNodeType (for the light’s position node), kLightUpNodeType (for the light’s up node), and kLightLookAtNodeType (for the light’s look at node).
AlLight *AlLightNode::light() const
Description
Returns a pointer to the attached light object. If the light does not exist or is not the right type, then NULL is returned.
AlLight *AlLightNode::light(AlTM& tm) const
Description
Returns a pointer to the attached light object. If the light does not exist or is not the right type, then NULL is returned. The AlTM will be updated with the lightNode’s TM if a light exists.
Arguments
> tm - the transformation matrix to update with the lightnode’s TM
boolean AlLightNode::isInstanceable()
Description
Returns FALSE. An AlLightNode is not an instanceable DAG node.
boolean AlLightNode::isLookAtNode() const
Description
Returns TRUE if this node is a ’look at’ node.
boolean AlLightNode::isUpNode() const
Description
Returns TRUE if this node is a ’up’ node.
boolean AlLightNode::isPositionNode() const
Description
Returns TRUE if this node is a ’position’ node.