My Project
IEnvironmentSim.h
1 #pragma once
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 2004 - 2006 ParaEngine Dev Studio, All Rights Reserved.
4 // Date: 2006.10
5 // Description:
6 //-----------------------------------------------------------------------------
7 #include <list>
8 #include "ShapeSphere.h"
9 
10 namespace ParaEngine
11 {
12  using namespace std;
13 
14  class CBipedObject;
15  class CTerrainTile;
16  struct ActiveBiped;
17  class CBaseObject;
18  class CNetTime;
19  class CShapeSphere;
20 
23  {
30  };
31 
35  {
36  public:
37  CBaseObject* pA;
38  CBaseObject* pB;
39  CollisionPairType cptCollisionType;
40  public:
42  {
43  cptCollisionType = _A_runinto_B; // default type
44  }
45  };
46 
47 
48  //-----------------------------------------------------------------
49  // intermediate object definitions
50  //-----------------------------------------------------------------
52  {
53  CTerrainTile* pTile;
54  list <ActiveBiped*> listActiveBiped;
55  };
56 
57  //----------------------------------------------------------------
61  //----------------------------------------------------------------
62  struct ActiveBiped
63  {
65  {
67  float fDistance;
68  CBipedObject* pBiped;
69  PerceivedBiped(float fDist, CBipedObject* pB){
70  pBiped = pB;
71  fDistance = fDist;
72  };
73  PerceivedBiped(){pBiped=NULL;};
74  };
81  list <CBaseObject*> listCollisionPairs;
84  list <PerceivedBiped*> listPerceptibleBipeds;
85  public:
87  pBiped = b;
88  pTerrain = NULL;
89  }
90  ~ActiveBiped(){
91  list< PerceivedBiped* >::iterator itCurCP1, itEndCP1 = listPerceptibleBipeds.end();
92  for( itCurCP1 = listPerceptibleBipeds.begin(); itCurCP1 != itEndCP1; ++ itCurCP1)
93  {
94  delete *itCurCP1;
95  }
96  listPerceptibleBipeds.clear();
97  }
98  };
99 
104  {
105  public:
106  enum SIMULATOR_TYPE{
107  SIM_TYPE_STANDALONE = 0,
108  SIM_TYPE_SERVER = 1,
109  SIM_TYPE_CLIENT = 2,
110  };
114  virtual SIMULATOR_TYPE GetSimulatorType()=0;
115 
119  virtual void Animate( double dTimeDelta ) = 0;
120 
129  virtual void CheckLoadPhysics(CShapeSphere* points, int nPointCount = 1) = 0;
130  void CheckLoadPhysics(const Vector3& vCenter, float fRadius)
131  {
132  CShapeSphere point(vCenter, fRadius);
133  CheckLoadPhysics(&point, 1);
134  }
135 
137  virtual void Release() = 0;
138 
139  static void EnableLog(bool bWriteLog){m_bWriteLog = bWriteLog;};
140  static inline bool IsLogEnabled(){return m_bWriteLog;};
141 
146  virtual CNetTime* GetNetTime(){return NULL;};
147 
148  private:
149  static bool m_bWriteLog;
150  };
151 }
list< CBaseObject * > listCollisionPairs
object list that collide with this biped. It can be solid object or other bipeds. ...
Definition: IEnvironmentSim.h:81
a pair of object that collide into each other.
Definition: IEnvironmentSim.h:34
Current network simulation time.
Definition: GameNetCommon.h:17
Definition: IEnvironmentSim.h:51
Definition: combase.h:159
list< PerceivedBiped * > listPerceptibleBipeds
object list that this biped could see or perceive.
Definition: IEnvironmentSim.h:84
different physics engine has different winding order.
Definition: EventBinding.h:32
Object A run into object B, so A should reponse.
Definition: IEnvironmentSim.h:25
CBipedObject * pBiped
the biped scene object.
Definition: IEnvironmentSim.h:76
Object A,B run into each other, both or the faster one should reponse.
Definition: IEnvironmentSim.h:29
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
Definition: ShapeSphere.h:6
a tile in the latticed terrain class
Definition: TerrainTile.h:21
virtual CNetTime * GetNetTime()
get the net time object
Definition: IEnvironmentSim.h:146
Object B run into object A, so B should reponse.
Definition: IEnvironmentSim.h:27
Definition: IEnvironmentSim.h:64
CTerrainTile * pTerrain
tile that tells most exactly where the object is in the scene the terrain in which the biped is in ...
Definition: IEnvironmentSim.h:79
It holds any information that is perceived by a Active Biped object including himself.
Definition: IEnvironmentSim.h:62
Defines the base class of all scene elements:CBaseObject for Parallel World Engine.
Definition: BaseObject.h:230
float fDistance
the distance of the perceived biped to the host
Definition: IEnvironmentSim.h:67
CollisionPairType
Type of the collision.
Definition: IEnvironmentSim.h:22
It can be used to represent biped object(like human, re spawning monsters) in the scene without inher...
Definition: BipedObject.h:60
environment simulator.
Definition: IEnvironmentSim.h:103