Changeset 8108 in orxonox.OLD for branches/cr/src/lib
- Timestamp:
- Jun 1, 2006, 11:14:54 PM (19 years ago)
- Location:
- branches/cr/src/lib/collision_reaction
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision.cc
r7968 r8108 29 29 this->entityA = NULL; 30 30 this->entityB = NULL; 31 32 this->bDispatched = false; 33 this->entityACollide = false; 34 this->entityBCollide = false; 31 35 } 32 36 … … 46 50 { 47 51 48 52 this->bDispatched = true; 49 53 this->flushCollisionEvents(); 50 54 } … … 56 60 void Collision::flushCollisionEvents() 57 61 { 62 this->entityA = NULL; 63 this->entityB = NULL; 64 65 this->entityACollide = false; 66 this->entityBCollide = false; 67 58 68 this->collisionEvents.clear(); 59 69 } -
branches/cr/src/lib/collision_reaction/collision.h
r8106 r8108 31 31 inline WorldEntity* getEntityB() const { return this->entityB; } 32 32 /** @return true if Entity A collides */ 33 inline bool isEntityACollide() { return this->entityACollide; } 33 inline bool isEntityACollide() const { return this->entityACollide; } 34 /** sets the flag if it reacts @param flag true if it should react on entityA*/ 35 inline void setEntityACollide(bool flag) { this->entityACollide = flag; } 34 36 /** @return true if Entity B collides */ 35 inline bool isEntityBCollide() { return this->entityBCollide; } 37 inline bool isEntityBCollide() const { return this->entityBCollide; } 38 /** sets the flag if it reacts @param flag true if it should react on entityB*/ 39 inline void setEntityBCollide(bool flag) { this->entityACollide = flag; } 36 40 37 41 /** @returns true if this Collision has already been dispatched */ … … 39 43 40 44 /** registers a @param event CollisionEvent to take place */ 41 inline void registerCollisionEvent(CollisionEvent* event) { this->collisionEvents.push_back(event); }45 inline void registerCollisionEvent(CollisionEvent* event) { this->collisionEvents.push_back(event); this->bDispatched = false;} 42 46 /** @returns a vector of collision events */ 43 47 inline const std::vector<CollisionEvent*>& getCollisionEvents() const { return this->collisionEvents; } 44 45 48 46 49 -
branches/cr/src/lib/collision_reaction/collision_handle.cc
r8107 r8108 94 94 95 95 c->collide(entityA, entityB); 96 c->setEntityACollide(true); 96 97 this->collisionList.push_back(c); 97 98 98 99 // now register it as a shared collision with the other collision entity 99 100 CollisionHandle* ch = entityB->getCollisionHandle(this->type); 100 if( ch != NULL) 101 if( ch != NULL) { 101 102 ch->registerSharedCollision(c); 103 c->setEntityBCollide(true); 104 } 102 105 103 106 return c; -
branches/cr/src/lib/collision_reaction/cr_object_damage.cc
r8106 r8108 53 53 { 54 54 55 float mass; 56 float velocity; 57 58 55 // if(collision->) 59 56 60 57 // const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents());
Note: See TracChangeset
for help on using the changeset viewer.