Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/lib/physics


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

Location:
trunk/src/lib/physics
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/physics/fields/field.cc

    r9406 r9869  
    2323#include "util/loading/load_param.h"
    2424
     25ObjectListDefinition(Field);
    2526
    2627/**
    27  * standard constructor
     28 * @brief standard constructor
    2829*/
    2930Field::Field ()
     
    3334
    3435/**
    35  *  standard deconstructor
    36 
    37 */
     36 * @brief standard deconstructor
     37 */
    3838Field::~Field ()
    3939{
     
    4242
    4343/**
    44   \brief initializes a Field
    45 */
     44  * @brief initializes a Field
     45 */
    4646void Field::init()
    4747{
    48   this->setClassID(CL_FIELD, "Field");
     48  this->registerObject(this, Field::_objectList);
    4949  this->setMagnitude(1);
    5050  this->setAttenuation(0);
     
    5454
    5555/**
    56 * @param root The XML-element to load settings from
     56 * @param root The XML-element to load settings from
    5757 */
    5858void Field::loadParams(const TiXmlElement* root)
  • trunk/src/lib/physics/fields/field.h

    r6512 r9869  
    1616/*!
    1717 * @file field.h
    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 */
     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 */
    2323
    2424#ifndef _FIELD_H
     
    3434class Field : public PNode
    3535{
     36  ObjectListDeclaration(Field);
    3637 public:
    3738  Field();
  • trunk/src/lib/physics/fields/gravity.cc

    r9406 r9869  
    2121#include "util/loading/factory.h"
    2222
     23#include "class_id_DEPRECATED.h"
     24ObjectListDefinitionID(Gravity, CL_FIELD_GRAVITY);
    2325
    24 
    25 CREATE_FACTORY(Gravity, CL_FIELD_GRAVITY);
     26CREATE_FACTORY(Gravity);
    2627
    2728Gravity::Gravity(const TiXmlElement* root)
    2829{
    29   this->setClassID(CL_FIELD_GRAVITY, "Gravity");
     30  this->registerObject(this, Gravity::_objectList);
    3031
    3132  if (root != NULL)
  • trunk/src/lib/physics/fields/gravity.h

    r6512 r9869  
    1616//! A class for ...
    1717class Gravity : public Field {
     18  ObjectListDeclaration(Gravity);
    1819
    1920 public:
  • trunk/src/lib/physics/fields/point_gravity.cc

    r9406 r9869  
    2020
    2121
     22#include "class_id_DEPRECATED.h"
     23ObjectListDefinitionID(PointGravity, CL_FIELD_POINT_GRAVITY);
     24
    2225
    2326/**
     
    2730PointGravity::PointGravity ()
    2831{
    29    this->setClassID(CL_FIELD_POINT_GRAVITY, "PointGravity");
     32  this->registerObject(this, PointGravity::_objectList);
    3033}
    3134
  • trunk/src/lib/physics/fields/point_gravity.h

    r5405 r9869  
    1 /*! 
     1/*!
    22 * @file point_gravity.h
    33  *  Definition of ...
     
    1616//! A class for ...
    1717class PointGravity : public Field {
     18  ObjectListDeclaration(PointGravity);
    1819
    1920 public:
  • trunk/src/lib/physics/fields/twirl.cc

    r9406 r9869  
    2020
    2121
     22#include "class_id_DEPRECATED.h"
     23ObjectListDefinitionID(Twirl, CL_FIELD_TWIRL);
     24
    2225
    2326/**
     
    2730Twirl::Twirl ()
    2831{
    29    this->setClassID(CL_FIELD_TWIRL, "Twirl");
     32  this->registerObject(this, Twirl::_objectList);
    3033}
    3134
  • trunk/src/lib/physics/fields/twirl.h

    r5405 r9869  
    1 /*! 
     1/*!
    22 * @file twirl.h
    33  *  Definition of ...
     
    1616//! A class for ...
    1717class Twirl : public Field {
     18  ObjectListDeclaration(Twirl);
    1819
    1920 public:
  • trunk/src/lib/physics/physics_connection.cc

    r9406 r9869  
    1919
    2020#include "physics_engine.h"
     21#include "debug.h"
    2122
    22 #include "field.h"
    23 #include "particle_system.h"
     23#include "fields/field.h"
     24#include "particles/particle_system.h"
    2425#include "physics_interface.h"
    2526
     
    2728#include "util/loading/load_param.h"
    2829
    29 
    30 
    31 CREATE_FACTORY(PhysicsConnection, CL_PHYSICS_CONNECTION);
    32 
     30#include "class_id_DEPRECATED.h"
     31ObjectListDefinition(PhysicsConnection);
     32CREATE_FACTORY(PhysicsConnection);
    3333/**
    3434 *  creates a PhysicsConnection
     
    3636PhysicsConnection::PhysicsConnection(PhysicsInterface* subject, Field* field)
    3737{
    38   this->setClassID(CL_PHYSICS_CONNECTION, "PhysicsConnection");
     38  this->registerObject(this, PhysicsConnection::_objectList);
    3939  this->type = PCON_PhysIField;
    4040
     
    4747PhysicsConnection::PhysicsConnection(const TiXmlElement* root)
    4848{
    49   this->setClassID(CL_PHYSICS_CONNECTION, "PhysicsConnection");
     49  this->registerObject(this, PhysicsConnection::_objectList);
    5050  this->type = PCON_PhysIField;
    5151
  • trunk/src/lib/physics/physics_connection.h

    r7221 r9869  
    2727class PhysicsConnection : public BaseObject
    2828{
    29 
     29  ObjectListDeclaration(PhysicsConnection);
    3030 public:
    3131  PhysicsConnection(PhysicsInterface* subject, Field* field);
  • trunk/src/lib/physics/physics_engine.cc

    r9406 r9869  
    1818#include "physics_engine.h"
    1919
    20 #include "class_list.h"
    21 #include "parser/tinyxml/tinyxml.h"
    2220#include "util/loading/factory.h"
    23 #include "util/loading/load_param.h"
    24 
    25 
    26 
    27 
    28 /**
    29  * standard constructor
    30 */
     21#include "util/loading/load_param_xml.h"
     22
     23
     24
     25ObjectListDefinition(PhysicsEngine);
     26/**
     27 * @brief standard constructor
     28 */
    3129PhysicsEngine::PhysicsEngine()
    3230{
    33   this->setClassID(CL_PHYSICS_ENGINE, "PhysicsEngine");
     31  this->registerObject(this, PhysicsEngine::_objectList);
    3432  this->setName("PhysicsEngine");
    3533  this->interfaces = NULL;
     
    130128PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const
    131129{
    132   BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE);
    133   return (interface != NULL)?  dynamic_cast<PhysicsInterface*>(interface) : NULL;
     130  return PhysicsInterface::objectList().getObject(physicsInterfaceName);
    134131}
    135132
     
    223220
    224221  /* 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   }
     222
     223  ObjectList<PhysicsInterface>::const_iterator it;
     224  for (it = PhysicsInterface::objectList().begin();
     225       it != PhysicsInterface::objectList().end();
     226       ++it)
     227      (*it)->tickPhys(dt);
    231228}
    232229
  • trunk/src/lib/physics/physics_engine.h

    r7221 r9869  
    1212#include "physics_connection.h"
    1313#include "physics_interface.h"
    14 #include "field.h"
     14#include "fields/field.h"
    1515#include <list>
    1616
     
    2020
    2121//! A class, that brings things into motion through Physics.
    22 class PhysicsEngine : public BaseObject {
    23 
    24  public:
     22class PhysicsEngine : public BaseObject
     23{
     24  ObjectListDeclaration(PhysicsEngine);
     25public:
    2526  virtual ~PhysicsEngine();
    2627  /** @returns a Pointer to the only object of this Class */
     
    4647  void                   debug() const;
    4748
    48  private:
     49private:
    4950  PhysicsEngine();
    5051
    51  private:
     52private:
    5253  static PhysicsEngine*         singletonRef;         //!< the singleton reference of the PhysicsEngine
    5354
  • trunk/src/lib/physics/physics_interface.cc

    r9406 r9869  
    2323#include "physics_engine.h"
    2424
    25 #include "field.h"
     25#include "fields/field.h"
    2626#include "p_node.h"
    2727
     
    3131
    3232
    33 
     33ObjectListDefinition(PhysicsInterface);
    3434/**
    35  * standard constructor
     35 * @brief standard constructor
    3636 */
    3737PhysicsInterface::PhysicsInterface ()
    3838{
    39   this->setClassID(CL_PHYSICS_INTERFACE, "PhysicsInterface");
     39  this->registerObject(this, PhysicsInterface::_objectList);
    4040
    4141  this->mass = 1;
  • trunk/src/lib/physics/physics_interface.h

    r8190 r9869  
    2929class PhysicsInterface : virtual public BaseObject
    3030{
     31  ObjectListDeclaration(PhysicsInterface);
    3132 public:
    3233  PhysicsInterface();
Note: See TracChangeset for help on using the changeset viewer.