#include <u_light.h>
Inheritance diagram for NL3D::ULight:
Nevrax France
Definition at line 44 of file u_light.h.
Public Types | |
enum | TLightMode { DirectionalLight, PointLight, SpotLight } |
Public Member Functions | |
Get methods. | |
virtual NLMISC::CRGBA | getAmbiant () const=0 |
virtual float | getConstantAttenuation () const=0 |
virtual float | getCutoff () const=0 |
virtual NLMISC::CRGBA | getDiffuse () const=0 |
virtual NLMISC::CVector | getDirection () const=0 |
virtual float | getExponent () const=0 |
virtual float | getLinearAttenuation () const=0 |
virtual ULight::TLightMode | getMode () const=0 |
virtual NLMISC::CVector | getPosition () const=0 |
virtual float | getQuadraticAttenuation () const=0 |
virtual NLMISC::CRGBA | getSpecular () const=0 |
Set methods. | |
virtual void | setAmbiant (const NLMISC::CRGBA &ambiant)=0 |
virtual void | setConstantAttenuation (float constant)=0 |
virtual void | setCutoff (float cutoff)=0 |
virtual void | setDiffuse (const NLMISC::CRGBA &diffuse)=0 |
virtual void | setDirection (const NLMISC::CVector &direction)=0 |
virtual void | setExponent (float exponent)=0 |
virtual void | setLinearAttenuation (float linear)=0 |
virtual void | setMode (ULight::TLightMode mode)=0 |
virtual void | setPosition (const NLMISC::CVector &position)=0 |
virtual void | setQuadraticAttenuation (float quadratic)=0 |
virtual void | setSpecular (const NLMISC::CRGBA &specular)=0 |
Quick setup. | |
virtual void | setNoAttenuation ()=0 |
virtual void | setupAttenuation (float farAttenuationBegin, float farAttenuationEnd)=0 |
virtual void | setupDirectional (const NLMISC::CRGBA &ambiant, const NLMISC::CRGBA &diffuse, const NLMISC::CRGBA &specular, const NLMISC::CVector &direction, float constant=1, float linear=0, float quadratic=0)=0 |
Quick setup a directional light. | |
virtual void | setupPointLight (const NLMISC::CRGBA &ambiant, const NLMISC::CRGBA &diffuse, const NLMISC::CRGBA &specular, const NLMISC::CVector &position, const NLMISC::CVector &direction, float constant=1, float linear=0, float quadratic=0)=0 |
Quick setup a point light. | |
virtual void | setupSpotExponent (float hotSpotAngle)=0 |
virtual void | setupSpotLight (const NLMISC::CRGBA &ambiant, const NLMISC::CRGBA &diffuse, const NLMISC::CRGBA &specular, const NLMISC::CVector &position, const NLMISC::CVector &direction, float exponent, float cutoff, float constant=1, float linear=0, float quadratic=0)=0 |
Quick setup a spotlight. | |
Static Public Member Functions | |
ULight * | createLight () |
|
Definition at line 48 of file u_light.h.
00049 { 00050 // The light is directional. 00051 DirectionalLight, 00052 00053 // The light is a point. 00054 PointLight, 00055 00056 // The light is a spotlight with a cone. 00057 SpotLight 00058 }; |
|
This is the static function create a stand alone light. Definition at line 34 of file light_user.cpp. References NL3D_MEM_LIGHT.
00035 { 00036 NL3D_MEM_LIGHT 00037 // return the new light 00038 return new CLightUser; 00039 } |
|
Get the ambiant color of the light. Implemented in NL3D::CLightUser. |
|
Get constant attenuation. The intensity of the light is attenuated this way: light_intensity = light_intensity / ( CONSTANT_ATTENUATION + vertex_light_distance * LINEAR_ATTENUATION + vertex_light_distance * vertex_light_distance * QUADRATIC_ATTENUATION ); Implemented in NL3D::CLightUser. |
|
Get the cutoff of the light in radian. Should be between [0, Pi/2]. Used only for SpotLight. Implemented in NL3D::CLightUser. |
|
Get the diffuse color of the light. Implemented in NL3D::CLightUser. |
|
Get the direction of the light. Used only for DirectionalLight and SpotLight. Implemented in NL3D::CLightUser. |
|
Get the exponent of the light. Used only for SpotLight. Implemented in NL3D::CLightUser. |
|
Get linear attenuation. The intensity of the light is attenuated this way: light_intensity = light_intensity / ( CONSTANT_ATTENUATION + vertex_light_distance * LINEAR_ATTENUATION + vertex_light_distance * vertex_light_distance * QUADRATIC_ATTENUATION ); Implemented in NL3D::CLightUser. |
|
Get the light mode. Implemented in NL3D::CLightUser. |
|
Get the position of the light. Used only for SpotLight and PointLight. Implemented in NL3D::CLightUser. |
|
Get quadratic attenuation. The intensity of the light is attenuated this way: light_intensity = light_intensity / ( CONSTANT_ATTENUATION + vertex_light_distance * LINEAR_ATTENUATION + vertex_light_distance * vertex_light_distance * QUADRATIC_ATTENUATION ); Implemented in NL3D::CLightUser. |
|
Get the specular color of the light. Implemented in NL3D::CLightUser. |
|
Set the ambiant color of the light. Implemented in NL3D::CLightUser. |
|
Set constant attenuation. The intensity of the light is attenuated this way: light_intensity = light_intensity / ( CONSTANT_ATTENUATION + vertex_light_distance * LINEAR_ATTENUATION + vertex_light_distance * vertex_light_distance * QUADRATIC_ATTENUATION ); Implemented in NL3D::CLightUser. |
|
Set the cutoff of the light in radian. Should be between [0, Pi/2]. Used only for SpotLight. Implemented in NL3D::CLightUser. |
|
Set the diffuse color of the light. Implemented in NL3D::CLightUser. |
|
Set the direction of the light. Used only for DirectionalLight and SpotLight. Implemented in NL3D::CLightUser. |
|
Set the Intensity distribution of the light. Should be between [0, 1]. Used only for SpotLight. Implemented in NL3D::CLightUser. |
|
Set linear attenuation. The intensity of the light is attenuated this way: light_intensity = light_intensity / ( CONSTANT_ATTENUATION + vertex_light_distance * LINEAR_ATTENUATION + vertex_light_distance * vertex_light_distance * QUADRATIC_ATTENUATION ); Implemented in NL3D::CLightUser. |
|
Set the light mode. Implemented in NL3D::CLightUser. |
|
Set no attenuation. The light will not use attenuation. Implemented in NL3D::CLightUser. |
|
Set the position of the light. Used only for SpotLight and PointLight. Implemented in NL3D::CLightUser. |
|
Set quadratic attenuation. The intensity of the light is attenuated this way: light_intensity = light_intensity / ( CONSTANT_ATTENUATION + vertex_light_distance * LINEAR_ATTENUATION + vertex_light_distance * vertex_light_distance * QUADRATIC_ATTENUATION ); Implemented in NL3D::CLightUser. |
|
Set the specular color of the light. Implemented in NL3D::CLightUser. |
|
Setup attenuation with begin and end attenuation distance.
Implemented in NL3D::CLightUser. |
|
Quick setup a directional light.
Implemented in NL3D::CLightUser. |
|
Quick setup a point light.
Implemented in NL3D::CLightUser. |
|
Setup spot exponent with angle of the hotspot.
Implemented in NL3D::CLightUser. |
|
Quick setup a spotlight.
Implemented in NL3D::CLightUser. |