"L. Spiro Engine"
|
00001 00017 #ifndef __LSE_LIGHTBASE_H__ 00018 #define __LSE_LIGHTBASE_H__ 00019 00020 #include "../LSEEngine.h" 00021 #include "../Entity/LSEActor.h" 00022 #include "SharedPtr/LSTLSharedPtr.h" 00023 00024 namespace lse { 00025 00026 // == Enumerations. 00030 enum LSE_LIGHT_TYPE { 00031 LSE_LT_DIRECTIONAL, 00032 LSE_LT_POINT, 00033 LSE_LT_SPOT, 00034 LSE_LT_NONE, 00035 }; 00036 00045 class CLightBase : public CActor { 00046 public : 00047 // == Various constructors. 00048 LSE_CALLCTOR CLightBase(); 00049 00050 00051 // == Functions. 00057 virtual LSE_LIGHT_TYPE LSE_CALL LightType() const; 00058 00064 LSE_INLINE const CVector3 & LSE_CALL Diffuse() const; 00065 00071 LSE_INLINE CVector3 & LSE_CALL Diffuse(); 00072 00078 LSE_INLINE const CVector3 & LSE_CALL Ambient() const; 00079 00085 LSE_INLINE CVector3 & LSE_CALL Ambient(); 00086 00092 LSE_INLINE const CVector3 & LSE_CALL Specular() const; 00093 00099 LSE_INLINE CVector3 & LSE_CALL Specular(); 00100 00106 LSE_INLINE LSREAL LSE_CALL Size() const; 00107 00113 LSE_INLINE LSREAL & LSE_CALL Size(); 00114 00120 LSE_INLINE LSBOOL LSE_CALL Active() const; 00121 00127 LSE_INLINE LSVOID LSE_CALL SetActive( LSBOOL _bVal ); 00128 00134 LSE_INLINE LSBOOL LSE_CALL CastsShadows() const; 00135 00141 LSE_INLINE LSVOID LSE_CALL SetCastsShadows( LSBOOL _bVal ); 00142 00143 00144 protected : 00145 // == Members. 00149 CVector3 m_vDiffuse; 00150 00154 CVector3 m_vAmbient; 00155 00159 CVector3 m_vSpecular; 00160 00164 LSREAL m_fSize; 00165 00169 LSBOOL m_bActive; 00170 00174 LSBOOL m_bShadows; 00175 }; 00176 00177 00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00179 // DEFINITIONS 00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00181 // == Types. 00185 typedef CSharedPtr<CLightBase> CLightBasePtr; 00186 00187 00188 // == Functions. 00194 LSE_INLINE const CVector3 & LSE_CALL CLightBase::Diffuse() const { 00195 return m_vDiffuse; 00196 } 00197 00203 LSE_INLINE CVector3 & LSE_CALL CLightBase::Diffuse() { 00204 return m_vDiffuse; 00205 } 00206 00212 LSE_INLINE const CVector3 & LSE_CALL CLightBase::Ambient() const { 00213 return m_vAmbient; 00214 } 00215 00221 LSE_INLINE CVector3 & LSE_CALL CLightBase::Ambient() { 00222 return m_vAmbient; 00223 } 00224 00230 LSE_INLINE const CVector3 & LSE_CALL CLightBase::Specular() const { 00231 return m_vSpecular; 00232 } 00233 00239 LSE_INLINE CVector3 & LSE_CALL CLightBase::Specular() { 00240 return m_vSpecular; 00241 } 00242 00248 LSE_INLINE LSREAL LSE_CALL CLightBase::Size() const { 00249 return m_fSize; 00250 } 00251 00257 LSE_INLINE LSREAL & LSE_CALL CLightBase::Size() { 00258 return m_fSize; 00259 } 00260 00266 LSE_INLINE LSBOOL LSE_CALL CLightBase::Active() const { 00267 return m_bActive; 00268 } 00269 00275 LSE_INLINE LSVOID LSE_CALL CLightBase::SetActive( LSBOOL _bVal ) { 00276 m_bActive = _bVal; 00277 } 00278 00284 LSE_INLINE LSBOOL LSE_CALL CLightBase::CastsShadows() const { 00285 return m_bShadows; 00286 } 00287 00293 LSE_INLINE LSVOID LSE_CALL CLightBase::SetCastsShadows( LSBOOL _bVal ) { 00294 m_bShadows = _bVal; 00295 } 00296 00297 } // namespace lse 00298 00299 #endif // __LSE_LIGHTBASE_H__