Contains functionality common to non-ambient lights.
#include <AlNonAmbientLight.h>
class AlNonAmbientLight: public AlLight
virtual ~AlNonAmbientLight();
virtual AlObject* copyWrapper() const = 0;
AlObjectType type() const;
double intensity() const;
int decay() const;
boolean shadows() const;
statusCode setIntensity( double );
statusCode setDecay( int );
statusCode setShadows( boolean );
This virtual class encapsulates all methods that are common to non-ambient lights such as point, directional, spot, linear, and area lights. All non-ambient lights have variable intensity and decay and all have a ’shadows’ flag.
To create a non-ambient light, the user must instantiate and call the create method on a specific type of light (as listed above). For more information on lights in general, see the Class Description of the AlLight object.
int AlNonAmbientLight::decay() const
Returns the light’s decay. Decay controls how quickly the light fades with distance; that is, how far it reaches. It can be set to 0, 1, 2, or 3. A value of 0 means no decay - the light reaches everything. A value of 1 is standard decay. Higher values increase the decay exponentially: 2 squares it; 3 cubes it. The initial default is 1. Decay has no effect at distances less than one unit. This method returns -1 if the light is invalid or if there is an error.
statusCode AlNonAmbientLight::setIntensity( double newIntensity)
statusCode AlNonAmbientLight::setDecay( int newDecay )
Sets the light’s decay. The decay controls how quickly the light fades with distance; that is, how far it reaches. It can be set to 0, 1, 2, or 3. A value of 0 means no decay - the light reaches everything. A value of 1 is a standard linear decay. Higher values increase the decay exponentially, that is, 2 squares it and 3 cubes it. The initial default is 1. The decay has no effect at distances less than one unit.