Changeset 4180 in orxonox.OLD for orxonox/branches/physics/src/util
- Timestamp:
- May 13, 2005, 11:57:13 PM (20 years ago)
- Location:
- orxonox/branches/physics/src/util/physics/fields
- Files:
-
- 1 added
- 2 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/util/physics/fields/field.h
r4179 r4180 42 42 \returns The Force Vector 43 43 */ 44 virtual Vector & calcForce(Vector& data)= 0;44 virtual Vector calcForce(const Vector& data) const = 0; 45 45 46 46 void setMagnitude(const float& magnitude); 47 47 /** \returns The Magnitude of the Field */ 48 const float& getMagnitude(void) const {return this->magnitude;}48 inline const float& getMagnitude(void) const {return this->magnitude;} 49 49 50 50 void setAttenuation(const float& attenuation); 51 51 /** \returns The Attenuation of the Fiels */ 52 const float& getAttenuation(void) const {return this->attenuation;}52 inline const float& getAttenuation(void) const {return this->attenuation;} 53 53 54 54 private: -
orxonox/branches/physics/src/util/physics/fields/gravity.cc
r4178 r4180 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " proto_class.h"18 #include "gravity.h" 19 19 20 20 using namespace std; … … 25 25 \todo this constructor is not jet implemented - do it 26 26 */ 27 ProtoClass::ProtoClass()27 Gravity::Gravity () 28 28 { 29 this->setClassName (" ProtoClass");29 this->setClassName ("Gravity"); 30 30 } 31 31 … … 35 35 36 36 */ 37 ProtoClass::~ProtoClass()37 Gravity::~Gravity () 38 38 { 39 39 // delete what has to be deleted here 40 40 } 41 42 /** 43 \brief calculates the Gravity on any point in space 44 \param data The Position of the Point in space to attache gravity to. 45 \returns The force. 46 */ 47 Vector Gravity::calcForce(const Vector& data) const 48 { 49 return /*(this->getAbsDir().apply(Vector(0,1,0)))*/ Vector(0,-1,0) * this->getMagnitude(); 50 } 51 52 -
orxonox/branches/physics/src/util/physics/fields/gravity.h
r4178 r4180 1 1 /*! 2 \file proto_class.h2 \file gravity.h 3 3 \brief Definition of ... 4 4 5 5 */ 6 6 7 #ifndef _ PROTO_CLASS_H8 #define _ PROTO_CLASS_H7 #ifndef _GRAVITY_H 8 #define _GRAVITY_H 9 9 10 #include " base_object.h"10 #include "field.h" 11 11 12 12 // FORWARD DEFINITION … … 15 15 16 16 //! A class for ... 17 class ProtoClass : public BaseObject{17 class Gravity : public Field { 18 18 19 19 public: 20 ProtoClass();21 virtual ~ ProtoClass();20 Gravity(); 21 virtual ~Gravity(); 22 22 23 virtual Vector calcForce(const Vector& data) const; 23 24 24 25 private: … … 26 27 }; 27 28 28 #endif /* _ PROTO_CLASS_H */29 #endif /* _GRAVITY_H */
Note: See TracChangeset
for help on using the changeset viewer.