Encapsulates the creation, deletion, and manipulation of linear lights.
Synopsis
#include <AlLinearLight.h>
class AlLinearLight: public AlDirectionLight
AlLinearLight();
virtual ~AlLinearLight();
virtual AlObject* copyWrapper() const;
statusCode create();
AlObjectType type() const;
statusCode axis( double&, double&, double& ) const;
statusCode setAxis( double, double, double );
statusCode endpoint( double&, double&, double& ) const;
Description
A linear light emits light in all directions. A linear light would be used, for instance, to simulate a fluorescent light
tube. The length of the line is defined by the light’s axis.
To determine the endpoints of this light, use the worldPosition() method and the endpoint() method.
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.
AlLinearLight::AlLinearLight()
Description
Constructs an AlLinearLight wrapper object.
AlLinearLight::~AlLinearLight()
Description
Deletes an AlLinearLight wrapper object.
statusCode AlLinearLight::create()
Description
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.
Return Codes
sSuccess - everything was successful
sInsufficientMemory - not enough memory available
sAlreadyCreated - light is already created
AlObjectType AlLinearLight::type() const
Description
Returns the class identifier kLinearLightType.
statusCode AlLinearLight::axis( double &x, double &y, double &z) const
Description
Returns the linear light’s axis in x,y & z.
Arguments
> x - is the light’s axis in the x direction
> y - is the light’s axis in the y direction
> z - is the light’s axis in the z direction
Return Codes
sSuccess - axis returned
sInvalidObject - the light was not valid
sFailure - an error occurred
statusCode AlLinearLight::setAxis( double x, double y, double z )
Description
Sets the axis of the light to be x,y, & z. The given axis must be non-zero.
Arguments
< x - is the light’s new axis in the x direction
< y - is the light’s new axis in the y direction
< z - is the light’s new axis in the z direction
Return Codes
sSuccess - axis set
sInvalidArgument - the (x,y,z) forms a zero (or nearly zero) vector
sInvalidObject - the light was not valid
sFailure - an error occurred
statusCode AlLinearLight::endpoint( double &x, double &y, double &z ) const
Description
Returns the endpoint of this linear light in world space. This point and the world position of this light form the line that
makes this light a linear light.
Arguments
> x - is the endpoint in the x direction
> y - is the endpoint in the y direction
> z - is the endpoint in the z direction
Return Codes
sSuccess - endpoint retrieved
sInvalidObject - object invalid
sFailure - an error occurred