Changeset 8049 in orxonox.OLD for branches/cr/src
- Timestamp:
- May 31, 2006, 11:12:06 PM (18 years ago)
- Location:
- branches/cr/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cr/src/lib/collision_reaction/cr_object_damage.cc
r8047 r8049 17 17 18 18 #include "collision.h" 19 20 #include "cr_object_damage.h" 19 #include "collision_event.h" 21 20 22 21 #include "physics_interface.h" 22 23 #include "world_entity.h" 24 #include "cr_object_damage.h" 23 25 24 26 using namespace std; … … 54 56 float velocity; 55 57 58 PhysicsInterface* pi; 59 56 60 const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents()); 57 61 std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin(); 58 62 for(; it != collisionEvents->end(); it++) 59 63 { 64 pi = &(*it)->getEntityA()->getPhysicsInterface(); 60 65 // go through the collisions and try to estimate the damage 61 mass = (*it)->getEntityA()->getPhysicsInterface()->getMass();66 mass = pi->getMass(); 62 67 } 63 68 -
branches/cr/src/world_entities/world_entity.h
r8047 r8049 117 117 //FIXME: the PhysicsInterface and the whole PEngine should probably be reviewed. Here its just used to store the vars 118 118 /* --- Physics Interface --- */ 119 inline PhysicsInterface getPhysicsEngine() const { return this->physicsInterface; } 119 inline PhysicsInterface getPhysicsInterface() const { return this->physicsInterface; } 120 inline float getMass() const { return this->physicsInterface.getMass(); } 121 inline float getTotalMass() const { return this->physicsInterface.getTotalMass(); } 120 122 121 123
Note: See TracChangeset
for help on using the changeset viewer.