Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4762 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 2, 2005, 1:34:42 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: PhysicsInterface should now make a usefull cast: PhysicsInterface→BaseObject→PNode()

Location:
orxonox/trunk/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/particles/particle_system.cc

    r4746 r4762  
    3939   \param type The Type of the ParticleSystem
    4040*/
    41 ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type) : PhysicsInterface(this)
     41ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
    4242{
    4343  this->init();
     
    5151  \param root: the XML-element to load from
    5252 */
    53 ParticleSystem::ParticleSystem(const TiXmlElement* root) : PhysicsInterface(this)
     53ParticleSystem::ParticleSystem(const TiXmlElement* root)
    5454{
    5555  this->init();
  • orxonox/trunk/src/lib/physics/physics_interface.cc

    r4597 r4762  
    3636   \brief standard constructor
    3737 */
    38 PhysicsInterface::PhysicsInterface (void* objectPointer)
     38PhysicsInterface::PhysicsInterface ()
    3939{
    4040  this->setClassID(CL_PHYSICS_INTERFACE, "PhysicsInterface");
    41   this->objectPointer = objectPointer;
    4241
    4342  this->mass = 1;
     
    9695void PhysicsInterface::applyField(Field* field)
    9796{
    98   PNode* tmp = (PNode*) objectPointer;
     97  PNode* tmp = dynamic_cast<PNode*>((BaseObject*)this);
    9998  this->forceSum += field->calcForce(tmp->getAbsCoor());
    10099  this->bForceApplied = true;
     
    108107{
    109108  //  Vector acc = this->forceSum / ( this->massChildren + this->mass );
    110   PNode* coorTick =  (PNode*)(this->objectPointer);
     109  PNode* coorTick =  dynamic_cast<PNode*>((BaseObject*)this);
    111110  if (this->bForceApplied && coorTick)
    112111  {
  • orxonox/trunk/src/lib/physics/physics_interface.h

    r4597 r4762  
    2929{
    3030 public:
    31   PhysicsInterface(void* objectPointer);
     31  PhysicsInterface();
    3232  virtual ~PhysicsInterface();
    3333  /** \param mass the mass to set for this node. */
     
    4646
    4747 private:
    48   void*          objectPointer;         //!< A Pointer to the object we handel (actually should be this)
    49 
    50 
    5148  float          mass;                  //!< Mass of this object
    5249  float          massChildren;          //!< Sum of the masses of the children nodes
Note: See TracChangeset for help on using the changeset viewer.