"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSEngine/Src/Models/LSEMeshInstance.h

00001 
00019 #ifndef __LSE_MESHINSTANCE_H__
00020 #define __LSE_MESHINSTANCE_H__
00021 
00022 #include "../LSEEngine.h"
00023 #include "../Entity/LSEActor.h"
00024 #include "Models/LSDIntermediateMeshInstance.h"
00025 
00026 namespace lse {
00027 
00037         class CMeshInstance : public CActor {
00038         public :
00039                 // == Various constructors.
00040                 LSE_CALLCTOR                                                    CMeshInstance();
00041                 virtual LSE_CALLCTOR                                    ~CMeshInstance();
00042 
00043 
00044                 // == Functions.
00050                 virtual LSUINT32 LSE_CALL                               EntityType() const;
00051 
00055                 virtual LSVOID LSE_CALL                                 Reset();
00056 
00062                 LSE_INLINE const CAabb & LSE_CALL               Aabb() const;
00063 
00069                 LSE_INLINE const CSphere & LSE_CALL             BoundingSphere() const;
00070 
00077                 LSE_INLINE const CString * LSE_CALL             GetName() const;
00078 
00079 
00080         protected :
00081                 // == Members.
00085                 CIntermediateMeshInstance *                             m_pimiSharedMesh;
00086 
00090                 mutable CAabb                                                   m_aAabb;
00091 
00095                 mutable CSphere                                                 m_sBoundingSphere;
00096 
00097 
00098                 // == Functions.
00105                 virtual LSBOOL LSE_CALL                                 SetMesh( CIntermediateMeshInstance * _pimiSharedMesh );
00106 
00110                 virtual LSVOID LSE_CALL                                 WorldDidChange() const;
00111 
00112         private :
00113                 typedef CActor                                                  Parent;
00114                 friend class                                                    CModelInstance;
00115         };
00116 
00117 
00118         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00119         // DEFINITIONS
00120         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00121         // == Functions.
00127         LSE_INLINE const CAabb & LSE_CALL CMeshInstance::Aabb() const {
00128                 UndirtyWorld();
00129                 return m_aAabb;
00130         }
00131 
00137         LSE_INLINE const CSphere & LSE_CALL CMeshInstance::BoundingSphere() const {
00138                 UndirtyWorld();
00139                 return m_sBoundingSphere;
00140         }
00141 
00148         LSE_INLINE const CString * LSE_CALL CMeshInstance::GetName() const {
00149                 return m_pimiSharedMesh ? &m_pimiSharedMesh->GetName() : NULL;
00150         }
00151 
00152 }       // namespace lse
00153 
00154 #endif  // __LSE_MESHINSTANCE_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator