Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2005, 11:55:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: renamed iphysics to physics_interface

File:
1 moved

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/physics/physics_interface.cc

    r4371 r4375  
    1313   ### File Specific:
    1414   main-programmer: Patrick Boenzli
    15    co-programmer: ...
     15   co-programmer: Benjamin Grauer
     16   
     17   bensch: renamed the file
    1618*/
    1719
    1820#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PHYSICS
    1921
    20 #include "i_physics.h"
     22#include "physics_interface.h"
    2123#include "list.h"
    2224#include "string.h"
     
    2931   \brief standard constructor
    3032*/
    31 IPhysics::IPhysics ()
     33PhysicsInterface::PhysicsInterface ()
    3234{
    33    this->setClassName ("IPhysics");
     35   this->setClassName ("PhysicsInterface");
    3436   this->mass = 0;
    3537   this->massChildren = 0;
     
    4244
    4345*/
    44 IPhysics::~IPhysics ()
     46PhysicsInterface::~PhysicsInterface ()
    4547{
    4648  // delete what has to be deleted here
    4749}
    4850
    49 void IPhysics::recalcMass()
     51void PhysicsInterface::recalcMass()
    5052{
    5153        float massSum = 0;
     
    5557        while( pn != NULL)
    5658    {
    57         // todo: find out if children are IPhysics in an efficient way
    58         if (strcmp( pn->getClassName(), "IPhysics")) {
    59                         massSum += ((IPhysics*)pn)->getTotalMass();
     59        // todo: find out if children are PhysicsInterface in an efficient way
     60        if (strcmp( pn->getClassName(), "PhysicsInterface")) {
     61                        massSum += ((PhysicsInterface*)pn)->getTotalMass();
    6062        }
    6163      pn = iterator->nextElement();
     
    6567        if (massSum != this->massChildren ) {
    6668                this->massChildren = massSum;
    67                 if (strcmp( parent->getClassName(), "IPhysics"))
    68                         ((IPhysics*)parent)->recalcMass();
     69                if (strcmp( parent->getClassName(), "PhysicsInterface"))
     70                        ((PhysicsInterface*)parent)->recalcMass();
    6971        } else {
    7072                this->massChildren = massSum;
     
    7375       
    7476       
    75 void IPhysics::addForce( Vector force )
     77void PhysicsInterface::addForce( Vector force )
    7678{
    7779        forceSum += force;
    7880}
    7981
    80 void IPhysics::addForce(Vector force, Vector grip)
     82void PhysicsInterface::addForce(Vector force, Vector grip)
    8183{
    8284        // add central force
     
    8688}
    8789       
    88 void IPhysics::tick( float dt )
     90void PhysicsInterface::tick( float dt )
    8991{
    9092        Vector acc = forceSum / ( massChildren + mass );
Note: See TracChangeset for help on using the changeset viewer.