H3D::SpotLight Class Reference
[X3D node classes.]

The SpotLight node defines a light source that emits light from a specific point along a specific direction vector and constrained within a solid angle. More...

#include <H3D/SpotLight.h>

Inheritance diagram for H3D::SpotLight:

Inheritance graph

List of all members.

Public Member Functions

 SpotLight (Inst< SFNode > _metadata=0, Inst< SFFloat > _ambientIntensity=0, Inst< SFColor > _color=0, Inst< SFFloat > _intensity=0, Inst< SFBool > _global=0, Inst< SFBool > _on=0, Inst< SFVec3f > _attenuation=0, Inst< SFFloat > _beamWidth=0, Inst< SFFloat > _cutOffAngle=0, Inst< SFVec3f > _direction=0, Inst< SFVec3f > _location=0, Inst< SFFloat > _radius=0)
 Constructor.
virtual void enableGraphicsState ()
 Turn on the light and set up spotlight parameters for the light.

Public Attributes

auto_ptr< SFVec3fattenuation
 The attenuation field defines how the PointLight node's illumination falls off with distance from the light.
auto_ptr< SFFloatbeamWidth
 The beamWidth field specifies an inner solid angle in which the light source emits light at uniform full intensity (in H3DAPI it can only be the entire beamWidth angle or 0).
auto_ptr< SFFloatcutOffAngle
 The cutOffAngle field specifies the outer bound of the solid angle.
auto_ptr< SFVec3fdirection
 The direction field specifies the direction vector of the light's central axis defined in the local coordinate system.
auto_ptr< SFVec3flocation
 The location field specifies a translation offset of the centre point of the light source from the light's local coordinate system origin.
auto_ptr< SFFloatradius
 This field is not supported by H3DAPI.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The SpotLight node defines a light source that emits light from a specific point along a specific direction vector and constrained within a solid angle.

Spotlights may illuminate geometry nodes that respond to light sources and intersect the solid angle defined by the SpotLight. Spotlight nodes are specified in the local coordinate system and are affected by ancestors' transformations.

See X3DLightNode for a description of the ambientIntensity, color, and intensity fields.

The location field specifies a translation offset of the centre point of the light source from the light's local coordinate system origin. This point is the apex of the solid angle which bounds light emission from the given light source. The direction field specifies the direction vector of the light's central axis defined in the local coordinate system.

The on field specifies whether the light source emits light. If on is TRUE, the light source is emitting light and may illuminate geometry in the scene. If on is FALSE, the light source does not emit light and does not illuminate any geometry.

Location is affected by ancestors' transformations.

The cutOffAngle field specifies the outer bound of the solid angle. The light source does not emit light outside of this solid angle. The beamWidth field specifies an inner solid angle in which the light source emits light at uniform full intensity (in H3DAPI it can only be the entire beamWidth angle or 0). If beamWidth is less than cutOffAngle then the intensity drops of linearly from the center of the spotlight to the beamWidth, i.e. the same as a beamWidth of 0. If the beamWidth is greater than the cutOffAngle, beamWidth is defined to be equal to the cutOffAngle and the light source emits full intensity within the entire solid angle defined by cutOffAngle.

SpotLight illumination falls off with distance as specified by three attenuation coefficients. The attenuation factor is:

1/max(attenuation[0] + attenuation[1] r + attenuation[2] r2 , 1)

where r is the distance from the light to the surface being illuminated. The default is no attenuation. An attenuation value of (0, 0, 0) is identical to (1, 0, 0). Attenuation values shall be greater than or equal to zero.

Internal routes:
SpotLight.dot

Member Data Documentation

The attenuation field defines how the PointLight node's illumination falls off with distance from the light.

The attenuation factor is:

1/max(attenuation[0] + attenuation[1] r + attenuation[2] r2, 1)

where r is the distance from the light to the surface being illuminated.

Access type: inputOutput
Default value: 1 0 0
Valid range: [0-inf]

SpotLight_attenuation.dot

Referenced by enableGraphicsState(), and SpotLight().

The beamWidth field specifies an inner solid angle in which the light source emits light at uniform full intensity (in H3DAPI it can only be the entire beamWidth angle or 0).

If beamWidth is less than cutOffAngle then the intensity drops of linearly from the center of the spotlight to the beamWidth, i.e. the same as a beamWidth of 0. If the beamWidth is greater than the cutOffAngle, beamWidth is defined to be equal to the cutOffAngle and the light source emits full intensity within the entire solid angle defined by cutOffAngle.

Access type: inputOutput
Default value: pi/2
Valid range: [0-pi/2]

SpotLight_beamWidth.dot

Referenced by enableGraphicsState(), and SpotLight().

The cutOffAngle field specifies the outer bound of the solid angle.

The light source does not emit light outside of this solid angle.

Access type: inputOutput
Default value: pi/4
Valid range: [0-pi/2]

SpotLight_cutOffAngle.dot

Referenced by enableGraphicsState(), and SpotLight().

The direction field specifies the direction vector of the light's central axis defined in the local coordinate system.

Access type: inputOutput
Default value: 0 0 -1

SpotLight_location.dot

Referenced by enableGraphicsState(), and SpotLight().

The location field specifies a translation offset of the centre point of the light source from the light's local coordinate system origin.

This point is the apex of the solid angle which bounds light emission from the given light source.

Access type: inputOutput
Default value: 0 0 0

SpotLight_location.dot

Referenced by enableGraphicsState(), and SpotLight().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:05 2008 for H3D API by  doxygen 1.5.7