00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00017
00019
00020
00021
00023
00024 #ifndef _LIGHT_H
00025 #define _LIGHT_H
00026
00027 #include <eclipseray/eclipse.h>
00028 #include <eclipseray/yrtypes.h>
00029
00031
00036
00045
00047 class Light : public EclipseObject
00048 {
00049 DECLARE_PYTHON_HEADER;
00050
00051 public:
00052
00053
00054
00055
00056
00057
00059 virtual ~Light();
00060
00061
00062
00063
00064
00068 inline YRLight* GetLight(){ return m_pYRLight; }
00069
00070
00071
00072
00073
00079 static bool PyTypeCheck( PYOBJECT a_pObject );
00080
00086 virtual PYOBJECT PyAsString();
00087
00088 protected:
00089
00091 Light();
00092
00094 inline YRLight*& GetYRLight(){ return m_pYRLight; }
00095
00097 inline int& ShadowSamples(){ return m_nShadowSamples; }
00098
00100 inline YRColorRGB& ShadowColor(){ return m_nShadowColor; }
00101
00102
00103 bool GenerateLight( const char* a_sID, YRParameterMap& a_params );
00104
00106 virtual PYOBJECT GetPyStringRep() ECLIPSE_PURE;
00107
00108 private:
00109
00110 int m_nShadowSamples;
00111 YRColorRGB m_nShadowColor;
00112 YRLight* m_pYRLight;
00113 };
00114
00115
00117
00122
00126
00128 class PointLight : public Light
00129 {
00130
00131 public:
00132
00142 PointLight( const char* a_sID, const YRPoint3D& a_position, const YRColorRGB& a_color,
00143 float a_fBrightness, const YRColorRGB& a_shadowColor, int a_nShadowSamples );
00144
00152 PointLight( const char* a_sID, const YRPoint3D& a_position, const YRColorRGB& a_color,
00153 float a_fBrightness);
00154
00155
00156 protected:
00157
00159 ~PointLight();
00160
00161
00162 virtual PYOBJECT GetPyStringRep();
00163
00169 virtual void DeleteObject();
00170
00171 };
00172
00174
00182
00184 class AreaLight : public Light
00185 {
00186 public:
00187
00198 AreaLight( const char* a_sID, const YRColorRGB& a_color, const YRPoint3D& a_corner,
00199 const YRPoint3D& a_point1, const YRPoint3D& a_point2, float a_fPower, int a_nSamples);
00200
00201 protected:
00202
00203
00204 ~AreaLight();
00205
00206
00207 virtual PYOBJECT GetPyStringRep();
00208
00209
00215 virtual void DeleteObject();
00216
00217 };
00218
00219
00221
00226
00228 class AmbientLight : public Light
00229 {
00230 public:
00236 AmbientLight( const char* a_sID, YRColorRGB& a_color );
00237
00238 protected:
00239
00240
00241 ~AmbientLight();
00242
00243
00244 virtual PYOBJECT GetPyStringRep();
00245
00251 virtual void DeleteObject();
00252
00253 private:
00254
00255 static bool m_bFactoryRegistered;
00256
00257 };
00258
00259
00261
00266
00268 class SpotLight : public Light
00269 {
00270 public:
00271
00282 SpotLight( const char* a_sID, YRColorRGB a_color, float a_fConeAngle, YRPoint3D a_from, YRPoint3D a_to, float a_fPower, float a_fFalloff );
00283
00284
00285 protected:
00286
00287
00288 ~SpotLight();
00289
00290
00291 virtual PYOBJECT GetPyStringRep();
00292
00298 virtual void DeleteObject();
00299
00300 };
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310 #endif