"L. Spiro Engine"
|
00001 00016 #ifndef __LSE_DIRLIGHT_H__ 00017 #define __LSE_DIRLIGHT_H__ 00018 00019 #include "../LSEEngine.h" 00020 #include "../Entity/LSEActor.h" 00021 #include "BoundingBoxes/LSPCappedKDop.h" 00022 #include "Frustum/LSMFrustum.h" 00023 #include "LSELightBase.h" 00024 #include "Texture/LSGFloatTexture.h" 00025 00026 namespace lse { 00027 00034 class CDirLight : public CLightBase { 00035 public : 00036 // == Various constructors. 00037 LSE_CALLCTOR CDirLight(); 00038 00039 00040 // == Functions. 00046 virtual LSUINT32 LSE_CALL EntityType() const; 00047 00053 virtual LSE_LIGHT_TYPE LSE_CALL LightType() const; 00054 00060 LSE_INLINE LSBOOL LSE_CALL CastsShadows() const; 00061 00067 LSVOID LSE_CALL SetDir( const CVector3 &_vDir ); 00068 00074 const CVector3 & LSE_CALL GetDir() const; 00075 00082 LSVOID LSE_CALL MakeKDop( const CFrustum &_fFrustum, const CVector3 _vCorners[8] ); 00083 00089 const CCappedKDop<13UL> & LSE_CALL KDop() const; 00090 00096 LSE_INLINE const CMatrix4x4 & LSE_CALL ShadowProjMatrix() const; 00097 00103 LSE_INLINE CMatrix4x4 & LSE_CALL ShadowProjMatrix(); 00104 00110 LSE_INLINE const CMatrix4x4 & LSE_CALL ShadowViewMatrix() const; 00111 00117 LSE_INLINE CMatrix4x4 & LSE_CALL ShadowViewMatrix(); 00118 00119 protected : 00120 // == Members. 00124 CMatrix4x4 m_mProj; 00125 00129 mutable CMatrix4x4 m_mView; 00130 00134 mutable CVector3 m_vDir; 00135 00139 LSBOOL m_bCastsShadows; 00140 00144 CCappedKDop<13UL> m_ckdKDop; 00145 00146 00147 // == Functions. 00151 virtual LSVOID LSE_CALL WorldDidChange() const; 00152 00153 private : 00154 typedef CActor Parent; 00155 }; 00156 00157 00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00159 // DEFINITIONS 00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00161 // == Types. 00165 typedef CSharedPtr<CDirLight> CDirLightPtr; 00166 00167 00168 // == Functions. 00174 LSE_INLINE LSBOOL LSE_CALL CDirLight::CastsShadows() const { 00175 return m_bCastsShadows; 00176 } 00177 00183 LSE_INLINE const CMatrix4x4 & LSE_CALL CDirLight::ShadowProjMatrix() const { 00184 return m_mProj; 00185 } 00186 00192 LSE_INLINE CMatrix4x4 & LSE_CALL CDirLight::ShadowProjMatrix() { 00193 return m_mProj; 00194 } 00195 00201 LSE_INLINE const CMatrix4x4 & LSE_CALL CDirLight::ShadowViewMatrix() const { 00202 return m_mView; 00203 } 00204 00210 LSE_INLINE CMatrix4x4 & LSE_CALL CDirLight::ShadowViewMatrix() { 00211 return m_mView; 00212 } 00213 00214 } // namespace lse 00215 00216 #endif // __LSE_DIRLIGHT_H__