Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8049 in orxonox.OLD for branches/cr/src


Ignore:
Timestamp:
May 31, 2006, 11:12:06 PM (18 years ago)
Author:
patrick
Message:

cr: physics interface used as real interface.

Location:
branches/cr/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cr/src/lib/collision_reaction/cr_object_damage.cc

    r8047 r8049  
    1717
    1818#include "collision.h"
    19 
    20 #include "cr_object_damage.h"
     19#include "collision_event.h"
    2120
    2221#include "physics_interface.h"
     22
     23#include "world_entity.h"
     24#include "cr_object_damage.h"
    2325
    2426using namespace std;
     
    5456  float velocity;
    5557
     58  PhysicsInterface* pi;
     59
    5660  const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents());
    5761  std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin();
    5862  for(; it != collisionEvents->end(); it++)
    5963  {
     64    pi = &(*it)->getEntityA()->getPhysicsInterface();
    6065    // go through the collisions and try to estimate the damage
    61     mass = (*it)->getEntityA()->getPhysicsInterface()->getMass();
     66    mass = pi->getMass();
    6267  }
    6368
  • branches/cr/src/world_entities/world_entity.h

    r8047 r8049  
    117117  //FIXME: the PhysicsInterface and the whole PEngine should probably be reviewed. Here its just used to store the vars
    118118  /* --- 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(); }
    120122
    121123
Note: See TracChangeset for help on using the changeset viewer.