#include <FCDLight.h>
Inheritance diagram for FCDLight:
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: do not release directly. | |
virtual Type | GetType () const |
Retrieves the entity type for this class. | |
FMVector3 & | GetColor () |
Retrieves the base color for the light. | |
const FMVector3 & | GetColor () const |
See above. | |
void | SetColor (const FMVector3 &col) |
Sets the base color for the light. | |
float & | GetIntensity () |
Retrieves the intensity of the light. | |
const float & | GetIntensity () 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. | |
float & | GetConstantAttenuationFactor () |
Retrieves the constant attenuation factor for the light. | |
const float & | GetConstantAttenuationFactor () const |
See above. | |
void | SetConstantAttenuationFactor (float factor) |
Sets the constant attenuation factor for the light. | |
float & | GetLinearAttenuationFactor () |
Retrieves the linear attenuation factor for the light. | |
const float & | GetLinearAttenuationFactor () const |
See above. | |
void | SetLinearAttenuationFactor (float factor) |
Sets the linear attenuation factor for the light. | |
float & | GetQuadraticAttenuationFactor () |
Retrieves the quadratic attenuation factor for the light. | |
const float & | GetQuadraticAttenuationFactor () const |
See above. | |
void | SetQuadraticAttenuationFactor (float factor) |
Sets the quadratic attenuation factor for the light. | |
float & | GetFallOffExponent () |
Retrieves the fall-off exponent for the light. | |
const float & | GetFallOffExponent () const |
See above. | |
void | SetFallOffExponent (float exponent) |
Sets the fall-off exponent for the light. | |
float & | GetFallOffAngle () |
Retrieves the fall-off angle for the light. | |
const float & | GetFallOffAngle () const |
See above. | |
void | SetFallOffAngle (float angle) |
Sets the fall-off angle for the light. | |
float & | GetOuterAngle () |
Retrieves the outer angle for the light. | |
const float & | GetOuterAngle () const |
See above. | |
void | SetOuterAngle (float angle) |
Sets the outer angle for the light. | |
float & | GetPenumbraAngle () |
Retrieves the penumbra angle for the light. | |
const float & | GetPenumbraAngle () const |
See above. | |
void | SetPenumbraAngle (float angle) |
Sets the penumbra angle for the light. | |
float & | GetAspectRatio () |
Retrieves the aspect ratio for the light. | |
const float & | GetAspectRatio () const |
See above. | |
void | SetAspectRatio (float ratio) |
Sets the aspect ratio for the light. | |
float & | GetDropoff () |
Retrieves the drop-off for the light. | |
const float & | GetDropoff () const |
See above. | |
void | SetDropoff (float factor) |
Sets the drop-off for the light. | |
bool | DoesOvershoot () const |
Retrieves whether the directional light overshoots. | |
void | SetOvershoot (bool _overshoots) |
Sets whether the directional light overshoots. | |
FUStatus | LoadFromXML (xmlNode *lightNode) |
[INTERNAL] Reads in the <light> element from a given COLLADA XML tree node. | |
virtual xmlNode * | WriteToXML (xmlNode *parentNode) const |
[INTERNAL] Writes out the <light> element to the given COLLADA XML tree node. |
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.
|
The types of lights supported by this class.
|
|
Constructor: do not use directly. Create new lights using the FCDLibrary::AddEntity function.
|
|
Destructor: do not release directly. Release lights using the FCDLibrary::ReleaseEntity function. All lights are also released with the document that they belong to. |
|
Retrieves whether the directional light overshoots. This value is only used by documents exported by ColladaMax. This value is valid only for directional lights. This flag represents whether the directional light has a global projection, as defined in COLLADA, or a cylinder/prism projection. Note that there is no way to know if the projection is conic or pyramidal.
|
|
Retrieves the aspect ratio for the light. This value is only used by documents exported by ColladaMax. This value is valid only for spot lights and directional lights which project a rectangle (for pyramidal projection). It represents the ratio of the projection's height to the projection's width and defines the projection's rectangle. For pyramidal projections, the fall-off and outer angles represent the width of the projection. Note that there is no way to know if the projection is conic or pyramidal.
|
|
Retrieves the base color for the light. To calculate the light color, multiply the base color with the intensity.
|
|
Retrieves the constant attenuation factor for the light. This value is valid only for point and spot lights.
|
|
Retrieves the drop-off for the light. This value is only used by documents exported by ColladaMaya.
|
|
Retrieves the fall-off angle for the light. This value is valid only for spot lights. It defines the cone of the spot light.
|
|
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.
|
|
Retrieves the intensity of the light. To calculate the light color, multiply the base color with the intensity.
|
|
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.
|
|
Retrieves the linear attenuation factor for the light. This value is valid only for point and spot lights.
|
|
Retrieves the outer angle for the light. This value is valid only for spot lights. This value is only used by documents exported by ColladaMax. 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.
|
|
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.
|
|
Retrieves the quadratic attenuation factor for the light. This value is valid only for point and spot lights.
|
|
Retrieves the entity type for this class. This function is part of the FCDEntity interface.
Reimplemented from FCDEntity. |
|
[INTERNAL] Reads in the <light> element from a given COLLADA XML tree node.
Reimplemented from FCDEntity. |
|
Sets the aspect ratio for the light.
|
|
Sets the base color for the light. To calculate the light color, multiply the base color with the intensity.
|
|
Sets the constant attenuation factor for the light. This value is valid only for point and spot lights.
|
|
Sets the drop-off for the light. This value is only used by documents exported by ColladaMaya.
|
|
Sets the fall-off angle for the light.
|
|
Sets the fall-off exponent for the light.
|
|
Sets the intensity of the light. To calculate the light color, multiply the base color with the intensity.
|
|
Sets the type of the light. The default type of a new light is POINT.
|
|
Sets the linear attenuation factor for the light. This value is valid only for point and spot lights.
|
|
Sets the outer angle for the light.
|
|
Sets whether the directional light overshoots.
|
|
Sets the penumbra angle for the light.
|
|
Sets the quadratic attenuation factor for the light. This value is valid only for point and spot lights.
|
|
[INTERNAL] Writes out the <light> element to the given COLLADA XML tree node.
Reimplemented from FCDEntity. |