Changeset 4376 in orxonox.OLD for orxonox/trunk/src/lib/physics/physics_interface.h
- Timestamp:
- May 29, 2005, 12:30:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/physics/physics_interface.h
r4375 r4376 7 7 #define _PHYSICS_INTERFACE_H 8 8 9 #include " p_node.h"9 #include "vector.h" 10 10 11 11 //! A Physics interface … … 13 13 here can be some longer description of this class 14 14 */ 15 class PhysicsInterface : public PNode{15 class PhysicsInterface { 16 16 17 17 public: 18 18 PhysicsInterface(); 19 19 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 27 29 28 30 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 31 36 float massChildren; //!< Sum of the masses of the children nodes 32 Vector forceSum; 37 Vector forceSum; //!< Total central force for this tick 33 38 Quaternion momentumSum; //!< Total momentum in this tick 34 35 private:36 39 37 40
Note: See TracChangeset
for help on using the changeset viewer.