My Project
Public Member Functions | Static Public Member Functions | Friends | List of all members
ParaEngine::CLightParam Class Reference

a single light in ParaEngine. More...

#include <LightParam.h>

Inheritance diagram for ParaEngine::CLightParam:
ParaEngine::_Para3DLight

Public Member Functions

void MakeWhitePointLight ()
 make the current light a white point light with default value. More...
 
const char * ToString ()
 return the parameters as a string. More...
 
void FromString (const char *str)
 convert a string returned by ToString() to this object. More...
 

Static Public Member Functions

static bool IsGreater (const CLightParam &elem1, const CLightParam &elem2)
 
static bool IsGreaterPt (const CLightParam *elem1, const CLightParam *elem2)
 

Friends

class CLightManager
 

Additional Inherited Members

- Public Attributes inherited from ParaEngine::_Para3DLight
D3DLIGHTTYPE Type
 
LinearColor Diffuse
 
LinearColor Specular
 
LinearColor Ambient
 
Vector3 Position
 
Vector3 Direction
 
float Range
 
float Falloff
 
float Attenuation0
 
float Attenuation1
 
float Attenuation2
 
float Theta
 
float Phi
 

Detailed Description

a single light in ParaEngine.

Member Function Documentation

§ FromString()

void CLightParam::FromString ( const char *  str)

convert a string returned by ToString() to this object.

See also
ToString()

§ MakeWhitePointLight()

void CLightParam::MakeWhitePointLight ( )

make the current light a white point light with default value.

§ ToString()

const char * CLightParam::ToString ( )

return the parameters as a string.

This is usually used for serialization. format is "Type Range (r g b a) att0 att1 att2" D3DLIGHTTYPE Type; Type of light source

  • D3DLIGHT_POINT = 1,
  • D3DLIGHT_SPOT = 2,
  • D3DLIGHT_DIRECTIONAL = 3, float Range; Cutoff range D3DCOLORVALUE Diffuse; Diffuse color of light float Attenuation0; Constant attenuation float Attenuation1; Linear attenuation float Attenuation2; Quadratic attenuation e.g. "1 7.0 (1 1 0 1) 0.3 0.1 1" light intensity is calculated as 1/(Attenuation0+d*Attenuation1+d*d*Attenuation2), where d is the distance from the light to object center.
    Returns
    see above

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