Changeset 9406 in orxonox.OLD for trunk/src/lib/collision_reaction
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (18 years ago)
- Location:
- trunk/src/lib/collision_reaction
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_reaction/collision.cc
r8190 r9406 19 19 #include "debug.h" 20 20 21 using namespace std; 21 22 22 23 23 -
trunk/src/lib/collision_reaction/collision_event.cc
r8190 r9406 19 19 #include "debug.h" 20 20 21 using namespace std; 21 22 22 23 23 -
trunk/src/lib/collision_reaction/collision_handle.cc
r9235 r9406 29 29 #include "debug.h" 30 30 31 using namespace std; 31 32 32 33 33 … … 178 178 179 179 c->registerCollisionEvent(collisionEvent); 180 PRINTF(5)("Registering Collision Event: %s, %s\n", collisionEvent->getEntityA()->getClass Name(), collisionEvent->getEntityB()->getClassName());180 PRINTF(5)("Registering Collision Event: %s, %s\n", collisionEvent->getEntityA()->getClassCName(), collisionEvent->getEntityB()->getClassCName()); 181 181 } 182 182 … … 204 204 205 205 // collision reaction calculations (for every collision there will be a reaction) 206 vector<Collision*>::iterator it = this->collisionList.begin();206 std::vector<Collision*>::iterator it = this->collisionList.begin(); 207 207 for(; it < this->collisionList.end(); it++) { 208 208 if( !(*it)->isDispatched()) … … 227 227 bool CollisionHandle::filterCollisionEvent(CollisionEvent* collisionEvent) 228 228 { 229 vector<long>::iterator it = this->targetList.begin();229 std::vector<long>::iterator it = this->targetList.begin(); 230 230 for(; it < this->targetList.end(); it++) 231 231 { 232 232 // if(collisionEvent->getEntityB()->isA(CL_AIMING_SYSTEM) || collisionEvent->getEntityA()->isA(CL_AIMING_SYSTEM)) 233 233 // { 234 // PRINTF(0)("I am: %s colliding with: %s\n", owner->getClass Name(), collisionEvent->getEntityB()->getClassName(), *it);234 // PRINTF(0)("I am: %s colliding with: %s\n", owner->getClassCName(), collisionEvent->getEntityB()->getClassCName(), *it); 235 235 // if( collisionEvent->getEntityA() == this->owner) { 236 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClass Name(),237 // collisionEvent->getEntityB()->getClass Name(), *it);236 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassCName(), 237 // collisionEvent->getEntityB()->getClassCName(), *it); 238 238 // if( collisionEvent->getEntityB()->isA((ClassID)(*it))) { 239 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClass Name(),240 // collisionEvent->getEntityB()->getClass Name(), *it);239 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(), 240 // collisionEvent->getEntityB()->getClassCName(), *it); 241 241 // } 242 242 // } 243 243 // else { 244 // PRINTF(0)("I am not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClass Name(),245 // collisionEvent->getEntityB()->getClass Name(), *it);244 // PRINTF(0)("I am not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassCName(), 245 // collisionEvent->getEntityB()->getClassCName(), *it); 246 246 // if( collisionEvent->getEntityA()->isA((ClassID)(*it))) { 247 // PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClass Name(),248 // collisionEvent->getEntityA()->getClass Name(), *it);247 // PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(), 248 // collisionEvent->getEntityA()->getClassCName(), *it); 249 249 // } 250 250 // } … … 254 254 if( collisionEvent->getEntityA() == this->owner) { 255 255 if( collisionEvent->getEntityB()->isA((ClassID)(*it))) { 256 PRINTF(5)("I am: %s colliding with: %s is a %i filter ok\n", owner->getClass Name(),257 collisionEvent->getEntityB()->getClass Name(), *it);256 PRINTF(5)("I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(), 257 collisionEvent->getEntityB()->getClassCName(), *it); 258 258 return true; } 259 259 } 260 260 else { 261 261 if( collisionEvent->getEntityA()->isA((ClassID)(*it))) { 262 PRINTF(5)("I am: %s colliding with: %s is a %i filter ok\n", owner->getClass Name(),263 collisionEvent->getEntityA()->getClass Name(), *it);262 PRINTF(5)("I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(), 263 collisionEvent->getEntityA()->getClassCName(), *it); 264 264 return true; } 265 265 } … … 276 276 bool CollisionHandle::filterCollision(Collision* collision) 277 277 { 278 vector<long>::iterator it = this->targetList.begin();278 std::vector<long>::iterator it = this->targetList.begin(); 279 279 for(; it < this->targetList.end(); it++) 280 280 { … … 282 282 // if(collision->getEntityB()->isA(CL_AIMING_SYSTEM) || collision->getEntityA()->isA(CL_AIMING_SYSTEM)) 283 283 // { 284 // PRINTF(0)("Shared!!! I am: %s colliding with: %s\n", owner->getClass Name(), collision->getEntityB()->getClassName(), *it);284 // PRINTF(0)("Shared!!! I am: %s colliding with: %s\n", owner->getClassCName(), collision->getEntityB()->getClassCName(), *it); 285 285 // if( collision->getEntityA() == this->owner) { 286 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClass Name(),287 // collision->getEntityB()->getClass Name(), *it);286 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassCName(), 287 // collision->getEntityB()->getClassCName(), *it); 288 288 // if( collision->getEntityB()->isA((ClassID)(*it))) { 289 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClass Name(),290 // collision->getEntityB()->getClass Name(), *it);289 // PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(), 290 // collision->getEntityB()->getClassCName(), *it); 291 291 // } 292 292 // } 293 293 // else { 294 // PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClass Name(),295 // collision->getEntityB()->getClass Name(), *it);294 // PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassCName(), 295 // collision->getEntityB()->getClassCName(), *it); 296 296 // if( collision->getEntityA()->isA((ClassID)(*it))) { 297 // PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClass Name(),298 // collision->getEntityA()->getClass Name(), *it);297 // PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassCName(), 298 // collision->getEntityA()->getClassCName(), *it); 299 299 // } 300 300 // } -
trunk/src/lib/collision_reaction/collision_reaction.cc
r8190 r9406 19 19 20 20 21 using namespace std; 21 22 22 23 23 -
trunk/src/lib/collision_reaction/cr_engine.cc
r8490 r9406 27 27 #include "debug.h" 28 28 29 using namespace std; 29 30 30 31 31 … … 61 61 this->reset(); 62 62 63 vector<Collision*>::iterator it1 = this->collisionsUnused.begin();63 std::vector<Collision*>::iterator it1 = this->collisionsUnused.begin(); 64 64 for(; it1 < this->collisionsUnused.end(); it1++) 65 65 delete *it1; 66 vector<CollisionEvent*>::iterator it2 = this->collisionEventsUnused.begin();66 std::vector<CollisionEvent*>::iterator it2 = this->collisionEventsUnused.begin(); 67 67 for(; it2 < this->collisionEventsUnused.end(); it2++) 68 68 delete *it2; … … 92 92 // first clear all CollisionHandles 93 93 94 vector<CollisionHandle*>::iterator it = this->collisionHandles.begin();94 std::vector<CollisionHandle*>::iterator it = this->collisionHandles.begin(); 95 95 for(; it < this->collisionHandles.end(); it++) 96 96 { … … 159 159 void CREngine::flushCollisions() 160 160 { 161 vector<Collision*>::iterator it1 = this->collisionsUsed.begin();161 std::vector<Collision*>::iterator it1 = this->collisionsUsed.begin(); 162 162 for(; it1 < this->collisionsUsed.end(); it1++) 163 163 this->collisionsUnused.push_back(*it1); 164 164 165 vector<CollisionEvent*>::iterator it2 = this->collisionEventsUsed.begin();165 std::vector<CollisionEvent*>::iterator it2 = this->collisionEventsUsed.begin(); 166 166 for(; it2 < this->collisionEventsUsed.end(); it2++) 167 167 this->collisionEventsUnused.push_back(*it2); -
trunk/src/lib/collision_reaction/cr_object_damage.cc
r9235 r9406 26 26 #include "debug.h" 27 27 28 using namespace std; 28 29 29 30 30 … … 57 57 58 58 PRINTF(4)("Dealing damage - Handling collision: %s vs %s\n", 59 collision->getEntityA()->getClass Name(),60 collision->getEntityB()->getClass Name());59 collision->getEntityA()->getClassCName(), 60 collision->getEntityB()->getClassCName()); 61 61 62 62 // the collision damage been dealed by the entity … … 64 64 damage = collision->getEntityB()->getDamage(); 65 65 collision->getEntityA()->hit(damage, collision->getEntityB()); 66 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClass Name());66 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassCName()); 67 67 } 68 68 … … 70 70 damage = collision->getEntityA()->getDamage(); 71 71 collision->getEntityB()->hit(damage, collision->getEntityA()); 72 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClass Name());72 PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassCName()); 73 73 } 74 74 -
trunk/src/lib/collision_reaction/cr_physics_full_walk.cc
r9235 r9406 33 33 #include "cr_defs.h" 34 34 35 using namespace std; 35 36 36 37 37 -
trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc
r9235 r9406 33 33 #include "cr_defs.h" 34 34 35 using namespace std; 35 36 36 37 37
Note: See TracChangeset
for help on using the changeset viewer.