Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4375 in orxonox.OLD for orxonox/trunk


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

orxonox/trunk: renamed iphysics to physics_interface

Location:
orxonox/trunk/src/lib/physics
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/physics/Makefile.am

    r4338 r4375  
    3232noinst_LIBRARIES = libORXphysics.a
    3333
    34 libORXphysics_a_SOURCES = i_physics.cc \
     34libORXphysics_a_SOURCES = physics_interface.cc \
    3535                          physics_connection.cc \
    3636                          physics_engine.cc \
     
    4040                          fields/twirl.cc
    4141
    42 noinst_HEADERS= i_physics.h \
     42noinst_HEADERS= physics_interface.h \
    4343                physics_connection.h \
    4444                physics_engine.h \
  • orxonox/trunk/src/lib/physics/Makefile.in

    r4338 r4375  
    5454libORXphysics_a_AR = $(AR) $(ARFLAGS)
    5555libORXphysics_a_LIBADD =
    56 am_libORXphysics_a_OBJECTS = i_physics.$(OBJEXT) \
     56am_libORXphysics_a_OBJECTS = physics_interface.$(OBJEXT) \
    5757        physics_connection.$(OBJEXT) physics_engine.$(OBJEXT) \
    5858        field.$(OBJEXT) gravity.$(OBJEXT) point_gravity.$(OBJEXT) \
     
    6363am__depfiles_maybe = depfiles
    6464@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/field.Po ./$(DEPDIR)/gravity.Po \
    65 @AMDEP_TRUE@    ./$(DEPDIR)/i_physics.Po \
    6665@AMDEP_TRUE@    ./$(DEPDIR)/physics_connection.Po \
    6766@AMDEP_TRUE@    ./$(DEPDIR)/physics_engine.Po \
     67@AMDEP_TRUE@    ./$(DEPDIR)/physics_interface.Po \
    6868@AMDEP_TRUE@    ./$(DEPDIR)/point_gravity.Po ./$(DEPDIR)/twirl.Po
    6969CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     
    189189AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/lib/physics -I$(MAINSRCDIR)/lib/physics/fields -I$(MAINSRCDIR)/lib/tinyxml -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/util/loading -I$(MAINSRCDIR)/util/track -I$(MAINSRCDIR)/subprojects
    190190noinst_LIBRARIES = libORXphysics.a
    191 libORXphysics_a_SOURCES = i_physics.cc \
     191libORXphysics_a_SOURCES = physics_interface.cc \
    192192                          physics_connection.cc \
    193193                          physics_engine.cc \
     
    197197                          fields/twirl.cc
    198198
    199 noinst_HEADERS = i_physics.h \
     199noinst_HEADERS = physics_interface.h \
    200200                physics_connection.h \
    201201                physics_engine.h \
     
    254254@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/field.Po@am__quote@
    255255@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gravity.Po@am__quote@
    256 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_physics.Po@am__quote@
    257256@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_connection.Po@am__quote@
    258257@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_engine.Po@am__quote@
     258@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_interface.Po@am__quote@
    259259@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/point_gravity.Po@am__quote@
    260260@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twirl.Po@am__quote@
  • orxonox/trunk/src/lib/physics/physics_connection.cc

    r4338 r4375  
    1919
    2020#include "physics_engine.h"
     21
     22#include "field.h"
     23#include "particle_system.h"
     24#include "physics_interface.h"
    2125
    2226using namespace std;
     
    5155  switch(this->type)
    5256    {
    53     case PCON_IPhysField:
     57    case PCON_PhysIField:
    5458     
    5559      break;
     
    6064      break;
    6165     
    62     case PCON_IPhysIPhys:
     66    case PCON_PhysIPhysI:
    6367
    6468      break;
  • orxonox/trunk/src/lib/physics/physics_connection.h

    r4338 r4375  
    77#define _PHYSICS_CONNECTION_H
    88
    9 #include "field.h"
    10 #include "particle_system.h"
    11 #include "i_physics.h"
     9// Forward Declaration
     10class PhysicsInterface;
     11class ParticleSystem;
     12class Field;
    1213
    1314//! An enumerator for different ConnectionTypes
    14 typedef enum PCON_Type { PCON_IPhysIPhys = 0,
    15                          PCON_IPhysField = 1,
     15typedef enum PCON_Type { PCON_PhysIPhysI = 0,
     16                         PCON_PhysIField = 1,
    1617                         PCON_ParticlesField = 2 };
    1718
     
    2324
    2425 public:
    25   PhysicsConnection(IPhysics* partnerOne, IPhysics* partnerTwo);
    26   PhysicsConnection(IPhysics* subject, Field* field);
     26  PhysicsConnection(PhysicsInterface* partnerOne, PhysicsInterface* partnerTwo);
     27  PhysicsConnection(PhysicsInterface* subject, Field* field);
    2728  PhysicsConnection(ParticleSystem* particleSystem, Field* field);
    2829
     
    3435  PCON_Type type;                    //!< What kind of connection this is.
    3536 
    36   IPhysics* subject;                 //!< The main Subject of this Connection.
    37   IPhysics* partner2;                //!< The second partner of this Connection.
     37  PhysicsInterface* subject;         //!< The main Subject of this Connection.
     38  PhysicsInterface* partner2;        //!< The second partner of this Connection.
    3839 
    3940  ParticleSystem* particleSystem;    //!< A ParticleSystem in this Connection
  • orxonox/trunk/src/lib/physics/physics_engine.h

    r4338 r4375  
    1010#include "base_object.h"
    1111#include "physics_connection.h"
    12 #include "fields.h"
    1312
    1413// Forward Declaration
     
    2524  void addConnection(PhysicsConnection* connection);
    2625  void removeConnection(PhysicsConnection* connection);
     26 
     27
    2728
    2829  void tick(float dt);
  • 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 );
  • orxonox/trunk/src/lib/physics/physics_interface.h

    r4371 r4375  
    11/*!
    2     \file i_physics.h
     2    \file physics_interface.h
    33    \brief a physics interface simulating a body with a mass
    44*/
    55
    6 #ifndef _I_PHYSICS_H
    7 #define _I_PHYSICS_H
     6#ifndef _PHYSICS_INTERFACE_H
     7#define _PHYSICS_INTERFACE_H
    88
    99#include "p_node.h"
     
    1313   here can be some longer description of this class
    1414*/
    15 class IPhysics : public PNode {
     15class PhysicsInterface : public PNode {
    1616
    1717 public:
    18   IPhysics();
    19   virtual ~IPhysics();
     18  PhysicsInterface();
     19  virtual ~PhysicsInterface();
    2020 
    2121  inline void setMass( float mass ) { this->mass = mass; };                                     //!< Set the mass of this node
     
    3838};
    3939
    40 #endif /* _I_PHYSICS_H */
     40#endif /* _PHYSICS_INTERFACE_H */
Note: See TracChangeset for help on using the changeset viewer.