#include <light_user.h>
Inheritance diagram for NL3D::CLightUser:

Nevrax France
Definition at line 48 of file light_user.h.
Public Types | |
| enum | TLightMode { DirectionalLight, PointLight, SpotLight } |
Public Member Functions | |
Get methods. | |
| NLMISC::CRGBA | getAmbiant () const |
| float | getConstantAttenuation () const |
| float | getCutoff () const |
| NLMISC::CRGBA | getDiffuse () const |
| NLMISC::CVector | getDirection () const |
| float | getExponent () const |
| float | getLinearAttenuation () const |
| ULight::TLightMode | getMode () const |
| NLMISC::CVector | getPosition () const |
| float | getQuadraticAttenuation () const |
| NLMISC::CRGBA | getSpecular () const |
Set methods. | |
| void | setAmbiant (const NLMISC::CRGBA &ambiant) |
| void | setConstantAttenuation (float constant) |
| void | setCutoff (float cutoff) |
| void | setDiffuse (const NLMISC::CRGBA &diffuse) |
| void | setDirection (const NLMISC::CVector &direction) |
| void | setExponent (float exponent) |
| void | setLinearAttenuation (float linear) |
| void | setMode (ULight::TLightMode mode) |
| void | setPosition (const NLMISC::CVector &position) |
| void | setQuadraticAttenuation (float quadratic) |
| void | setSpecular (const NLMISC::CRGBA &specular) |
Quick setup. | |
| void | setNoAttenuation () |
| void | setupAttenuation (float farAttenuationBegin, float farAttenuationEnd) |
| 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) |
| Quick setup a directional light. | |
| 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) |
| Quick setup a point light. | |
| void | setupSpotExponent (float hotSpotAngle) |
| 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) |
| Quick setup a spotlight. | |
Static Public Member Functions | |
| ULight * | createLight () |
Protected Attributes | |
| CLight | _Light |
Friends | |
| class | CDriverUser |
|
|
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. Implements NL3D::ULight. Definition at line 253 of file light_user.h. References _Light, NL3D::CLight::getAmbiant(), and NL3D_MEM_LIGHT.
00254 {
00255 NL3D_MEM_LIGHT
00256 return _Light.getAmbiant ();
00257 }
|
|
|
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 ); Implements NL3D::ULight. Definition at line 320 of file light_user.h. References _Light, NL3D::CLight::getConstantAttenuation(), and NL3D_MEM_LIGHT.
00321 {
00322 NL3D_MEM_LIGHT
00323 return _Light.getConstantAttenuation ();
00324 }
|
|
|
Get the cutoff of the light in radian. Should be between [0, Pi/2]. Used only for SpotLight. Implements NL3D::ULight. Definition at line 307 of file light_user.h. References _Light, NL3D::CLight::getCutoff(), and NL3D_MEM_LIGHT.
00308 {
00309 NL3D_MEM_LIGHT
00310 return _Light.getCutoff ();
00311 }
|
|
|
Get the diffuse color of the light. Implements NL3D::ULight. Definition at line 262 of file light_user.h. References _Light, NL3D::CLight::getDiffuse(), and NL3D_MEM_LIGHT.
00263 {
00264 NL3D_MEM_LIGHT
00265 return _Light.getDiffuse ();
00266 }
|
|
|
Get the direction of the light. Used only for DirectionalLight and SpotLight. Implements NL3D::ULight. Definition at line 289 of file light_user.h. References _Light, NL3D::CLight::getDirection(), and NL3D_MEM_LIGHT.
00290 {
00291 NL3D_MEM_LIGHT
00292 return _Light.getDirection ();
00293 }
|
|
|
Get the exponent of the light. Used only for SpotLight. Implements NL3D::ULight. Definition at line 298 of file light_user.h. References _Light, NL3D::CLight::getExponent(), and NL3D_MEM_LIGHT.
00299 {
00300 NL3D_MEM_LIGHT
00301 return _Light.getExponent ();
00302 }
|
|
|
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 ); Implements NL3D::ULight. Definition at line 333 of file light_user.h. References _Light, NL3D::CLight::getLinearAttenuation(), and NL3D_MEM_LIGHT.
00334 {
00335 NL3D_MEM_LIGHT
00336 return _Light.getLinearAttenuation ();
00337 }
|
|
|
Get the light mode. Implements NL3D::ULight. Definition at line 244 of file light_user.h. References _Light, NL3D::CLight::getMode(), NL3D_MEM_LIGHT, and uint32.
00245 {
00246 NL3D_MEM_LIGHT
00247 return (ULight::TLightMode)(uint32)_Light.getMode ();
00248 }
|
|
|
Get the position of the light. Used only for SpotLight and PointLight. Implements NL3D::ULight. Definition at line 280 of file light_user.h. References _Light, NL3D::CLight::getPosition(), and NL3D_MEM_LIGHT.
00281 {
00282 NL3D_MEM_LIGHT
00283 return _Light.getPosition ();
00284 }
|
|
|
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 ); Implements NL3D::ULight. Definition at line 346 of file light_user.h. References _Light, NL3D::CLight::getQuadraticAttenuation(), and NL3D_MEM_LIGHT.
00347 {
00348 NL3D_MEM_LIGHT
00349 return _Light.getQuadraticAttenuation ();
00350 }
|
|
|
Get the specular color of the light. Implements NL3D::ULight. Definition at line 271 of file light_user.h. References _Light, NL3D::CLight::getSpecular(), and NL3D_MEM_LIGHT.
00272 {
00273 NL3D_MEM_LIGHT
00274 return _Light.getSpecular ();
00275 }
|
|
|
Set the ambiant color of the light. Implements NL3D::ULight. Definition at line 137 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setAmbiant().
00138 {
00139 NL3D_MEM_LIGHT
00140 _Light.setAmbiant (ambiant);
00141 }
|
|
|
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 ); Implements NL3D::ULight. Definition at line 204 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setConstantAttenuation().
00205 {
00206 NL3D_MEM_LIGHT
00207 _Light.setConstantAttenuation (constant);
00208 }
|
|
|
Set the cutoff of the light in radian. Should be between [0, Pi/2]. Used only for SpotLight. Implements NL3D::ULight. Definition at line 191 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setCutoff().
00192 {
00193 NL3D_MEM_LIGHT
00194 _Light.setCutoff (cutoff);
00195 }
|
|
|
Set the diffuse color of the light. Implements NL3D::ULight. Definition at line 146 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setDiffuse().
00147 {
00148 NL3D_MEM_LIGHT
00149 _Light.setDiffuse (diffuse);
00150 }
|
|
|
Set the direction of the light. Used only for DirectionalLight and SpotLight. Implements NL3D::ULight. Definition at line 173 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setDirection().
00174 {
00175 NL3D_MEM_LIGHT
00176 _Light.setDirection (direction);
00177 }
|
|
|
Set the Intensity distribution of the light. Should be between [0, 1]. Used only for SpotLight. Implements NL3D::ULight. Definition at line 182 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setExponent().
00183 {
00184 NL3D_MEM_LIGHT
00185 _Light.setExponent (exponent);
00186 }
|
|
|
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 ); Implements NL3D::ULight. Definition at line 217 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setLinearAttenuation().
00218 {
00219 NL3D_MEM_LIGHT
00220 _Light.setLinearAttenuation (linear);
00221 }
|
|
|
Set the light mode. Implements NL3D::ULight. Definition at line 128 of file light_user.h. References _Light, NL3D_MEM_LIGHT, NL3D::CLight::setMode(), and uint32.
00129 {
00130 NL3D_MEM_LIGHT
00131 _Light.setMode ((CLight::TLightMode)(uint32)mode);
00132 }
|
|
|
Set no attenuation. The light will not use attenuation. Implements NL3D::ULight. Definition at line 101 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setNoAttenuation().
00102 {
00103 NL3D_MEM_LIGHT
00104 _Light.setNoAttenuation ();
00105 }
|
|
|
Set the position of the light. Used only for SpotLight and PointLight. Implements NL3D::ULight. Definition at line 164 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setPosition().
00165 {
00166 NL3D_MEM_LIGHT
00167 _Light.setPosition (position);
00168 }
|
|
|
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 ); Implements NL3D::ULight. Definition at line 230 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setQuadraticAttenuation().
00231 {
00232 NL3D_MEM_LIGHT
00233 _Light.setQuadraticAttenuation (quadratic);
00234 }
|
|
|
Set the specular color of the light. Implements NL3D::ULight. Definition at line 155 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setSpecular().
00156 {
00157 NL3D_MEM_LIGHT
00158 _Light.setSpecular (specular);
00159 }
|
|
||||||||||||
|
Setup attenuation with begin and end attenuation distance.
Implements NL3D::ULight. Definition at line 89 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setupAttenuation().
00090 {
00091 NL3D_MEM_LIGHT
00092 _Light.setupAttenuation (farAttenuationBegin, farAttenuationEnd);
00093 }
|
|
||||||||||||||||||||||||||||||||
|
Quick setup a directional light.
Implements NL3D::ULight. Definition at line 60 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setupDirectional().
00062 {
00063 NL3D_MEM_LIGHT
00064 _Light.setupDirectional (ambiant, diffuse, specular, direction, constant, linear, quadratic);
00065 }
|
|
||||||||||||||||||||||||||||||||||||
|
Quick setup a point light.
Implements NL3D::ULight. Definition at line 68 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setupPointLight().
00070 {
00071 NL3D_MEM_LIGHT
00072 _Light.setupPointLight (ambiant, diffuse, specular, position, direction, constant, linear, quadratic);
00073 }
|
|
|
Setup spot exponent with angle of the hotspot.
Implements NL3D::ULight. Definition at line 113 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setupSpotExponent().
00114 {
00115 NL3D_MEM_LIGHT
00116 _Light.setupSpotExponent (hotSpotAngle);
00117 }
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Quick setup a spotlight.
Implements NL3D::ULight. Definition at line 76 of file light_user.h. References _Light, NL3D_MEM_LIGHT, and NL3D::CLight::setupSpotLight().
00078 {
00079 NL3D_MEM_LIGHT
00080 _Light.setupSpotLight (ambiant, diffuse, specular, position, direction, exponent, cutoff, constant, linear, quadratic);
00081 }
|
|
|
Definition at line 52 of file light_user.h. |
|
1.3.6