Encapsulates the creation, deletion and manipulation of area lights.
#include <AlAreaLight.h> class AlAreaLight: public AlDirectionLight AlAreaLight(); virtual ~AlAreaLight(); statusCode create(); virtual AlObject* copyWrapper() const; AlObjectType type() const; statusCode longAxis( double&, double&, double& ) const; statusCode shortAxis( double&, double&, double& ) const; statusCode setLongAxis( double, double, double ); statusCode setShortAxis( double, double, double ); statusCode cornerPoints( double&, double&, double&, double&, double&, double&) const;
An area light is a rectangular area that emits light in all directions. An area light would be used, for instance, to simulate bright light coming through a rectangular window. The size of the rectangle is defined by a long and short axis.
To create an area light, the user must instantiate and call the create method on an AlAreaLight object. (For more information on lights in general, see the Class Description of the AlDirectionLight object.)
To determine the orientation of the rectangular area of this light, use the worldPosition() of this light and the method cornerPoints(). The cornerPoints() method returns points A and B in world space, as in the following diagram: (WP is the World Position)
Although this class inherits methods to access the ’look at’ and ’up’ nodes of a light, they are not used. The direction and twist of an area light is changed by translating and rotating the transformation of the light’s position node.
Constructs an AlAreaLight wrapper object.
Deletes an AlAreaLight 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, kAreaLightType.
Returns the linear light’s long axis in x, y & z.
> double &x - the length of the axis in the x direction
> double &y - the length of the axis in the y direction
> double &z - the length of the axis in the z direction
sSuccess - successfully determined long axis of the light
sInvalidObject - the light was not valid
sFailure - the axis was not set
Returns the linear light’s short axis in x, y & z.
> double &x - the length of the axis in the x direction
> double &y - the length of the axis in the y direction
> double &z - the length of the axis in the z direction
sSuccess - successfully determined short axis of the light
sInvalidObject - the light was not valid
sFailure - the axis was not set
Sets the long axis of the light to be x, y, & z. The given vector must be non-zero.
< double x - the new length of the axis in the x direction
< double y - the new length of the axis in the y direction
< double z - the new length of the axis in the z direction
sSuccess - setting long axis succeeded
sInvalidObject - not a valid area light
sInvalidArgument - axis vector was zero
sFailure - the axis was not set
Sets the short axis of the light to be x, y, & z. The given vector must be non-zero.
< double x - the new length of the axis in the x direction
< double y - the new length of the axis in the y direction
< double z - the new length of the axis in the z direction
sSuccess - setting short axis succeeded
sInvalidObject - not a valid area light
sFailure - the axis was not set
sInvalidArgument - axis vector was zero
Returns the corner points of the rectangular area of this area light. The corner points are in world space. The corner points are A and B in the following diagram (WP is World Position of the light)
> double &x1 - the world space short axis corner point in x direction
> double &y1 - the world space short axis corner point in y direction
> double &z1 - the world space short axis corner point in z direction
> double &x2 - the world space long axis corner point in x direction
> double &y2 - the world space long axis corner point in y direction
> double &z2 - the world space long axis corner point in z direction
sSuccess - successfully determined the light’s corner points
sInvalidObject - the light was not valid
sFailure - unable to complete the request