Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4377 in orxonox.OLD for orxonox/trunk/src/lib/physics


Ignore:
Timestamp:
May 29, 2005, 1:24:40 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: ParticleSystem is now a PhysicsInterface

Location:
orxonox/trunk/src/lib/physics
Files:
4 edited

Legend:

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

    r4375 r4377  
    2828
    2929
    30 PhysicsConnection::PhysicsConnection(ParticleSystem* particleSystem, Field* field)
     30PhysicsConnection::PhysicsConnection(PhysicsInterface* subject, Field* field)
    3131{
    32   this->type = PCON_ParticlesField;
    33   this->particleSystem = particleSystem;
     32  this->type = PCON_PhysIField;
     33  this->subject = subject;
    3434  this->field = field;
    3535
     
    5959      break;
    6060
    61     case PCON_ParticlesField:
    62       this->particleSystem->applyField(dt, this->field);
    63 
    64       break;
    65      
    6661    case PCON_PhysIPhysI:
    67 
     62      this->subject->applyField(this->field, dt);
    6863      break;
    6964    }
  • orxonox/trunk/src/lib/physics/physics_connection.h

    r4375 r4377  
    1414//! An enumerator for different ConnectionTypes
    1515typedef enum PCON_Type { PCON_PhysIPhysI = 0,
    16                          PCON_PhysIField = 1,
    17                          PCON_ParticlesField = 2 };
     16                         PCON_PhysIField = 1};
    1817
    1918
     
    2423
    2524 public:
     25  PhysicsConnection(PhysicsInterface* subject, Field* field);
    2626  PhysicsConnection(PhysicsInterface* partnerOne, PhysicsInterface* partnerTwo);
    27   PhysicsConnection(PhysicsInterface* subject, Field* field);
    28   PhysicsConnection(ParticleSystem* particleSystem, Field* field);
    2927
    3028  virtual ~PhysicsConnection();
     
    3836  PhysicsInterface* partner2;        //!< The second partner of this Connection.
    3937 
    40   ParticleSystem* particleSystem;    //!< A ParticleSystem in this Connection
    41  
    4238  Field* field;                      //!< The field to connect either subject of ParticleSystem to.
    4339};
  • orxonox/trunk/src/lib/physics/physics_interface.cc

    r4376 r4377  
    2222#include "physics_interface.h"
    2323
     24#include "field.h"
    2425#include "p_node.h"
    2526
     
    8485       
    8586       
    86 void PhysicsInterface::applyForce( Vector force )
     87void PhysicsInterface::applyField(Field* field, float dt)
    8788{
    88   this->forceSum += force;
     89  //  this->forceSum += force;
    8990}
    9091
  • orxonox/trunk/src/lib/physics/physics_interface.h

    r4376 r4377  
    88
    99#include "vector.h"
     10#include "base_object.h"
     11
     12// Forward Declaration
     13class Field;
    1014
    1115//! A Physics interface
     
    1317   here can be some longer description of this class
    1418*/
    15 class PhysicsInterface {
     19class PhysicsInterface : public BaseObject
     20{
    1621
    1722 public:
     
    2530  inline float getTotalMass( void ) const { return mass + massChildren; };
    2631
    27   virtual void applyForce( Vector force );                                      //!< Add a central force on this rigid body
    28   virtual void tickPhys( float dt );                                            //!< Update kinematics, reset force sum
     32  virtual void applyField(Field* field, float dt);
     33  virtual void tickPhys( float dt );
    2934
    3035 protected:
Note: See TracChangeset for help on using the changeset viewer.