AlAmbientLight
 
 
 

Encapsulates the creation, deletion and manipulation of an ambient light.

Synopsis

#include <AlAmbientLight.h>
class AlAmbientLight : public AlLight
	AlAmbientLight();
virtual	~AlAmbientLight();
virtual AlObject*	copyWrapper() const;
statusCode	create();
AlObjectType	type() const;
double	shadeFactor() const;
double	intensity() const;
statusCode	setShadeFactor( double );
statusCode	setIntensity( double );

Description

An ambient light is similar to a point light, except that only a portion of the illumination comes from the point. The remainder of the illumination comes from all directions and lights everything uniformly.

(For more information on lights in general, see the Class Description of the AlLight class.)

AlAmbientLight::AlAmbientLight()

Description

Constructs an AlAmbientLight wrapper object.

AlAmbientLight::~AlAmbientLight()

Description

Deletes an AlAmbientLight wrapper object.

statusCode AlAmbientLight::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 AlAmbientLight::type() const

Description

Returns the class identifier, kAmbientLightType.

double AlAmbientLight::shadeFactor() const

Description

Returns the light’s shade factor. Valid shade factors range from 0.0 to 1.0. Shade factor defines the omnidirectionality of the light. Set to 0.0, ambient light will come from all directions and surfaces will not show edge definition. Set to 1.0, the ambient light comes solely from the position of the light and objects will show definite edge contrast. If the light is not valid then -1 is returned.

statusCode AlAmbientLight::setShadeFactor( double newShadeFactor)

Description

Sets the light’s shade factor. Valid shade factors range from 0.0 to 1.0. Shade factor defines the omnidirectionality of the light. Set to 0.0, ambient light will come from all directions and surfaces will show not edge definition. Set to 1.0, the ambient light comes solely from the position of the light and objects will show definite edge contrast.

Arguments

< double newShadeFactor - is the new shade factor

Return Codes

sSuccess - setting shade factor succeeded

sInvalidObject - the light was not valid

sFailure - not an ambient light

sInvalidArgument - shade out of range

double AlAmbientLight::intensity() const

Description

Returns the intensity of this ambient light. The value returned is greater than or equal to 0.0. If the light is not valid -1 is returned.

statusCode AlAmbientLight::setIntensity( double newIntensity )

Description

Sets the intensity of this ambient light. The given intensity value must be greater than or equal to 0.0.

Arguments

< newIntensity - the intensity that this light is set to

Return Codes

sSuccess - setting intensity succeeded

sInvalidObject - not a valid ambient light

sInvalidArgument - intensity out of range