Changeset 9686 in orxonox.OLD for branches/new_class_id/src/lib/physics
- Timestamp:
- Aug 22, 2006, 2:36:54 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/physics
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/physics/fields/field.cc
r9406 r9686 23 23 #include "util/loading/load_param.h" 24 24 25 NewObjectListDefinition(Field); 25 26 26 27 /** 27 * standard constructor28 * @brief standard constructor 28 29 */ 29 30 Field::Field () … … 33 34 34 35 /** 35 * standard deconstructor 36 37 */ 36 * @brief standard deconstructor 37 */ 38 38 Field::~Field () 39 39 { … … 42 42 43 43 /** 44 \brief initializes a Field45 */44 * @brief initializes a Field 45 */ 46 46 void Field::init() 47 47 { 48 this-> setClassID(CL_FIELD, "Field");48 this->registerObject(this, Field::_objectList); 49 49 this->setMagnitude(1); 50 50 this->setAttenuation(0); … … 54 54 55 55 /** 56 * @param root The XML-element to load settings from56 * @param root The XML-element to load settings from 57 57 */ 58 58 void Field::loadParams(const TiXmlElement* root) -
branches/new_class_id/src/lib/physics/fields/field.h
r6512 r9686 16 16 /*! 17 17 * @file field.h 18 *abstract definition of a Physical Field19 20 21 22 */18 * abstract definition of a Physical Field 19 * 20 * This is a totally abstract class, that only enables different Physical Fields to 21 * exist on a common Level. 22 */ 23 23 24 24 #ifndef _FIELD_H … … 34 34 class Field : public PNode 35 35 { 36 NewObjectListDeclaration(Field); 36 37 public: 37 38 Field(); -
branches/new_class_id/src/lib/physics/fields/gravity.cc
r9406 r9686 21 21 #include "util/loading/factory.h" 22 22 23 23 #include "class_id.h" 24 NewObjectListDefinitionID(Gravity, CL_FIELD_GRAVITY); 24 25 25 26 CREATE_FACTORY(Gravity, CL_FIELD_GRAVITY); … … 27 28 Gravity::Gravity(const TiXmlElement* root) 28 29 { 29 this-> setClassID(CL_FIELD_GRAVITY, "Gravity");30 this->registerObject(this, Gravity::_objectList); 30 31 31 32 if (root != NULL) -
branches/new_class_id/src/lib/physics/fields/gravity.h
r6512 r9686 16 16 //! A class for ... 17 17 class Gravity : public Field { 18 NewObjectListDeclaration(Gravity); 18 19 19 20 public: -
branches/new_class_id/src/lib/physics/fields/point_gravity.cc
r9406 r9686 20 20 21 21 22 #include "class_id.h" 23 NewObjectListDefinitionID(PointGravity, CL_FIELD_POINT_GRAVITY); 24 22 25 23 26 /** … … 27 30 PointGravity::PointGravity () 28 31 { 29 this->setClassID(CL_FIELD_POINT_GRAVITY, "PointGravity");32 this->registerObject(this, PointGravity::_objectList); 30 33 } 31 34 -
branches/new_class_id/src/lib/physics/fields/point_gravity.h
r5405 r9686 1 /*! 1 /*! 2 2 * @file point_gravity.h 3 3 * Definition of ... … … 16 16 //! A class for ... 17 17 class PointGravity : public Field { 18 NewObjectListDeclaration(PointGravity); 18 19 19 20 public: -
branches/new_class_id/src/lib/physics/fields/twirl.cc
r9406 r9686 20 20 21 21 22 #include "class_id.h" 23 NewObjectListDefinitionID(Twirl, CL_FIELD_TWIRL); 24 22 25 23 26 /** … … 27 30 Twirl::Twirl () 28 31 { 29 this->setClassID(CL_FIELD_TWIRL, "Twirl");32 this->registerObject(this, Twirl::_objectList); 30 33 } 31 34 -
branches/new_class_id/src/lib/physics/fields/twirl.h
r5405 r9686 1 /*! 1 /*! 2 2 * @file twirl.h 3 3 * Definition of ... … … 16 16 //! A class for ... 17 17 class Twirl : public Field { 18 NewObjectListDeclaration(Twirl); 18 19 19 20 public: -
branches/new_class_id/src/lib/physics/physics_connection.cc
r9406 r9686 27 27 #include "util/loading/load_param.h" 28 28 29 29 #include "class_id.h" 30 30 31 31 CREATE_FACTORY(PhysicsConnection, CL_PHYSICS_CONNECTION); 32 32 NewObjectListDefinition(PhysicsConnection); 33 33 /** 34 34 * creates a PhysicsConnection … … 36 36 PhysicsConnection::PhysicsConnection(PhysicsInterface* subject, Field* field) 37 37 { 38 this-> setClassID(CL_PHYSICS_CONNECTION, "PhysicsConnection");38 this->registerObject(this, PhysicsConnection::_objectList); 39 39 this->type = PCON_PhysIField; 40 40 … … 47 47 PhysicsConnection::PhysicsConnection(const TiXmlElement* root) 48 48 { 49 this-> setClassID(CL_PHYSICS_CONNECTION, "PhysicsConnection");49 this->registerObject(this, PhysicsConnection::_objectList); 50 50 this->type = PCON_PhysIField; 51 51 -
branches/new_class_id/src/lib/physics/physics_connection.h
r7221 r9686 27 27 class PhysicsConnection : public BaseObject 28 28 { 29 29 NewObjectListDeclaration(PhysicsConnection); 30 30 public: 31 31 PhysicsConnection(PhysicsInterface* subject, Field* field); -
branches/new_class_id/src/lib/physics/physics_engine.cc
r9406 r9686 18 18 #include "physics_engine.h" 19 19 20 #include "class_list.h"21 20 #include "parser/tinyxml/tinyxml.h" 22 21 #include "util/loading/factory.h" … … 25 24 26 25 27 28 /** 29 * standard constructor30 */26 NewObjectListDefinition(PhysicsEngine); 27 /** 28 * @brief standard constructor 29 */ 31 30 PhysicsEngine::PhysicsEngine() 32 31 { 33 this-> setClassID(CL_PHYSICS_ENGINE, "PhysicsEngine");32 this->registerObject(this, PhysicsEngine::_objectList); 34 33 this->setName("PhysicsEngine"); 35 34 this->interfaces = NULL; … … 130 129 PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const 131 130 { 132 BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE); 133 return (interface != NULL)? dynamic_cast<PhysicsInterface*>(interface) : NULL; 131 return PhysicsInterface::objectList().getObject(physicsInterfaceName); 134 132 } 135 133 … … 223 221 224 222 /* actually tick all the PhysicsInterfaces. Move the objects around */ 225 if (this->interfaces != NULL || (this->interfaces = ClassList::getList(CL_PHYSICS_INTERFACE)) != NULL) 226 {227 std::list<BaseObject*>::const_iterator tickPhys;228 for (tickPhys = this->interfaces->begin(); tickPhys != this->interfaces->end(); tickPhys++)229 dynamic_cast<PhysicsInterface*>(*tickPhys)->tickPhys(dt);230 }223 224 NewObjectList<PhysicsInterface>::const_iterator it; 225 for (it = PhysicsInterface::objectList().begin(); 226 it != PhysicsInterface::objectList().end(); 227 ++it) 228 (*it)->tickPhys(dt); 231 229 } 232 230 -
branches/new_class_id/src/lib/physics/physics_engine.h
r7221 r9686 20 20 21 21 //! A class, that brings things into motion through Physics. 22 class PhysicsEngine : public BaseObject { 23 24 public: 22 class PhysicsEngine : public BaseObject 23 { 24 NewObjectListDeclaration(PhysicsEngine); 25 public: 25 26 virtual ~PhysicsEngine(); 26 27 /** @returns a Pointer to the only object of this Class */ … … 46 47 void debug() const; 47 48 48 49 private: 49 50 PhysicsEngine(); 50 51 51 52 private: 52 53 static PhysicsEngine* singletonRef; //!< the singleton reference of the PhysicsEngine 53 54 -
branches/new_class_id/src/lib/physics/physics_interface.cc
r9406 r9686 31 31 32 32 33 33 NewObjectListDefinition(PhysicsInterface); 34 34 /** 35 * standard constructor35 * @brief standard constructor 36 36 */ 37 37 PhysicsInterface::PhysicsInterface () 38 38 { 39 this-> setClassID(CL_PHYSICS_INTERFACE, "PhysicsInterface");39 this->registerObject(this, PhysicsInterface::_objectList); 40 40 41 41 this->mass = 1; -
branches/new_class_id/src/lib/physics/physics_interface.h
r8190 r9686 29 29 class PhysicsInterface : virtual public BaseObject 30 30 { 31 NewObjectListDeclaration(PhysicsInterface); 31 32 public: 32 33 PhysicsInterface();
Note: See TracChangeset
for help on using the changeset viewer.