- Timestamp:
- May 30, 2005, 2:05:21 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/particles/particle_engine.h
r4349 r4394 20 20 }; 21 21 22 //! A default singleton class. 22 //! The physicsEngine handles and stores Systems and Emitters. 23 /** 24 It is responsible for driving on the Particles (tick) 25 It draw particles (draw) 26 and it emitts particles into the system 27 */ 23 28 class ParticleEngine : public BaseObject { 24 29 … … 48 53 private: 49 54 ParticleEngine(void); 50 static ParticleEngine* singletonRef; 55 static ParticleEngine* singletonRef; //!< The reference to the engine. 51 56 52 tList<ParticleSystem>* systemList; 53 tList<ParticleEmitter>* emitterList; 57 tList<ParticleSystem>* systemList; //!< A list of Systems handled by the ParticleEngine. 58 tList<ParticleEmitter>* emitterList; //!< A list of Emitters handled by the ParticleEngine. 54 59 55 tList<ParticleConnection>* connectionList; 60 tList<ParticleConnection>* connectionList; //!< A list of Connections between Systems and Emitters. 56 61 }; 57 62 -
orxonox/trunk/src/lib/graphics/particles/particle_system.h
r4381 r4394 57 57 }; 58 58 59 //! A class to handle particleSystems59 //! A class to handle ParticleSystems 60 60 class ParticleSystem : public PhysicsInterface { 61 friend class ParticleEmitter;62 61 63 62 public: … … 100 99 virtual void applyField(Field* field, float dt); 101 100 101 void addParticle(const Vector& position, const Vector& velocity, unsigned int data = 0); 102 102 103 void tick(float dt); 103 104 void draw(void) const; … … 132 133 133 134 GLuint* glID; //!< A List of different gl-List-ID's 134 GLuint dialectCount; //!< How many different types of particles are there in the Particle System 135 136 void addParticle(const Vector& position, const Vector& velocity, unsigned int data = 0); 137 135 GLuint dialectCount; //!< How many different types of particles are there in the Particle System 138 136 }; 139 137 -
orxonox/trunk/src/lib/physics/fields/field.cc
r4338 r4394 18 18 #include "field.h" 19 19 20 #include "physics_engine.h" 21 20 22 using namespace std; 21 23 … … 30 32 this->setMagnitude(1); 31 33 this->setAttenuation(0); 34 35 PhysicsEngine::getInstance()->addField(this); 32 36 } 33 37 … … 39 43 Field::~Field () 40 44 { 41 // delete what has to be deleted here45 PhysicsEngine::getInstance()->removeField(this); 42 46 } 43 47 -
orxonox/trunk/src/lib/physics/physics_connection.h
r4381 r4394 21 21 22 22 //! A class that Handles Physical Connection between subjects 23 class PhysicsConnection : virtualpublic BaseObject23 class PhysicsConnection : public BaseObject 24 24 { 25 25 -
orxonox/trunk/src/lib/physics/physics_engine.cc
r4392 r4394 34 34 this->connections = new tList<PhysicsConnection>; 35 35 this->interfaces = new tList<PhysicsInterface>; 36 this->fields = new tList<Field>; 36 37 } 37 38 … … 81 82 { 82 83 this->interfaces->remove(physicsInterface); 84 } 85 86 /** 87 \brief adds a Field to the list of handeled fields 88 \param field the field to add 89 90 this is normally done in the constructor of any Field 91 */ 92 void PhysicsEngine::addField(Field* field) 93 { 94 this->fields->add(field); 95 } 96 97 /** 98 \brief removes a Field from the list of handeled fields 99 \param field the field to remove 100 101 this is normally done in the destructor of any Field 102 */ 103 void PhysicsEngine::removeField(Field* field) 104 { 105 this->fields->remove(field); 83 106 } 84 107 -
orxonox/trunk/src/lib/physics/physics_engine.h
r4392 r4394 12 12 #include "physics_connection.h" 13 13 #include "physics_interface.h" 14 #include "field.h" 14 15 15 16 // Forward Declaration … … 27 28 void removePhysicsInterface(PhysicsInterface* physicsInterface); 28 29 30 void addField(Field* field); 31 void removeField(Field* field); 29 32 30 33 void addConnection(PhysicsConnection* connection); … … 40 43 41 44 tList<PhysicsInterface>* interfaces; //!< a list of physically based objects 45 tList<Field>* fields; //!< a list of physicsl fields. 42 46 tList<PhysicsConnection>* connections; //!< a list of physical connections 43 47 };
Note: See TracChangeset
for help on using the changeset viewer.