- Timestamp:
- Jun 3, 2006, 3:37:01 PM (19 years ago)
- Location:
- branches/cr/src/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/collision.cc
r8124 r8129 45 45 46 46 /** 47 * handles the collision events48 */49 void Collision::handleCollisionEvents()50 {51 52 this->bDispatched = true;53 this->flushCollisionEvents();54 }55 56 57 /**58 47 * flushes the CollisionEvent list 59 48 */ … … 66 55 this->entityBCollide = false; 67 56 68 this->bDispatched = false;57 this->bDispatched = true; 69 58 70 59 this->collisionEvents.clear(); -
branches/cr/src/lib/collision_reaction/collision.h
r8124 r8129 45 45 /** @returns true if this Collision has already been dispatched */ 46 46 inline bool isDispatched() { return this->bDispatched; } 47 /** sets the dispatched flag to true */ 48 inline void dispatched() { this->bDispatched = true; } 47 49 48 50 /** registers a @param event CollisionEvent to take place */ … … 52 54 53 55 54 void handleCollisionEvents();55 56 57 private:58 56 void flushCollisionEvents(); 59 57 -
branches/cr/src/lib/collision_reaction/collision_handle.cc
r8126 r8129 21 21 #include "collision.h" 22 22 #include "collision_event.h" 23 #include "collision_reaction.h" 24 25 #include "cr_object_damage.h" 23 26 24 27 using namespace std; … … 37 40 38 41 this->bCollided = false; 39 this->bContinuousPoll = false;40 42 this->bDispatched = false; 41 this->bStopOnFirstCollision = false; 43 44 if( this->type == CREngine::CR_PHYSICS_STEP_BACK) 45 this->bContinuousPoll = false; 46 else 47 this->bContinuousPoll = true; 48 49 if( this->type == CREngine::CR_OBJECT_DAMAGE) 50 this->bStopOnFirstCollision = true; 51 else 52 this->bStopOnFirstCollision = false; 53 54 switch( type) 55 { 56 case CREngine::CR_OBJECT_DAMAGE: 57 this->collisionReaction = new CRObjectDamage(); 58 break; 59 default: 60 break; 61 }; 42 62 } 43 63 … … 166 186 vector<Collision*>::iterator it = this->collisionList.begin(); 167 187 for(; it < this->collisionList.end(); it++) { 168 (*it)->handleCollisionEvents();188 this->collisionReaction->reactToCollision(*it); 169 189 } 170 190 -
branches/cr/src/lib/collision_reaction/collision_handle.h
r8125 r8129 16 16 class Collision; 17 17 class WorldEntity; 18 class CollisionReaction; 18 19 19 20 … … 63 64 std::vector<long> targetList; //!< a list of target classes for filtering 64 65 66 CollisionReaction* collisionReaction; //!< reference to the collision reaction object 67 65 68 }; 66 69 -
branches/cr/src/lib/collision_reaction/cr_object_damage.cc
r8111 r8129 54 54 float damage; 55 55 56 PRINTF(0)("dealing damage\n"); 56 PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n", 57 collision->getEntityA()->getClassName(), 58 collision->getEntityB()->getClassName()); 57 59 58 60 // the collision damage been dealed by the entity … … 66 68 } 67 69 70 collision->flushCollisionEvents(); 71 collision->dispatched(); 72 68 73 // const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents()); 69 74 // std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin(); -
branches/cr/src/lib/graphics/effects/atmospheric_engine.cc
r7836 r8129 127 127 for (it = weatherEffects->begin(); it != weatherEffects->end(); it++) 128 128 { 129 printf("%s::%s \n", (*it)->getClassName(), (*it)->getName()); 129 /* printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());*/ 130 130 dynamic_cast<WeatherEffect*>(*it)->tick(dt); 131 131 }
Note: See TracChangeset
for help on using the changeset viewer.