Changeset 4184 in orxonox.OLD for orxonox/branches/physics/src/util
- Timestamp:
- May 14, 2005, 10:27:47 PM (20 years ago)
- Location:
- orxonox/branches/physics/src/util/physics
- Files:
-
- 1 added
- 1 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/util/physics/fields/point_gravity.cc
r4182 r4184 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " gravity.h"18 #include "point_gravity.h" 19 19 20 20 using namespace std; … … 25 25 \todo this constructor is not jet implemented - do it 26 26 */ 27 Gravity::Gravity ()27 PointGravity::PointGravity () 28 28 { 29 this->setClassName (" Gravity");29 this->setClassName ("PointGravity"); 30 30 } 31 31 … … 35 35 36 36 */ 37 Gravity::~Gravity ()37 PointGravity::~PointGravity () 38 38 { 39 39 // delete what has to be deleted here … … 41 41 42 42 /** 43 \brief calculates the Gravity on any point in space44 \param data The Position of the Point in space to attache gravity to.43 \brief calculates the PointGravity on any point in space 44 \param data The Position of the Point in space to attache PointGravity to. 45 45 \returns The force. 46 46 */ 47 Vector Gravity::calcForce(const Vector& data) const47 Vector PointGravity::calcForce(const Vector& data) const 48 48 { 49 return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude();49 return (this->getAbsCoor() - data) * this->getMagnitude(); 50 50 } 51 51 -
orxonox/branches/physics/src/util/physics/fields/point_gravity.h
r4182 r4184 1 1 /*! 2 \file gravity.h2 \file point_gravity.h 3 3 \brief Definition of ... 4 4 5 5 */ 6 6 7 #ifndef _ GRAVITY_H8 #define _ GRAVITY_H7 #ifndef _POINT_GRAVITY_H 8 #define _POINT_GRAVITY_H 9 9 10 10 #include "field.h" … … 15 15 16 16 //! A class for ... 17 class Gravity : public Field {17 class PointGravity : public Field { 18 18 19 19 public: 20 Gravity();21 virtual ~ Gravity();20 PointGravity(); 21 virtual ~PointGravity(); 22 22 23 23 virtual Vector calcForce(const Vector& data) const; … … 27 27 }; 28 28 29 #endif /* _ GRAVITY_H */29 #endif /* _POINT_GRAVITY_H */ -
orxonox/branches/physics/src/util/physics/fields/twirl.cc
r4182 r4184 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " gravity.h"18 #include "twirl.h" 19 19 20 20 using namespace std; … … 25 25 \todo this constructor is not jet implemented - do it 26 26 */ 27 Gravity::Gravity()27 Twirl::Twirl () 28 28 { 29 this->setClassName (" Gravity");29 this->setClassName ("Twirl"); 30 30 } 31 31 … … 35 35 36 36 */ 37 Gravity::~Gravity()37 Twirl::~Twirl () 38 38 { 39 39 // delete what has to be deleted here … … 41 41 42 42 /** 43 \brief calculates the Gravityon any point in space44 \param data The Position of the Point in space to attache gravityto.43 \brief calculates the Twirl on any point in space 44 \param data The Position of the Point in space to attache twirl to. 45 45 \returns The force. 46 46 */ 47 Vector Gravity::calcForce(const Vector& data) const47 Vector Twirl::calcForce(const Vector& data) const 48 48 { 49 return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude(); 49 return /*this->getAbsDir()*/ Vector(0,1,0).cross(this->getAbsCoor() - data) 50 * this->getMagnitude(); 50 51 } 51 52 -
orxonox/branches/physics/src/util/physics/fields/twirl.h
r4182 r4184 1 1 /*! 2 \file gravity.h2 \file twirl.h 3 3 \brief Definition of ... 4 4 5 5 */ 6 6 7 #ifndef _ GRAVITY_H8 #define _ GRAVITY_H7 #ifndef _TWIRL_H 8 #define _TWIRL_H 9 9 10 10 #include "field.h" … … 15 15 16 16 //! A class for ... 17 class Gravity: public Field {17 class Twirl : public Field { 18 18 19 19 public: 20 Gravity();21 virtual ~ Gravity();20 Twirl(); 21 virtual ~Twirl(); 22 22 23 23 virtual Vector calcForce(const Vector& data) const; … … 27 27 }; 28 28 29 #endif /* _ GRAVITY_H */29 #endif /* _TWIRL_H */ -
orxonox/branches/physics/src/util/physics/physics_engine.h
r4183 r4184 10 10 #include "base_object.h" 11 11 #include "physics_connection.h" 12 #include "field .h"12 #include "fields.h" 13 13 14 14 // Forward Declaration
Note: See TracChangeset
for help on using the changeset viewer.