Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

GXLinearEntityManager.h

Go to the documentation of this file.
00001 #ifndef __GXLINEARENTITY
00002 #define __GXLINEARENTITY
00003 
00004 #include "GXEntityManager.h"
00005 
00006 #include <vector>
00007 using namespace std;
00008 
00009 
00010 
00011 struct SGXLinearEntity
00012 {
00013         D3DXVECTOR3 vPos;
00014         float           fBoundingRadius;
00015         bool            bAssigned;
00016 };
00017 
00018 
00019 class CGXLinearEntityManager:public IGXEntityManager
00020 {
00021 public:
00022         CGXLinearEntityManager();
00023         virtual ~CGXLinearEntityManager();
00024 
00025         virtual int             AddEntity(const D3DXVECTOR3* pPos, 
00026                                                         const float fBoundingRadius);//returns -1 on error, otherwise returns ID of entity
00027         virtual bool    DeleteEntity(const int nID);
00028         virtual void    DeleteAllEntities();
00029         
00030         virtual bool    ChangeEntityBoundingRadius(const int nID, const float fNewRadius);
00031         virtual bool    GetEntityBoundingRadius(const int nID, float *pOut);
00032 
00033         virtual bool    ChangeEntityPosition(const int nID, const D3DXVECTOR3* pNewPos);
00034         virtual bool    GetEntityPosition(const int nID, D3DXVECTOR3* pOut);
00035 
00036 
00037 
00038         virtual bool    GetEntitiesInSphere(CGXAutoArray<int>* pOut, 
00039                                                                                 const D3DXVECTOR3* pCenter,
00040                                                                                 const float fRadius);
00041 
00042         virtual bool    SetCollisionManager(IGXCollsionManager* pCollider);
00043 
00044 protected:
00045         
00046         vector<SGXLinearEntity>         m_Entities;
00047         IGXCollsionManager*                     m_pCollider;
00048         UINT                                            m_nAddCalls;//number of times addentity has been called.  Every so ofter, ShrinkToSize is called 
00049         
00050         virtual SGXLinearEntity*        GetEntity(const int nID);
00051         virtual int                                     GetIDOfBlankEntity();//-1 for none
00052         virtual bool                            CheckCollision(const int nID);
00053         virtual void                            ShrinkToSize();
00054 
00055 
00056 
00057 
00058 };
00059 
00060 
00061 
00062 
00063 #endif

Generated on Thu May 23 17:51:00 2002 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001