Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 29, 2005, 12:30:54 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: started reimplementing the PhysicsInterface-class. This might just get bad :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/physics/physics_interface.h

    r4375 r4376  
    77#define _PHYSICS_INTERFACE_H
    88
    9 #include "p_node.h"
     9#include "vector.h"
    1010
    1111//! A Physics interface
     
    1313   here can be some longer description of this class
    1414*/
    15 class PhysicsInterface : public PNode {
     15class PhysicsInterface {
    1616
    1717 public:
    1818  PhysicsInterface();
    1919  virtual ~PhysicsInterface();
    20  
    21   inline void setMass( float mass ) { this->mass = mass; };                                     //!< Set the mass of this node
    22   inline float getMass( void ) const { return mass; };                                          //!< Get the mass of this node
    23   inline float getTotalMass( void ) const { return mass + massChildren; };      //!< Get the sum of the masses of this node and all subnodes
    24   void addForce( Vector force );                                                                        //!< Add a central force on this rigid body
    25   void addForce( Vector force, Vector grip );                                           //!< Add a decentral force on this rigid body
    26   void tick( float dt );                                                                                        //!< Update kinematics, reset force sum
     20  /** \param mass the mass to set for this node. */
     21  inline void setMass( float mass ) { this->mass = mass; };
     22  /** \returns the mass of the node. */
     23  inline float getMass( void ) const { return mass; };
     24  /** \returns the mass of this node plus all its children (only valid for PNodes). */
     25  inline float getTotalMass( void ) const { return mass + massChildren; };
     26
     27  virtual void applyForce( Vector force );                                      //!< Add a central force on this rigid body
     28  virtual void tickPhys( float dt );                                            //!< Update kinematics, reset force sum
    2729
    2830 protected:
    29   void recalcMass();            //!< Recalculate the mass of the children
    30   float mass;                           //!< Mass of this node
     31  void recalcMass();
     32
     33 
     34 private:
     35  float mass;                   //!< Mass of this object
    3136  float massChildren;           //!< Sum of the masses of the children nodes
    32   Vector forceSum;                      //!< Total central force for this tick
     37  Vector forceSum;              //!< Total central force for this tick
    3338  Quaternion momentumSum;       //!< Total momentum in this tick
    34 
    35  private:
    3639       
    3740
Note: See TracChangeset for help on using the changeset viewer.