Changeset 4179 in orxonox.OLD for orxonox/branches/physics/src/util
- Timestamp:
- May 13, 2005, 11:39:44 PM (20 years ago)
- Location:
- orxonox/branches/physics/src/util/physics
- Files:
-
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/util/physics/field.cc
r4178 r4179 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 "field.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 Field::Field () 28 28 { 29 this->setClassName (" ProtoClass");29 this->setClassName ("Field"); 30 30 } 31 31 … … 35 35 36 36 */ 37 ProtoClass::~ProtoClass()37 Field::~Field () 38 38 { 39 39 // delete what has to be deleted here 40 40 } 41 42 43 /** 44 \param magnitude the magnitude of the Field. 45 */ 46 void Field::setMagnitude(const float& magnitude) 47 { 48 this->magnitude = magnitude; 49 } 50 51 /** 52 \param attenuation The attenuation of the Field (the bigger the smaller the region of influence) 53 */ 54 void Field::setAttenuation(const float& attenuation) 55 { 56 this->attenuation = attenuation; 57 } -
orxonox/branches/physics/src/util/physics/field.h
r4178 r4179 1 /*! 2 \file proto_class.h 3 \brief Definition of ... 1 /* 2 orxonox - the future of 3D-vertical-scrollers 4 3 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific: 12 main-programmer: Benjamin Grauer 13 co-programmer: ... 5 14 */ 6 15 7 #ifndef _PROTO_CLASS_H 8 #define _PROTO_CLASS_H 16 /*! 17 \file field.h 18 \brief abstract definition of a Physical Field 9 19 10 #include "base_object.h" 20 This is a totally abstract class, that only enables different Physical Fields to 21 exist on a common Level. 22 */ 23 24 #ifndef _FIELD_H 25 #define _FIELD_H 26 27 #include "p_node.h" 11 28 12 29 // FORWARD DEFINITION … … 14 31 15 32 16 //! A class for ... 17 class ProtoClass : public BaseObject { 33 //! An abstract class that represents a Force. 34 class Field : public PNode 35 { 36 public: 37 Field(); 38 virtual ~Field(); 18 39 19 public: 20 ProtoClass(); 21 virtual ~ProtoClass(); 40 /** 41 \param data This is the data given to this force, to calculate the ForceVector 42 \returns The Force Vector 43 */ 44 virtual Vector& calcForce(Vector& data) = 0; 22 45 46 void setMagnitude(const float& magnitude); 47 /** \returns The Magnitude of the Field */ 48 const float& getMagnitude(void) const {return this->magnitude;} 49 50 void setAttenuation(const float& attenuation); 51 /** \returns The Attenuation of the Fiels */ 52 const float& getAttenuation(void) const {return this->attenuation;} 23 53 24 54 private: 25 55 float magnitude; //!< The strength of the field 56 float attenuation; //!< The Attenuation (the bigger the shorter the influenced distance). 26 57 }; 27 58 28 #endif /* _ PROTO_CLASS_H */59 #endif /* _FIELD_H */
Note: See TracChangeset
for help on using the changeset viewer.