Changeset 7940 in orxonox.OLD for branches/cr
- Timestamp:
- May 28, 2006, 11:05:21 PM (19 years ago)
- Location:
- branches/cr/src/lib/collision_reaction
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/Makefile.am
r7935 r7940 12 12 noinst_HEADERS = cr_engine.h \ 13 13 collision.h \ 14 collision_handle.h 14 collision_handle.h \ 15 cr_defs.h 15 16 -
branches/cr/src/lib/collision_reaction/collision.cc
r7935 r7940 14 14 */ 15 15 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_ DETECTION16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_REACTION 17 17 18 18 #include "collision.h" … … 20 20 using namespace std; 21 21 22 #define NULL 0 22 23 23 24 /** … … 26 27 Collision::Collision () 27 28 { 29 this->entityA = NULL; 30 this->entityB = NULL; 31 this->bvA = NULL; 32 this->bvB = NULL; 28 33 } 29 34 -
branches/cr/src/lib/collision_reaction/collision.h
r7935 r7940 17 17 18 18 public: 19 Collision();19 Collision(); 20 20 virtual ~Collision(); 21 21 22 /** collides two WorldEntities @param entityA world entity A, @param entityB world entity B, @param bvA volume A @param bvB volumeB */ 23 inline void collide(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) 24 { this->entityA = entityA; this->entityB = entityB; this->bvA = bvA; this->bvB = bvB; } 25 26 27 /** @return Collision WorldEntity A */ 28 inline const WorldEntity* getEntityA() const { return this->entityA; } 29 /** @return Collision WorldEntity B */ 30 inline const WorldEntity* getEntityB() const { return this->entityB; } 31 /** @return Bounding Volume from EntityA */ 32 inline const BoundingVolume* getBVA() const { return this->bvA; } 33 /** @return Bounding Volume from EntityB */ 34 inline const BoundingVolume* getBVB() const { return this->bvB; } 22 35 23 36 -
branches/cr/src/lib/collision_reaction/cr_engine.cc
r7937 r7940 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_REACTION 17 17 18 19 20 #include "collision.h" 21 #include "cr_defs.h" 22 18 23 #include "cr_engine.h" 19 24 … … 30 35 this->setName("CREngine"); 31 36 37 this->init(); 32 38 } 33 39 … … 45 51 } 46 52 53 54 void CREngine::init() 55 { 56 // create a list of Collision events (precaching) 57 Collision* collisions = new Collision[CR_MAX_COLLISIONS]; 58 for( int i = 0; i < CR_MAX_COLLISIONS; i++) 59 this->cachedCollisions.push_back(collisions[i]); 60 } 61 62 63 void CREngine::reset() 64 {} 47 65 48 66 … … 74 92 75 93 } 94 -
branches/cr/src/lib/collision_reaction/cr_engine.h
r7937 r7940 41 41 inline static CREngine* getInstance() { if (!singletonRef) singletonRef = new CREngine(); return singletonRef; }; 42 42 43 void init(); 44 void reset(); 45 46 43 47 CollisionHandle* subscribeReaction(WorldEntity* worldEntity, CRType type); 44 48
Note: See TracChangeset
for help on using the changeset viewer.