CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
OdGiLightAttenuation Class Reference

#include <GiLightTraits.h>

Public Types

enum  AttenuationType { kNone = 0 , kInverseLinear , kInverseSquare }
 

Public Member Functions

 OdGiLightAttenuation ()
 
void setAttenuationType (AttenuationType typ)
 
AttenuationType attenuationType () const
 
void setUseLimits (bool on)
 
bool useLimits () const
 
void setLimits (double startlim, double endlim)
 
double startLimit () const
 
double endLimit () const
 
void save (OdGsFiler *pFiler) const
 
void load (OdGsFiler *pFiler)
 
bool operator== (const OdGiLightAttenuation &other) const
 
bool operator!= (const OdGiLightAttenuation &other) const
 

Detailed Description

This class represents light attenuation parameters.

Corresponding C++ library: TD_Gi <group OdGi_Classes>

See also
<link tv_working_with_lights, Work with Lights>

Definition at line 687 of file GiLightTraits.h.

Member Enumeration Documentation

◆ AttenuationType

Represents attenuation types for lights.

Enumerator
kNone 

No attenuation is used.

kInverseLinear 

Light intensity equals to the inverse of the linear distance from the light source.

kInverseSquare 

Light intensity equals to the inverse of the square distance from the light source. This type of attenuation is the most physically accurate.

Definition at line 704 of file GiLightTraits.h.

Constructor & Destructor Documentation

◆ OdGiLightAttenuation()

OdGiLightAttenuation::OdGiLightAttenuation ( )
inline

Default constructor for the OdGiLightAttenuation class. Initializes the following data members:

Data member Value Description m_attenType OdGiLightAttenuation::kNone Attenuation type for the light. m_bUseAttenLimits false Flag which shows whether attenuation limits are used. m_dAttenStartLimit 1.0 Start attenuation limit. m_dAttenEndLimit 10.0 End attenuation limit.

Definition at line 819 of file GiLightTraits.h.

Member Function Documentation

◆ attenuationType()

OdGiLightAttenuation::AttenuationType OdGiLightAttenuation::attenuationType ( ) const
inline

Retrieves a type of the light attenuation.

Returns
a type of the light attenuation as a value from the AttenuationType enumeration.

Definition at line 832 of file GiLightTraits.h.

◆ endLimit()

double OdGiLightAttenuation::endLimit ( ) const
inline

Retrieves end attenuation limit.

Returns
end attenuation limit as a value of the double type.
Remarks
The end limit defines the distance from the light source beyond which objects in the scene are not lit.

Definition at line 858 of file GiLightTraits.h.

◆ load()

void OdGiLightAttenuation::load ( OdGsFiler pFiler)
inline

Loads the light attenuation parameters from the specified filer.

Parameters
pFiler[in] Pointer to a filer to load parameters from.

Definition at line 870 of file GiLightTraits.h.

◆ operator!=()

bool OdGiLightAttenuation::operator!= ( const OdGiLightAttenuation other) const
inline

Inequality operator for the OdGiLightAttenuation object. Returns true if members of this OdGiLightAttenuation object is not equal to the members other OdGiLightAttenuation object.

Parameters
scaleVec[in] A scale vector to be compared with this scale vector.

Definition at line 885 of file GiLightTraits.h.

◆ operator==()

bool OdGiLightAttenuation::operator== ( const OdGiLightAttenuation other) const
inline

Equality operator for the OdGiLightAttenuation object. Returns true if members of this OdGiLightAttenuation object is equal to the members other OdGiLightAttenuation object.

Parameters
other[in] A OdGiLightAttenuation object to be compared with this OdGiLightAttenuation object.

Definition at line 877 of file GiLightTraits.h.

◆ save()

void OdGiLightAttenuation::save ( OdGsFiler pFiler) const
inline

Saves the light attenuation parameters to the specified filer.

Parameters
pFiler[in] Pointer to a filer to save parameters to.

Definition at line 863 of file GiLightTraits.h.

◆ setAttenuationType()

void OdGiLightAttenuation::setAttenuationType ( AttenuationType  typ)
inline

Specifies type of the light attenuation.

Parameters
typ[in] Attenuation type.

Definition at line 827 of file GiLightTraits.h.

◆ setLimits()

void OdGiLightAttenuation::setLimits ( double  startlim,
double  endlim 
)
inline

Specifies values for both start and end attenuation limits.

Parameters
startlim[in] Start limit that defines the distance from the light source where light begins to affect the scene.
endlim[in] End limit that defines the distance beyond which objects are not affected by the light.

Definition at line 847 of file GiLightTraits.h.

◆ setUseLimits()

void OdGiLightAttenuation::setUseLimits ( bool  on)
inline

Specifies whether attenuation limits should be used.

Parameters
on[in] Flag that specifies whether attenuation limits should be used.

Definition at line 837 of file GiLightTraits.h.

◆ startLimit()

double OdGiLightAttenuation::startLimit ( ) const
inline

Retrieves start attenuation limit.

Returns
start attenuation limit as a value of the double type.
Remarks
The start limit defines the distance from the light source where light begins to affect the scene. Object closer than the start limit are not lit.

Definition at line 853 of file GiLightTraits.h.

◆ useLimits()

bool OdGiLightAttenuation::useLimits ( ) const
inline

Checks whether attenuation limits are used.

Returns
true if attenuation limits are used, false otherwise.

Definition at line 842 of file GiLightTraits.h.


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