Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4181 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 14, 2005, 12:28:44 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: simple definition of a PhisicsConnection

Location:
orxonox/branches/physics/src
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/Makefile.am

    r4180 r4181  
    9090                 util/physics/physical_interaction_sym.cc \
    9191                 util/physics/physical_interaction_asym.cc \
     92                 util/physics/physics_connection.cc \
    9293                 util/physics/fields/field.cc \
    9394                 util/physics/fields/gravity.cc \
     
    163164                 util/physics/physical_interaction_sym.h \
    164165                 util/physics/physical_interaction_asym.h \
     166                 util/physics/physics_connection.h \
    165167                 util/physics/fields/field.h \
    166168                 util/physics/fields/gravity.h \
  • orxonox/branches/physics/src/Makefile.in

    r4180 r4181  
    9191        physical_interaction.$(OBJEXT) \
    9292        physical_interaction_sym.$(OBJEXT) \
    93         physical_interaction_asym.$(OBJEXT) field.$(OBJEXT) \
    94         gravity.$(OBJEXT) vector.$(OBJEXT) curve.$(OBJEXT) \
    95         glmenu_imagescreen.$(OBJEXT) tinyxml.$(OBJEXT) \
    96         tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
     93        physical_interaction_asym.$(OBJEXT) \
     94        physics_connection.$(OBJEXT) field.$(OBJEXT) gravity.$(OBJEXT) \
     95        vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
     96        tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
    9797        tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT)
    9898orxonox_OBJECTS = $(am_orxonox_OBJECTS)
     
    140140@AMDEP_TRUE@    ./$(DEPDIR)/physical_interaction_asym.Po \
    141141@AMDEP_TRUE@    ./$(DEPDIR)/physical_interaction_sym.Po \
     142@AMDEP_TRUE@    ./$(DEPDIR)/physics_connection.Po \
    142143@AMDEP_TRUE@    ./$(DEPDIR)/physics_engine.Po \
    143144@AMDEP_TRUE@    ./$(DEPDIR)/player.Po \
     
    342343                 util/physics/physical_interaction_sym.cc \
    343344                 util/physics/physical_interaction_asym.cc \
     345                 util/physics/physics_connection.cc \
    344346                 util/physics/fields/field.cc \
    345347                 util/physics/fields/gravity.cc \
     
    415417                 util/physics/physical_interaction_sym.h \
    416418                 util/physics/physical_interaction_asym.h \
     419                 util/physics/physics_connection.h \
    417420                 util/physics/fields/field.h \
    418421                 util/physics/fields/gravity.h \
     
    581584@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physical_interaction_asym.Po@am__quote@
    582585@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physical_interaction_sym.Po@am__quote@
     586@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_connection.Po@am__quote@
    583587@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/physics_engine.Po@am__quote@
    584588@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
     
    15171521@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    15181522@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o physical_interaction_asym.obj `if test -f 'util/physics/physical_interaction_asym.cc'; then $(CYGPATH_W) 'util/physics/physical_interaction_asym.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/physical_interaction_asym.cc'; fi`
     1523
     1524physics_connection.o: util/physics/physics_connection.cc
     1525@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT physics_connection.o -MD -MP -MF "$(DEPDIR)/physics_connection.Tpo" -c -o physics_connection.o `test -f 'util/physics/physics_connection.cc' || echo '$(srcdir)/'`util/physics/physics_connection.cc; \
     1526@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/physics_connection.Tpo" "$(DEPDIR)/physics_connection.Po"; else rm -f "$(DEPDIR)/physics_connection.Tpo"; exit 1; fi
     1527@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/physics_connection.cc' object='physics_connection.o' libtool=no @AMDEPBACKSLASH@
     1528@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/physics_connection.Po' tmpdepfile='$(DEPDIR)/physics_connection.TPo' @AMDEPBACKSLASH@
     1529@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1530@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o physics_connection.o `test -f 'util/physics/physics_connection.cc' || echo '$(srcdir)/'`util/physics/physics_connection.cc
     1531
     1532physics_connection.obj: util/physics/physics_connection.cc
     1533@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT physics_connection.obj -MD -MP -MF "$(DEPDIR)/physics_connection.Tpo" -c -o physics_connection.obj `if test -f 'util/physics/physics_connection.cc'; then $(CYGPATH_W) 'util/physics/physics_connection.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/physics_connection.cc'; fi`; \
     1534@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/physics_connection.Tpo" "$(DEPDIR)/physics_connection.Po"; else rm -f "$(DEPDIR)/physics_connection.Tpo"; exit 1; fi
     1535@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/physics/physics_connection.cc' object='physics_connection.obj' libtool=no @AMDEPBACKSLASH@
     1536@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/physics_connection.Po' tmpdepfile='$(DEPDIR)/physics_connection.TPo' @AMDEPBACKSLASH@
     1537@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1538@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o physics_connection.obj `if test -f 'util/physics/physics_connection.cc'; then $(CYGPATH_W) 'util/physics/physics_connection.cc'; else $(CYGPATH_W) '$(srcdir)/util/physics/physics_connection.cc'; fi`
    15191539
    15201540field.o: util/physics/fields/field.cc
  • orxonox/branches/physics/src/util/physics/fields/field.cc

    r4180 r4181  
    2828{
    2929   this->setClassName ("Field");
     30   this->setMagnitude(1);
     31   this->setAttenuation(0);
    3032}
    3133
  • orxonox/branches/physics/src/util/physics/physics_connection.cc

    r4178 r4181  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "physics_connection.h"
     19
    1920
    2021using namespace std;
     
    2324/**
    2425   \brief standard constructor
    25    \todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27PhysicsConnection::PhysicsConnection ()
    2828{
    29    this->setClassName ("ProtoClass");
     29   this->setClassName ("PhysicsConnection");
     30   connection = NULL;
    3031}
    3132
     
    3536
    3637*/
    37 ProtoClass::~ProtoClass ()
     38PhysicsConnection::~PhysicsConnection ()
    3839{
    39   // delete what has to be deleted here
     40  if (this->connection)
     41    delete this->connection;
    4042}
     43
     44
     45
     46
     47
     48
     49bool PhysicsConnection::addConnection(ParticleSystem* particleSystem, Field* field)
     50{
     51  if (!this->connection)
     52    {
     53      this->connection = new PhysConnection;
     54      this->connection->type = PCON_ParticlesField;
     55      this->connection->particleSystem = particleSystem;
     56      this->connection->field = field;
     57    }
     58}
  • orxonox/branches/physics/src/util/physics/physics_connection.h

    r4178 r4181  
    11/*!
    2     \file proto_class.h
    3     \brief Definition of ...
    4 
     2    \file physics_connection.h
     3    \brief Definition of The Physical Connection Class.
    54*/
    65
    7 #ifndef _PROTO_CLASS_H
    8 #define _PROTO_CLASS_H
     6#ifndef _PHYSICS_CONNECTION_H
     7#define _PHYSICS_CONNECTION_H
    98
    109#include "base_object.h"
    1110
    12 // FORWARD DEFINITION
     11//! An enumerator for different ConnectionTypes
     12typedef enum PCON_Type { PCON_IPhysIPhys = 0,
     13                         PCON_IPhysField = 1,
     14                         PCON_ParticlesField = 2 };
    1315
    1416
     17// Forward Declaration
     18class Field;
     19class IPhysics;
     20class ParticleSystem;
    1521
    16 //! A class for ...
    17 class ProtoClass : public BaseObject {
     22
     23typedef struct PhysConnection
     24{
     25  PCON_Type type;                    //!< What kind of connection this is.
     26
     27  IPhysics* subject;                 //!< The main Subject of this Connection.
     28  IPhysics* partner2;                //!< The second partner of this Connection.
     29
     30  ParticleSystem* particleSystem;    //!< A ParticleSystem in this Connection
     31 
     32  Field* field;                      //!< The field to connect either subject of ParticleSystem to.
     33};
     34
     35//! A class that Handles Physical Connection between subjects
     36class PhysicsConnection : public BaseObject {
    1837
    1938 public:
    20   ProtoClass();
    21   virtual ~ProtoClass();
     39  PhysicsConnection();
     40  virtual ~PhysicsConnection();
    2241
     42  bool addConnection(IPhysics* partnerOne, IPhysics* partnerTwo);
     43  bool addConnection(IPhysics* subject, Field* field);
     44  bool addConnection(ParticleSystem* particleSystem, Field* field);
     45
     46  inline PhysConnection* getConnection(void) const {return this->connection;}
    2347
    2448 private:
    25 
     49  PhysConnection* connection;        //!< The Physical Connection.
    2650};
    2751
    28 #endif /* _PROTO_CLASS_H */
     52#endif /* _PHYSICS_CONNECTION_H */
Note: See TracChangeset for help on using the changeset viewer.