Changeset 8124 in orxonox.OLD for branches/cr/src/lib/collision_reaction
- Timestamp:
- Jun 3, 2006, 2:36:03 PM (18 years ago)
- Location:
- branches/cr/src/lib/collision_reaction
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision.cc
r8108 r8124 66 66 this->entityBCollide = false; 67 67 68 this->bDispatched = false; 69 68 70 this->collisionEvents.clear(); 69 71 } -
branches/cr/src/lib/collision_reaction/collision.h
r8108 r8124 2 2 * @file collision.h 3 3 * Definition of a collision as a two WE hit each other 4 * 5 * A is shared between two WorldEntity's CollisionHandles if both are subscribed to this event. In this case only one 6 * of the two CollisionHandles will calculate the CollisionReaction and the bDispatched flag will be set afterwards 7 * to signal that it's already cared about and should be ignored. 4 8 */ 5 9 -
branches/cr/src/lib/collision_reaction/collision_handle.cc
r8110 r8124 80 80 /** 81 81 * registers a new Collision Object 82 * @param entityA WorldEntity A of the collision 83 * @param entityB WorldEntity B of the collision 82 84 * if a there is already a collision object with the same stats 83 85 * registration will be skipped and the last collision object is returned … … 97 99 // now register it as a shared collision with the other collision entity 98 100 CollisionHandle* ch = entityB->getCollisionHandle(this->type); 99 if( ch != NULL) {101 if( ch != NULL) 100 102 ch->registerSharedCollision(c); 101 c->setEntityBCollide(true);102 }103 103 104 104 return c; … … 134 134 this->bDispatched = false; 135 135 136 // first element only136 // checks if these WorldEntities have already collided or if its a new collision -> create a new Collision object 137 137 Collision* c = this->registerCollision(collisionEvent->getEntityA(), collisionEvent->getEntityB()); 138 138 c->setEntityACollide(true); … … 178 178 vector<long>::iterator it = this->targetList.begin(); 179 179 for(; it < this->targetList.end(); it++) 180 { 181 if( !collisionEvent->getEntityA()->isA((ClassID)(*it))) 182 return false; 183 } 180 if( collisionEvent->getEntityA()->isA((ClassID)(*it))) 181 return true; 184 182 185 return true;183 return false; 186 184 } 187 185
Note: See TracChangeset
for help on using the changeset viewer.