FCDLight Class Reference
[COLLADA Document Object Model.]

A COLLADA light. More...

#include <FCDLight.h>

Inheritance diagram for FCDLight:

FCDTargetedEntity FCDEntity FCDObjectWithId FCDObject FUParameterizable FUTrackable FUObject List of all members.

Public Types

enum  LightType {
  POINT,
  SPOT,
  AMBIENT,
  DIRECTIONAL
}
 The types of lights supported by this class. More...

Public Member Functions

 FCDLight (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDLight ()
 Destructor.
virtual Type GetType () const
 Retrieves the entity type for this class.
 DEPRECATED (3.05A, GetExtra()->GetDefaultType()->GetTechniques()) virtual bool HasMaxExtras() const
 Checks if the light uses a DCC specific representation Currently always returns false.
 DEPRECATED (3.05A, GetExtra()->GetDefaultType()->GetTechniques()) virtual bool HasMayaExtras() const
 See above.
 DEPRECATED (3.05A, nothing) void SetHasMaxExtras(bool UNUSED(value))
 [INTERNAL] Set DCC specific flags.
 DEPRECATED (3.05A, nothing) void SetHasMayaExtras(bool UNUSED(value))
FCDParameterAnimatableColor3GetColor ()
 Retrieves the base color for the light.
const FCDParameterAnimatableColor3GetColor () const
 See above.
void SetColor (const FMVector3 &col)
 Sets the base color for the light.
void SetColor (float r, float g, float b)
 Sets the base color for the light.
FCDParameterAnimatableFloatGetIntensity ()
 Retrieves the intensity of the light.
const FCDParameterAnimatableFloatGetIntensity () const
 See above.
void SetIntensity (float _intensity)
 Sets the intensity of the light.
LightType GetLightType () const
 Retrieves the type of the light.
void SetLightType (LightType type)
 Sets the type of the light.
FCDParameterAnimatableFloatGetConstantAttenuationFactor ()
 Retrieves the constant attenuation factor for the light.
const FCDParameterAnimatableFloatGetConstantAttenuationFactor () const
 See above.
void SetConstantAttenuationFactor (float factor)
 Sets the constant attenuation factor for the light.
FCDParameterAnimatableFloatGetLinearAttenuationFactor ()
 Retrieves the linear attenuation factor for the light.
const FCDParameterAnimatableFloatGetLinearAttenuationFactor () const
 See above.
void SetLinearAttenuationFactor (float factor)
 Sets the linear attenuation factor for the light.
FCDParameterAnimatableFloatGetQuadraticAttenuationFactor ()
 Retrieves the quadratic attenuation factor for the light.
const FCDParameterAnimatableFloatGetQuadraticAttenuationFactor () const
 See above.
void SetQuadraticAttenuationFactor (float factor)
 Sets the quadratic attenuation factor for the light.
FCDParameterAnimatableFloatGetFallOffExponent ()
 Retrieves the fall-off exponent for the light.
const FCDParameterAnimatableFloatGetFallOffExponent () const
 See above.
void SetFallOffExponent (float exponent)
 Sets the fall-off exponent for the light.
FCDParameterAnimatableFloatGetFallOffAngle ()
 Retrieves the fall-off angle for the light.
const FCDParameterAnimatableFloatGetFallOffAngle () const
 See above.
void SetFallOffAngle (float angle)
 Sets the fall-off angle for the light.
FCDParameterAnimatableFloatGetOuterAngle ()
 Retrieves the outer angle for the light.
const FCDParameterAnimatableFloatGetOuterAngle () const
 See above.
void SetOuterAngle (float angle)
 Sets the outer angle for the light.
 DEPRECATED (3.05A, GetOuterAngle and GetFallOffAngle) float &GetPenumbraAngle()
 Retrieves the penumbra angle for the light.
 DEPRECATED (3.05A, GetOuterAngle and GetFallOffAngle) const float &GetPenumbraAngle() const
 See above.
 DEPRECATED (3.05A, SetOuterAngle and SetFallOffAngle) void SetPenumbraAngle(float angle)
 Sets the penumbra angle for the light.
FCDParameterAnimatableFloatGetDropoff ()
 Retrieves the drop-off for the light.
const FCDParameterAnimatableFloatGetDropoff () const
 See above.
void SetDropoff (float factor)
 Sets the drop-off for the light.

Detailed Description

A COLLADA light.

Based on the FCDTargetedEntity class to supported aimed lights. COLLADA defines four types of native lights: point, spot, ambient and directional. These four types are fully handled by this class: make sure to check the type flag as well as which information to expect for each light type.

A COLLADA ambient light has a global color, which should be added to all other lighting on all geometry.

A COLLADA directional light has a global color, which should be multiplied to the cosine of the angle between the normal vector of a triangle and the direction of the light. Note that the direction will be calculated from the transforms, for each instance, and is not provided by this class.

A COLLADA point light has a color which attenuates as the distance increases between the light position and the vertex being shaded. Note that the position will be calculated from the transforms, for each instance, and is not provided by this class.

A COLLADA spot light is a point light which lights only the objects that appear within a specific angle, with respect to the direction of the light. Note that the position and the direction will be calculated from the transforms, for each instance, and is not provided by this class.


Member Enumeration Documentation

enum FCDLight::LightType
 

The types of lights supported by this class.

Enumerator:
POINT  A point light.

This is the default type.

SPOT  A spot light.
AMBIENT  An ambient light.
DIRECTIONAL  A directional light.


Constructor & Destructor Documentation

FCDLight::FCDLight FCDocument document  ) 
 

Constructor: do not use directly.

Create new lights using the FCDLibrary::AddEntity function.

Parameters:
document The COLLADA document that contains this light entity.


Member Function Documentation

FCDLight::DEPRECATED 3.  05A,
SetOuterAngle and  SetFallOffAngle
[inline]
 

Sets the penumbra angle for the light.

This now actually doesn't nothing except sets a variable that you can read back with GetPenumbraAngle.

Deprecated:
Instead use: SetOuterAngle and SetFallOffAngle, or FCDLightTools::LoadPenumbra
See also:
GetPenumbraAngle
Parameters:
angle The spot light penumbra angle.

FCDLight::DEPRECATED 3.  05A,
GetOuterAngle and  GetFallOffAngle
[inline]
 

Retrieves the penumbra angle for the light.

This value is valid only for spot lights. The value is only used by documents exported by ColladaMaya. This value is relative to the fall-off angle and may be negative. If this value is positive, it determines the outer angle, as described above. If this value is negative, the fall-off angle is used as the outer angle and the fall-off angle + the penumbra angle is used as the full-lighting angle. This now actually does nothing but gets the value assigned in SetPenumbraAngle

Deprecated:
Instead use: GetOuterAngle and GetFallOffAngle
See also:
GetOuterAngle
Returns:
The spot light penumbra angle.

FCDLight::DEPRECATED 3.  05A,
nothing 
[inline]
 

[INTERNAL] Set DCC specific flags.

Deprecated:
Internal method, should never have been used.
Parameters:
value The new flag.

FCDLight::DEPRECATED 3.  05A,
GetExtra()->GetDefaultType()->GetTechniques() 
const [inline]
 

Checks if the light uses a DCC specific representation Currently always returns false.

Deprecated:
Instead use: GetExtra()->GetDefaultType()->GetTechniques()
Returns:
The DCC flag.

FCDParameterAnimatableColor3& FCDLight::GetColor  )  [inline]
 

Retrieves the base color for the light.

To calculate the light color, multiply the base color with the intensity.

Returns:
The base color for the light.

FCDParameterAnimatableFloat& FCDLight::GetConstantAttenuationFactor  )  [inline]
 

Retrieves the constant attenuation factor for the light.

This value is valid only for point and spot lights.

Returns:
The constant attenuation factor.

FCDParameterAnimatableFloat& FCDLight::GetDropoff  )  [inline]
 

Retrieves the drop-off for the light.

It defines the rate at which a spot light gets dimmer from the center of the beam to outside angles.

Returns:
The drop-off for the light.

FCDParameterAnimatableFloat& FCDLight::GetFallOffAngle  )  [inline]
 

Retrieves the fall-off angle for the light.

This value is valid only for spot lights. It defines the cone of the spot light.

Returns:
The spot light fall-off angle.

FCDParameterAnimatableFloat& FCDLight::GetFallOffExponent  )  [inline]
 

Retrieves the fall-off exponent for the light.

This value is valid only for spot lights. It determines how fast the lighting turns off, with respect to angles greater than the fall-off angle. This results in a smooth lighting at the spot light's edges.

IMPORTANT NOTE: Neither ColladaMaya or ColladaMax use this value as neither Maya or 3dsMax use this technique for soft lighting.

Returns:
The spot light fall-off exponent.

FCDParameterAnimatableFloat& FCDLight::GetIntensity  )  [inline]
 

Retrieves the intensity of the light.

To calculate the light color, multiply the base color with the intensity.

Returns:
The intensity of the light.

LightType FCDLight::GetLightType  )  const [inline]
 

Retrieves the type of the light.

Make sure to check the type of light before using the values, as some values may not make sense with some types of light.

Returns:
The light type.

FCDParameterAnimatableFloat& FCDLight::GetLinearAttenuationFactor  )  [inline]
 

Retrieves the linear attenuation factor for the light.

This value is valid only for point and spot lights.

Returns:
The linear attenuation factor.

FCDParameterAnimatableFloat& FCDLight::GetOuterAngle  )  [inline]
 

Retrieves the outer angle for the light.

This value is valid only for spot lights. This value is used by documents exported by ColladaMax and ColladaMaya. This value should always be greater than the fall-off angle. It represents the angle at which the lighting is black. All lighting between the fall-off angle and the outer angle is a linear interpolation between the light color and black.

Returns:
The spot light outer angle.

FCDParameterAnimatableFloat& FCDLight::GetQuadraticAttenuationFactor  )  [inline]
 

Retrieves the quadratic attenuation factor for the light.

This value is valid only for point and spot lights.

Returns:
The quadratic attenuation factor.

virtual Type FCDLight::GetType  )  const [inline, virtual]
 

Retrieves the entity type for this class.

This function is part of the FCDEntity interface.

Returns:
The entity type: LIGHT.

Reimplemented from FCDEntity.

void FCDLight::SetColor float  r,
float  g,
float  b
[inline]
 

Sets the base color for the light.

To calculate the light color, multiply the base color with the intensity.

Parameters:
r The red component for the light color.
g The green component for the light color.
b The blue component for the light color.

void FCDLight::SetColor const FMVector3 col  )  [inline]
 

Sets the base color for the light.

To calculate the light color, multiply the base color with the intensity.

Parameters:
col The base color for the light.

void FCDLight::SetConstantAttenuationFactor float  factor  )  [inline]
 

Sets the constant attenuation factor for the light.

This value is valid only for point and spot lights.

Parameters:
factor The constant attenuation factor.

void FCDLight::SetDropoff float  factor  )  [inline]
 

Sets the drop-off for the light.

Parameters:
factor The drop-off for the light.

void FCDLight::SetFallOffAngle float  angle  )  [inline]
 

Sets the fall-off angle for the light.

See also:
GetFallOffAngle
Parameters:
angle The spot light fall-off angle.

void FCDLight::SetFallOffExponent float  exponent  )  [inline]
 

Sets the fall-off exponent for the light.

See also:
GetFallOffExponent
Parameters:
exponent The spot light fall-off exponent.

void FCDLight::SetIntensity float  _intensity  )  [inline]
 

Sets the intensity of the light.

To calculate the light color, multiply the base color with the intensity.

Parameters:
_intensity The intensity of the light.

void FCDLight::SetLightType LightType  type  )  [inline]
 

Sets the type of the light.

The default type of a new light is POINT.

Parameters:
type The light type.

void FCDLight::SetLinearAttenuationFactor float  factor  )  [inline]
 

Sets the linear attenuation factor for the light.

This value is valid only for point and spot lights.

Parameters:
factor The linear attenuation factor.

void FCDLight::SetOuterAngle float  angle  )  [inline]
 

Sets the outer angle for the light.

See also:
GetOuterAngle
Parameters:
angle The spot light outer angle.

void FCDLight::SetQuadraticAttenuationFactor float  factor  )  [inline]
 

Sets the quadratic attenuation factor for the light.

This value is valid only for point and spot lights.

Parameters:
factor The quadratic attenuation factor.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:39 2008 for FCollada by  doxygen 1.4.6-NO