CScene.h
00001 00008 #ifndef __CSCENE_H__ 00009 #define __CSCENE_H__ 00010 00011 #include "CCamera.h" 00012 #include "CObject.h" 00013 #include "CNode.h" 00014 #include "assert.h" 00015 #include <vector> 00016 00017 using namespace std; 00018 00019 class CScene 00020 { 00021 private: 00022 int m_NumNodes; 00023 vector<CNode*> m_Nodes; 00024 vector<CCamera*> m_Cameras; 00025 CCamera *m_ActiveCamera; 00026 00027 public: 00028 // constructeurs et destructeurs 00029 CScene() : m_NumNodes(0), m_ActiveCamera(NULL) {} 00030 virtual ~CScene() 00031 { } 00032 00033 // get 00034 __forceinline int GetNumNodes() const { return m_NumNodes; } 00035 __forceinline CNode* GetNode(const unsigned int i) const { assert(i<m_Nodes.size()); return m_Nodes[i]; } 00036 __forceinline CCamera* GetActiveCamera() const { return m_ActiveCamera; } 00037 00038 // set 00039 __forceinline void SetActiveCamera(const unsigned int i) { assert(i<m_Cameras.size()); m_ActiveCamera = m_Cameras[i]; } 00040 __forceinline void SetActiveCamera(CCamera* cam) { assert(cam); m_ActiveCamera = cam; } 00041 00042 // methodes 00043 __forceinline bool AddObject(CObject* object) { assert( object ); AddNode(object); return true; } 00044 __forceinline bool AddCamera(CCamera* camera) { assert( camera ); m_Cameras.push_back(camera); AddNode(camera); SetActiveCamera(camera); return true; } 00045 __forceinline bool AddNode(CNode* node) { assert( node ); m_Nodes.push_back(node); m_NumNodes++; return true; } 00046 }; 00047 00048 #endif /* #ifndef __CSCENE_H__ */
Generated on Thu Apr 4 23:14:17 2002 by 1.2.15