00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NELIGHT_H
00028 #define __NELIGHT_H
00029
00030
00031 #include "base.h"
00032 #include "sceneentity.h"
00033 #include "color.h"
00034 #include "nemath.h"
00035
00036
00043 namespace NeoEngine
00044 {
00045
00046
00057 class NEOENGINE_API Light : public SceneEntity
00058 {
00059 public:
00060
00061 DefineVisitable();
00062
00063
00064 public:
00065
00069 enum LIGHTTYPE
00070 {
00072 DIRECTIONAL = 0,
00073
00075 POINT = 1,
00076
00078 SPOT = 2,
00079
00081 AMBIENT = 3
00082 };
00083
00084
00088 enum LIGHTFLAG
00089 {
00091 NOFLAGS = 0,
00092
00094 CASTSHADOWS = 1
00095 };
00096
00097
00098 protected:
00099
00101 LIGHTTYPE m_eType;
00102
00104 int m_iFlags;
00105
00106
00107 public:
00108
00110 Vector3d m_kDirection;
00111
00113 Color m_kAmbient;
00114
00116 Color m_kDiffuse;
00117
00119 Color m_kSpecular;
00120
00122 float m_fConstantAttenuation;
00123
00125 float m_fLinearAttenuation;
00126
00128 float m_fQuadraticAttenuation;
00129
00130
00136 Light( LIGHTTYPE eType, int iFlags = NOFLAGS, const Vector3d &rkDirection = Vector3d::ZERO );
00137
00141 inline LIGHTTYPE GetType() const { return m_eType; }
00142
00146 inline int GetFlags() const { return m_iFlags; }
00147
00151 Vector3d GetDirection();
00152
00159 virtual bool Render( Frustum *pkFrustum = 0, bool bForce = false );
00160 };
00161
00162
00163 };
00164
00165
00166 #endif