00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef NL_U_LIGHT_H
00027 #define NL_U_LIGHT_H
00028
00029 #include "nel/misc/types_nl.h"
00030 #include "nel/misc/rgba.h"
00031 #include "nel/misc/vector.h"
00032
00033
00034 namespace NL3D
00035 {
00036
00037
00044 class ULight
00045 {
00046 public:
00047
00048 enum TLightMode
00049 {
00050
00051 DirectionalLight,
00052
00053
00054 PointLight,
00055
00056
00057 SpotLight
00058 };
00059
00063 static ULight *createLight ();
00064
00066
00067
00069 virtual void setupDirectional (const NLMISC::CRGBA& ambiant, const NLMISC::CRGBA& diffuse, const NLMISC::CRGBA& specular, const NLMISC::CVector& direction,
00070 float constant=1, float linear=0, float quadratic=0) = 0;
00071
00073 virtual void setupPointLight (const NLMISC::CRGBA& ambiant, const NLMISC::CRGBA& diffuse, const NLMISC::CRGBA& specular, const NLMISC::CVector& position,
00074 const NLMISC::CVector& direction, float constant=1, float linear=0, float quadratic=0) = 0;
00075
00077 virtual void setupSpotLight (const NLMISC::CRGBA& ambiant, const NLMISC::CRGBA& diffuse, const NLMISC::CRGBA& specular, const NLMISC::CVector& position,
00078 const NLMISC::CVector& direction, float exponent, float cutoff, float constant=1, float linear=0, float quadratic=0) = 0;
00079
00086 virtual void setupAttenuation (float farAttenuationBegin, float farAttenuationEnd) = 0;
00087
00094 virtual void setNoAttenuation () = 0;
00095
00102 virtual void setupSpotExponent (float hotSpotAngle) = 0;
00103
00105
00106
00108
00109
00113 virtual void setMode (ULight::TLightMode mode) = 0;
00114
00118 virtual void setAmbiant (const NLMISC::CRGBA& ambiant) = 0;
00119
00123 virtual void setDiffuse (const NLMISC::CRGBA& diffuse) = 0;
00124
00128 virtual void setSpecular (const NLMISC::CRGBA& specular) = 0;
00129
00133 virtual void setPosition (const NLMISC::CVector& position) = 0;
00134
00138 virtual void setDirection (const NLMISC::CVector& direction) = 0;
00139
00143 virtual void setExponent (float exponent) = 0;
00144
00148 virtual void setCutoff (float cutoff) = 0;
00149
00157 virtual void setConstantAttenuation (float constant) = 0;
00158
00166 virtual void setLinearAttenuation (float linear) = 0;
00167
00175 virtual void setQuadraticAttenuation (float quadratic) = 0;
00176
00178
00180
00181
00185 virtual ULight::TLightMode getMode () const = 0;
00186
00190 virtual NLMISC::CRGBA getAmbiant () const = 0;
00191
00195 virtual NLMISC::CRGBA getDiffuse () const = 0;
00196
00200 virtual NLMISC::CRGBA getSpecular () const = 0;
00201
00205 virtual NLMISC::CVector getPosition () const = 0;
00206
00210 virtual NLMISC::CVector getDirection () const = 0;
00211
00215 virtual float getExponent () const = 0;
00216
00220 virtual float getCutoff () const = 0;
00221
00229 virtual float getConstantAttenuation () const = 0;
00230
00238 virtual float getLinearAttenuation () const = 0;
00239
00247 virtual float getQuadraticAttenuation () const = 0;
00248
00250 };
00251
00252
00253 }
00254
00255
00256 #endif // NL_U_LIGHT_H
00257
00258