Encapsulates the functionality common to all directional lights.
#include <AlDirectionLight.h> class AlDirectionLight: public AlNonAmbientLight AlDirectionLight(); virtual ~AlDirectionLight(); virtual AlObject* copyWrapper() const; statusCode create(); AlObjectType type() const; AlLightNode* lookAtNode() const; AlLightNode* upNode() const; virtual statusCode direction( double&, double&, double& ) const; virtual statusCode setDirection( double, double, double );
There are two ways that this class is used. If the user instantiates and calls the create method on an AlDirectionLight, the resulting object is a light that has color, intensity, and direction but no obvious source in a scene. This type of direction light does not decay with distance. Sunlight is a direction light of this type.
Alternatively, the user could instantiate and create an AlSpotLight, AlLinearLight, or AlAreaLight (which are all considered "directional" and which are all derived from this light class).
Although all direction lights can access the "look at" and "up" nodes of a light, only the spot light uses these nodes.
Constructs an AlDirectionLight wrapper object.
Deletes an AlDirectionLight wrapper object.
Creates all the DAG nodes for this light and adds them to the universe. The DAG nodes are for ’position’, ’look at’ and ’up’, and another DAG node that groups these three together.
sSuccess - everything was successful
sInsufficientMemory - not enough memory available
sAlreadyCreated - light is already created
Returns the class identifier, kDirectionLightType.
Returns a pointer to the light’s "look at" node. This node is an AlLightNode (which is a DAG node).
Returns a pointer to the light’s "up" node. This node is an AlLightNode (which is a DAG node).
Returns a world space vector indicating the direction that this light is pointing. The default direction for the light is (0,0,-1)
> x - the direction vector in x
> y - the direction vector in y
> z - the direction vector in z
sSuccess - the direction was returned
sFailure - the direction could not be determined
sInvalidObject - the light was invalid
This is a ’convenience’ function. It calculates rotations in the DAG node to set the world direction of the light. This will overwrite the current rotations in the light node. The default direction for the light is (0,0,-1)
< x - the direction vector in x
< y - the direction vector in y
< z - the direction vector in z
sSuccess - the direction was returned
sFailure - the direction could not be determined
sInvalidObject - the light was invalid