Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9686 in orxonox.OLD for branches/new_class_id/src/lib/physics


Ignore:
Timestamp:
Aug 22, 2006, 2:36:54 PM (18 years ago)
Author:
bensch
Message:

new_class_id: many more classes done

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  
    2323#include "util/loading/load_param.h"
    2424
     25NewObjectListDefinition(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)
  • branches/new_class_id/src/lib/physics/fields/field.h

    r6512 r9686  
    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  NewObjectListDeclaration(Field);
    3637 public:
    3738  Field();
  • branches/new_class_id/src/lib/physics/fields/gravity.cc

    r9406 r9686  
    2121#include "util/loading/factory.h"
    2222
    23 
     23#include "class_id.h"
     24NewObjectListDefinitionID(Gravity, CL_FIELD_GRAVITY);
    2425
    2526CREATE_FACTORY(Gravity, CL_FIELD_GRAVITY);
     
    2728Gravity::Gravity(const TiXmlElement* root)
    2829{
    29   this->setClassID(CL_FIELD_GRAVITY, "Gravity");
     30  this->registerObject(this, Gravity::_objectList);
    3031
    3132  if (root != NULL)
  • branches/new_class_id/src/lib/physics/fields/gravity.h

    r6512 r9686  
    1616//! A class for ...
    1717class Gravity : public Field {
     18  NewObjectListDeclaration(Gravity);
    1819
    1920 public:
  • branches/new_class_id/src/lib/physics/fields/point_gravity.cc

    r9406 r9686  
    2020
    2121
     22#include "class_id.h"
     23NewObjectListDefinitionID(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
  • branches/new_class_id/src/lib/physics/fields/point_gravity.h

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

    r9406 r9686  
    2020
    2121
     22#include "class_id.h"
     23NewObjectListDefinitionID(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
  • branches/new_class_id/src/lib/physics/fields/twirl.h

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

    r9406 r9686  
    2727#include "util/loading/load_param.h"
    2828
    29 
     29#include "class_id.h"
    3030
    3131CREATE_FACTORY(PhysicsConnection, CL_PHYSICS_CONNECTION);
    32 
     32NewObjectListDefinition(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
  • branches/new_class_id/src/lib/physics/physics_connection.h

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

    r9406 r9686  
    1818#include "physics_engine.h"
    1919
    20 #include "class_list.h"
    2120#include "parser/tinyxml/tinyxml.h"
    2221#include "util/loading/factory.h"
     
    2524
    2625
    27 
    28 /**
    29  * standard constructor
    30 */
     26NewObjectListDefinition(PhysicsEngine);
     27/**
     28 * @brief standard constructor
     29 */
    3130PhysicsEngine::PhysicsEngine()
    3231{
    33   this->setClassID(CL_PHYSICS_ENGINE, "PhysicsEngine");
     32  this->registerObject(this, PhysicsEngine::_objectList);
    3433  this->setName("PhysicsEngine");
    3534  this->interfaces = NULL;
     
    130129PhysicsInterface* PhysicsEngine::getPhysicsInterfaceByName(const std::string& physicsInterfaceName) const
    131130{
    132   BaseObject* interface = ClassList::getObject(physicsInterfaceName, CL_PHYSICS_INTERFACE);
    133   return (interface != NULL)?  dynamic_cast<PhysicsInterface*>(interface) : NULL;
     131  return PhysicsInterface::objectList().getObject(physicsInterfaceName);
    134132}
    135133
     
    223221
    224222  /* 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);
    231229}
    232230
  • branches/new_class_id/src/lib/physics/physics_engine.h

    r7221 r9686  
    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  NewObjectListDeclaration(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
  • branches/new_class_id/src/lib/physics/physics_interface.cc

    r9406 r9686  
    3131
    3232
    33 
     33NewObjectListDefinition(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;
  • branches/new_class_id/src/lib/physics/physics_interface.h

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