Changeset 4181 in orxonox.OLD for orxonox/branches/physics/src/util
- Timestamp:
- May 14, 2005, 12:28:44 AM (20 years ago)
- Location:
- orxonox/branches/physics/src/util/physics
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/util/physics/fields/field.cc
r4180 r4181 28 28 { 29 29 this->setClassName ("Field"); 30 this->setMagnitude(1); 31 this->setAttenuation(0); 30 32 } 31 33 -
orxonox/branches/physics/src/util/physics/physics_connection.cc
r4178 r4181 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include "proto_class.h" 18 #include "physics_connection.h" 19 19 20 20 21 using namespace std; … … 23 24 /** 24 25 \brief standard constructor 25 \todo this constructor is not jet implemented - do it26 26 */ 27 P rotoClass::ProtoClass()27 PhysicsConnection::PhysicsConnection () 28 28 { 29 this->setClassName ("ProtoClass"); 29 this->setClassName ("PhysicsConnection"); 30 connection = NULL; 30 31 } 31 32 … … 35 36 36 37 */ 37 P rotoClass::~ProtoClass()38 PhysicsConnection::~PhysicsConnection () 38 39 { 39 // delete what has to be deleted here 40 if (this->connection) 41 delete this->connection; 40 42 } 43 44 45 46 47 48 49 bool 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 1 1 /*! 2 \file proto_class.h 3 \brief Definition of ... 4 2 \file physics_connection.h 3 \brief Definition of The Physical Connection Class. 5 4 */ 6 5 7 #ifndef _P ROTO_CLASS_H8 #define _P ROTO_CLASS_H6 #ifndef _PHYSICS_CONNECTION_H 7 #define _PHYSICS_CONNECTION_H 9 8 10 9 #include "base_object.h" 11 10 12 // FORWARD DEFINITION 11 //! An enumerator for different ConnectionTypes 12 typedef enum PCON_Type { PCON_IPhysIPhys = 0, 13 PCON_IPhysField = 1, 14 PCON_ParticlesField = 2 }; 13 15 14 16 17 // Forward Declaration 18 class Field; 19 class IPhysics; 20 class ParticleSystem; 15 21 16 //! A class for ... 17 class ProtoClass : public BaseObject { 22 23 typedef 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 36 class PhysicsConnection : public BaseObject { 18 37 19 38 public: 20 P rotoClass();21 virtual ~P rotoClass();39 PhysicsConnection(); 40 virtual ~PhysicsConnection(); 22 41 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;} 23 47 24 48 private: 25 49 PhysConnection* connection; //!< The Physical Connection. 26 50 }; 27 51 28 #endif /* _P ROTO_CLASS_H */52 #endif /* _PHYSICS_CONNECTION_H */
Note: See TracChangeset
for help on using the changeset viewer.