00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KEOS_LIGHT_H
00023 #define KEOS_LIGHT_H
00024
00025 #include "KeosPrerequisites.h"
00026 #include "KeosColor.h"
00027 #include "KeosMath.h"
00028
00029 namespace Keos
00030 {
00031
00034 class KEOS_EXPORT CLight
00035 {
00036 public:
00037
00039 enum TLightType
00040 {
00042 LT_POINT,
00044 LT_DIRECTIONAL,
00046 LT_SPOT
00047 };
00048
00051 CLight();
00052
00055 ~CLight();
00056
00059 void SetType(TLightType nType);
00060
00063 TLightType GetType(void) const;
00064
00067 void SetDiffuseColor(float fRed, float fGreen, float fBlue);
00068
00071 void SetDiffuseColor(const CColor& Color);
00072
00075 const CColor& GetDiffuseColor(void) const;
00076
00079 void SetSpecularColor(float fRed, float fGreen, float fBlue);
00080
00083 void SetSpecularColor(const CColor& Color);
00084
00087 const CColor& GetSpecularColor(void) const;
00088
00095 void SetAttenuation(Real range, Real constant, Real linear, Real quadratic);
00096
00099 Real GetAttenuationRange(void) const;
00100
00103 Real GetAttenuationConstant(void) const;
00104
00107 Real GetAttenuationLinear(void) const;
00108
00111 Real GetAttenuationQuadric(void) const;
00112
00119 void SetSpotRange(const CRadian& innerAngle, const CRadian& outerAngle, Real falloff = 1.0);
00120
00123 const CRadian& GetSpotInnerAngle(void) const;
00124
00127 const CRadian& GetSpotOuterAngle(void) const;
00128
00131 Real GetSpotFalloff(void) const;
00132
00135 void SetSpotInnerAngle(const CRadian& val);
00136
00139 void SetSpotOuterAngle(const CRadian& val);
00140
00143 void SetSpotFalloff(Real val);
00144
00145
00149 void SetPosition(float x, float y, float z);
00150
00154 void SetPosition(const TVector3F& Vec);
00155
00158 const TVector3F& GetPosition(void) const;
00159
00163 void SetDirection(float x, float y, float z);
00164
00168 void SetDirection(const TVector3F& Vec);
00169
00172 const TVector3F& GetDirection(void) const;
00173
00174 private:
00175
00176 TLightType m_nLightType;
00177 TVector3F m_Position;
00178 CColor m_Diffuse;
00179 CColor m_Specular;
00180
00181 TVector3F m_Direction;
00182
00183 CRadian m_SpotOuter;
00184 CRadian m_SpotInner;
00185 Real m_SpotFalloff;
00186
00187 Real m_Range;
00188 Real m_AttenuationConst;
00189 Real m_AttenuationLinear;
00190 Real m_AttenuationQuad;
00191 };
00192
00194 typedef CSmartPtr<CLight, CRefCount> TLightPtr;
00195
00196 }
00197
00198 #endif // KEOS_LIGHT_H