Changeset 4395 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 30, 2005, 2:19:41 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/particles/particle_system.cc
r4385 r4395 243 243 // applying force to the System. 244 244 if (likely (tickPart->mass > 0.0)) 245 tickPart->velocity += tickPart->extForce / tickPart->mass ;245 tickPart->velocity += tickPart->extForce / tickPart->mass * dt; 246 246 247 247 // rendering new position. … … 305 305 \param dt The time over which the field gets applied 306 306 */ 307 void ParticleSystem::applyField(Field* field , float dt)307 void ParticleSystem::applyField(Field* field) 308 308 { 309 309 Particle* tickPart = particles; 310 310 while (tickPart) 311 311 { 312 tickPart->extForce += field->calcForce( dt,tickPart->position);312 tickPart->extForce += field->calcForce(tickPart->position); 313 313 tickPart = tickPart->next; 314 314 } -
orxonox/trunk/src/lib/graphics/particles/particle_system.h
r4394 r4395 59 59 //! A class to handle ParticleSystems 60 60 class ParticleSystem : public PhysicsInterface { 61 61 friend class ParticleEmitter; 62 62 63 public: 63 64 ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT, … … 97 98 inline float getMass(void) const { return this->initialMass; }; 98 99 99 virtual void applyField(Field* field , float dt);100 virtual void applyField(Field* field); 100 101 101 102 void addParticle(const Vector& position, const Vector& velocity, unsigned int data = 0); -
orxonox/trunk/src/lib/physics/fields/field.h
r4338 r4395 43 43 \returns The Force Vector 44 44 */ 45 virtual Vector calcForce( float dt,const Vector& data) const = 0;45 virtual Vector calcForce(const Vector& data) const = 0; 46 46 47 47 void setMagnitude(const float& magnitude); -
orxonox/trunk/src/lib/physics/fields/gravity.cc
r4338 r4395 45 45 \returns The force. 46 46 */ 47 Vector Gravity::calcForce( float dt,const Vector& data) const47 Vector Gravity::calcForce(const Vector& data) const 48 48 { 49 return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude() * dt;49 return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude(); 50 50 } 51 51 -
orxonox/trunk/src/lib/physics/fields/gravity.h
r4338 r4395 21 21 virtual ~Gravity(); 22 22 23 virtual Vector calcForce( float dt,const Vector& data) const;23 virtual Vector calcForce(const Vector& data) const; 24 24 25 25 private: -
orxonox/trunk/src/lib/physics/fields/point_gravity.cc
r4338 r4395 45 45 \returns The force. 46 46 */ 47 Vector PointGravity::calcForce( float dt,const Vector& data) const47 Vector PointGravity::calcForce(const Vector& data) const 48 48 { 49 return (this->getAbsCoor() - data) * this->getMagnitude() * dt;49 return (this->getAbsCoor() - data) * this->getMagnitude(); 50 50 } 51 51 -
orxonox/trunk/src/lib/physics/fields/point_gravity.h
r4338 r4395 21 21 virtual ~PointGravity(); 22 22 23 virtual Vector calcForce( float dt,const Vector& data) const;23 virtual Vector calcForce(const Vector& data) const; 24 24 25 25 private: -
orxonox/trunk/src/lib/physics/fields/twirl.cc
r4338 r4395 45 45 \returns The force. 46 46 */ 47 Vector Twirl::calcForce( float dt,const Vector& data) const47 Vector Twirl::calcForce(const Vector& data) const 48 48 { 49 49 return /*this->getAbsDir()*/ Vector(0,1,0).cross(this->getAbsCoor() - data) 50 * this->getMagnitude() * dt;50 * this->getMagnitude(); 51 51 } 52 52 -
orxonox/trunk/src/lib/physics/fields/twirl.h
r4338 r4395 21 21 virtual ~Twirl(); 22 22 23 virtual Vector calcForce( float dt,const Vector& data) const;23 virtual Vector calcForce(const Vector& data) const; 24 24 25 25 private: -
orxonox/trunk/src/lib/physics/physics_connection.cc
r4384 r4395 49 49 \param dt The time to apply in Seconds 50 50 */ 51 void PhysicsConnection::apply( const float& dt) const51 void PhysicsConnection::apply(void) const 52 52 { 53 53 if (likely(this->type == PCON_PhysIField && this->field->getMagnitude() != 0.0)) 54 this->subject->applyField(this->field , dt);54 this->subject->applyField(this->field); 55 55 else ; 56 56 } -
orxonox/trunk/src/lib/physics/physics_connection.h
r4394 r4395 30 30 virtual ~PhysicsConnection(); 31 31 32 void apply( const float& dt) const;32 void apply(void) const; 33 33 34 34 private: -
orxonox/trunk/src/lib/physics/physics_engine.cc
r4394 r4395 144 144 while (enumConn) 145 145 { 146 enumConn->apply( dt);146 enumConn->apply(); 147 147 enumConn = iterator->nextElement(); 148 148 } -
orxonox/trunk/src/lib/physics/physics_interface.cc
r4392 r4395 88 88 89 89 90 void PhysicsInterface::applyField(Field* field , float dt)90 void PhysicsInterface::applyField(Field* field) 91 91 { 92 92 // this->forceSum += force; -
orxonox/trunk/src/lib/physics/physics_interface.h
r4382 r4395 15 15 //! A Physics interface 16 16 /** 17 here can be some longer description of this class 17 The PhysicsInterface is an extension to Any other object, 18 that can be used to turn it to be Physcally animated. 19 Still you have to connect fields. 20 IMPORTANT is, that when using PNodes this baseclass is ok. 21 BUT, when using any other class that does not by itself implement 22 PNode you __MUST__ implement all the virtual functions by your own 18 23 */ 19 24 class PhysicsInterface : virtual public BaseObject … … 30 35 inline float getTotalMass( void ) const { return mass + massChildren; }; 31 36 32 virtual void applyField(Field* field , float dt);37 virtual void applyField(Field* field); 33 38 virtual void tickPhys( float dt ); 34 39 35 40 protected: 36 v oid recalcMass();41 virtual void recalcMass(); 37 42 38 43
Note: See TracChangeset
for help on using the changeset viewer.