KFbxLight Class Reference

#include <kfbxlight.h>

Inherits KFbxNodeAttribute.

Inheritance diagram for KFbxLight:

Inheritance graph
List of all members.

Detailed Description

This node attribute contains methods for accessing the properties of a light.

Definition at line 60 of file kfbxlight.h.

Light Properties

enum  ELightType
 Light types. More...
enum  EDecayType
 Decay types. More...
void SetLightType (ELightType pLightType)
 Set the light type.
ELightType GetLightType () const
 Get the light type.
void SetCastLight (bool pCastLight)
 Activate or disable the light.
bool GetCastLight () const
 Get the light state.
void SetCastShadows (bool pCastShadows)
 Set the shadow state for the light.
bool GetCastShadows () const
 Get the shadow state for the light.
void SetShadowColor (KFbxColor &pColor)
 Set the shadow color for the light.
KFbxColor GetShadowColor () const
 Get the shadow color for the light.
void SetShadowTexture (KFbxTexture *pTexture)
 Set the shadow texture for the light.
KFbxTextureGetShadowTexture () const
 Get the light state.

Light Property Names

static const char * sDecayType
static const char * sDecayStart
static const char * sEnableNearAttenuation
static const char * sNearAttenuationStart
static const char * sNearAttenuationEnd
static const char * sEnableFarAttenuation
static const char * sFarAttenuationStart
static const char * sFarAttenuationEnd
static const char * sCastShadows
static const char * sShadowColor

Gobo properties

bool SetFileName (char *pFileName)
 Set the associated gobo file.
char const * GetFileName () const
 Get the associated gobo file path.
void SetDecayType (EDecayType pDecayType)
 Sets the decay type.
EDecayType GetDecayType () const
 Gets the decay type.
void SetDecayStart (double pDist)
 Sets the distance at which the light's intensity will decay.
double GetDecayStart () const
 Gets the distance at which the light instensity will decay.
void SetGroundProjection (bool pEnable)
 Enable gobo ground projection.
bool GetGroundProjection () const
 Get gobo ground projection flag.
void SetVolumetricProjection (bool pEnable)
 Enable gobo volumetric light projection.
bool GetVolumetricProjection () const
 Get gobo volumetric light projection flag.
void SetFrontVolumetricProjection (bool pEnable)
 Enable gobo front volumetric projection.
bool GetFrontVolumetricProjection () const
 Get gobo front volumetric light projection flag.

Default Animation Values

This set of functions provide direct access to default animation values specific to a light.

The default animation values are found in the default take node of the associated node. These functions only work if the light has been associated with a node.

void SetDefaultColor (KFbxColor &pColor)
 Set default color.
KFbxColorGetDefaultColor (KFbxColor &pColor) const
 Get default color.
void SetDefaultIntensity (double pIntensity)
 Set default intensity.
double GetDefaultIntensity () const
 Get default intensity.
void SetDefaultConeAngle (double pConeAngle)
 Set default cone angle in degrees.
double GetDefaultConeAngle () const
 Get default cone angle in degrees.
void SetDefaultFog (double pFog)
 Set default fog.
double GetDefaultFog () const
 Get default fog.

Public Member Functions

virtual EAttributeType GetAttributeType () const
 Return the type of node attribute which is EAttributeType::eLIGHT.


Member Enumeration Documentation

enum ELightType

Light types.

  • ePOINT
  • eDIRECTIONAL
  • eSPOT

Definition at line 96 of file kfbxlight.h.

enum EDecayType

Decay types.

Used for setting the attenuation of the light.

  • eNONE No decay. The light's intensity will not diminish with distance.
  • eLINEAR Linear decay. The light's intensity will diminish linearly with the distance from the light.
  • eQUADRATIC Quadratic decay. The light's intensity will diminish with the squared distance from the light. This is the most physically accurate decay rate.
  • eCUBIC Cubic decay. The light's intensity will diminish with the cubed distance from the light.

Definition at line 110 of file kfbxlight.h.


Member Function Documentation

virtual EAttributeType GetAttributeType (  )  const [virtual]

Return the type of node attribute which is EAttributeType::eLIGHT.

Reimplemented from KFbxNodeAttribute.

void SetLightType ( ELightType  pLightType  ) 

Set the light type.

Parameters:
pLightType The light type.

ELightType GetLightType (  )  const

Get the light type.

Returns:
The current light type.

void SetCastLight ( bool  pCastLight  ) 

Activate or disable the light.

Parameters:
pCastLight Set to true to enable the light.

bool GetCastLight (  )  const

Get the light state.

Returns:
true if the light is currently active.

void SetCastShadows ( bool  pCastShadows  ) 

Set the shadow state for the light.

Parameters:
pCastShadows Set to true to have the light cast shadows.

bool GetCastShadows (  )  const

Get the shadow state for the light.

Returns:
true if the light is currently casting shadows.

void SetShadowColor ( KFbxColor pColor  ) 

Set the shadow color for the light.

Parameters:
pColor The shadow color for the light expressed as kFbxColor.

KFbxColor GetShadowColor (  )  const

Get the shadow color for the light.

Returns:
The shadow color of the light expressed as kFbxColor.

void SetShadowTexture ( KFbxTexture pTexture  ) 

Set the shadow texture for the light.

Parameters:
pTexture The texture cast by the light shadow.

KFbxTexture* GetShadowTexture (  )  const

Get the light state.

Returns:
Pointer to the texture cast by the light shadow, or NULL if the shadow texture has not been set.

bool SetFileName ( char *  pFileName  ) 

Set the associated gobo file.

Parameters:
pFileName The path of the gobo file.
Returns:
false if the pointer is null.
Remarks:
The gobo file name must be valid. In addition, the gobo file must be an 8 bit grayscale TIFF image file with height and width dimensions must equal a power of two, and it cannot exceed 256 pixels.

char const* GetFileName (  )  const

Get the associated gobo file path.

Returns:
The associated gobo file path, or an empty string if the gobo file has not been set (see KFbxGobo::SetFileName())

void SetDecayType ( EDecayType  pDecayType  ) 

Sets the decay type.

Parameters:
pDecayType The decay type

EDecayType GetDecayType (  )  const

Gets the decay type.

Returns:
The decay type

void SetDecayStart ( double  pDist  ) 

Sets the distance at which the light's intensity will decay.

Parameters:
The distance

double GetDecayStart (  )  const

Gets the distance at which the light instensity will decay.

Returns:
The distance

void SetGroundProjection ( bool  pEnable  ) 

Enable gobo ground projection.

Parameters:
pEnable Set to true to have the gobo project on the ground/floor.

bool GetGroundProjection (  )  const

Get gobo ground projection flag.

Returns:
true if gobo ground projection is enabled.

void SetVolumetricProjection ( bool  pEnable  ) 

Enable gobo volumetric light projection.

Parameters:
pEnable Set to true to enable volumetric lighting projection.

bool GetVolumetricProjection (  )  const

Get gobo volumetric light projection flag.

Returns:
true if gobo volumetric light projection is enabled.

void SetFrontVolumetricProjection ( bool  pEnable  ) 

Enable gobo front volumetric projection.

Parameters:
pEnable Set to true to enable front volumetric lighting projection.
Remarks:
This option is not supported in MotionBuilder.

bool GetFrontVolumetricProjection (  )  const

Get gobo front volumetric light projection flag.

Returns:
true if gobo front volumetric light projection is enabled.
Remarks:
This option is not supported in MotionBuilder.

void SetDefaultColor ( KFbxColor pColor  ) 

Set default color.

Parameters:
pColor The color of the light.
Remarks:
The default value is white.

KFbxColor& GetDefaultColor ( KFbxColor pColor  )  const

Get default color.

Parameters:
pColor The color of the light.
Returns:
Input parameter filled with appropriate data.
Remarks:
The default value is white.

void SetDefaultIntensity ( double  pIntensity  ) 

Set default intensity.

Parameters:
pIntensity The intensity value of the light.
Remarks:
The intensity range is from 0 to 200, where 200 is full intensity. The default value is 100.

double GetDefaultIntensity (  )  const

Get default intensity.

Returns:
The intensity value of the light.
Remarks:
The intensity range is from 0 to 200, where 200 is full intensity. The default value is 100.

void SetDefaultConeAngle ( double  pConeAngle  ) 

Set default cone angle in degrees.

Parameters:
pConeAngle The cone angle value of the light.
Remarks:
The cone angle has range is from 0 to 160 degrees. The default value is 45 degrees. This function has no effect if the light type is not set to eSPOT.

double GetDefaultConeAngle (  )  const

Get default cone angle in degrees.

Returns:
The cone angle value of the light.
Remarks:
The cone angle has range is from 0 to 160 degrees. The default value is 45 degrees. This function has no effect if the light type is not set to eSPOT.

void SetDefaultFog ( double  pFog  ) 

Set default fog.

Parameters:
pFog The fog value of the light.
Remarks:
This fog range is from 0 to 200, where 200 is full fog opacity. The default value is 50. This function has no effect if the light type is not set to eSPOT.

double GetDefaultFog (  )  const

Get default fog.

Returns:
The fog value of the light.
Remarks:
This fog range is from 0 to 200, where 200 is full fog opacity. The default value is 50. This function has no effect if the light type is not set to eSPOT.