PhyObject Class Reference

Public Member Functions | |
| PhyObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool cp=true) | |
| Create a physics object with no-collision-shape and insert it in the world passed. | |
| virtual | ~PhyObject () |
| Destroy this object. | |
| void | addForce (const wVector &force) |
| void | addImpulse (const wVector &pointDeltaVeloc, const wVector &pointPosit) |
| void | addTorque (const wVector &torque) |
| wVector | force () |
| bool | getKinematic () const |
| Returns true if the object has kinematic behaviour. | |
| bool | getStatic () const |
| Returns true if the object is static. | |
| wVector | inertiaVec () const |
| wVector | invInertiaVec () const |
| Return the inverse of Inertia. | |
| wVector | invMassInertiaVec () const |
| real | mass () |
| Return the mass. | |
| wVector | massInertiaVec () const |
| Return the Mass and momentum of Inertia. | |
| QString | material () const |
| wVector | omega () |
| void | reset () |
| reset the object: # set the velocity to zero # set the angural velocity to zero # set any residual forces and torques to zero # remove any pending collision | |
| void | setForce (const wVector &force) |
| void | setKinematic (bool b, bool c=false) |
| Changes between kinematic/dynamic behaviour for the object. | |
| void | setMass (real) |
| Set the mass without touching the Inertia data. | |
| void | setMassInertiaVec (const wVector &) |
| Set the Mass and momentum of Inertia: ( mass, Ixx, Iyy, Izz ) | |
| void | setMaterial (QString material) |
| void | setOmega (const wVector &omega) |
| void | setStatic (bool b) |
| Makes the object static or not. | |
| void | setTorque (const wVector &torque) |
| void | setVelocity (const wVector &velocity) |
| wVector | torque () |
| wVector | velocity () |
Protected Member Functions | |
| virtual void | changedMatrix () |
| syncronize this object with underlying physic object | |
| void | createPrivateObject () |
Protected Attributes | |
| PhyObjectPrivate * | priv |
| Engine encapsulation. | |
| WorldPrivate * | worldpriv |
Friends | |
| class | PhyCompoundObject |
| class | PhyJoint |
| class | PhyObjectPrivate |
| class | World |
| class | WorldPrivate |
Detailed Description
PhyObject class.
\
- Motivation
- The PhyObject represent a physical object.
- Description
- Warnings
- Warnings
Definition at line 46 of file phyobject.h.
Constructor & Destructor Documentation
| PhyObject | ( | World * | world, |
| QString | name = "unamed", |
||
| const wMatrix & | tm = wMatrix::identity(), |
||
| bool | cp = true |
||
| ) |
Create a physics object with no-collision-shape and insert it in the world passed.
- Parameters:
-
world The World which object will be inserted tm rotation and position at the moment of creation cp is for internal use; ignore it
Definition at line 26 of file phyobject.cpp.
References PhyObject::changedMatrix(), and PhyObject::priv.
| ~PhyObject | ( | ) | [virtual] |
Member Function Documentation
| void changedMatrix | ( | ) | [protected, virtual] |
syncronize this object with underlying physic object
Reimplemented from WObject.
Definition at line 143 of file phyobject.cpp.
References PhyObject::priv, and WObject::tm.
Referenced by PhyBox::PhyBox(), PhyCompoundObject::PhyCompoundObject(), PhyCone::PhyCone(), PhyCylinder::PhyCylinder(), PhyObject::PhyObject(), and PhySphere::PhySphere().
| bool getKinematic | ( | ) | const [inline] |
Returns true if the object has kinematic behaviour.
- Returns:
- true if the object has kinematic behaviour
Definition at line 72 of file phyobject.h.
Referenced by World::smartCheckContacts().
| bool getStatic | ( | ) | const [inline] |
Returns true if the object is static.
- Returns:
- true if the object is static
Definition at line 87 of file phyobject.h.
Referenced by World::smartCheckContacts().
| wVector invInertiaVec | ( | ) | const |
Return the inverse of Inertia.
Definition at line 199 of file phyobject.cpp.
| real mass | ( | ) |
Return the mass.
Definition at line 232 of file phyobject.cpp.
Referenced by PhyCompoundObject::createPrivateObject(), and PhyiCub::PhyiCub().
| wVector massInertiaVec | ( | ) | const |
Return the Mass and momentum of Inertia.
Definition at line 191 of file phyobject.cpp.
| void reset | ( | ) |
reset the object: # set the velocity to zero # set the angural velocity to zero # set any residual forces and torques to zero # remove any pending collision
Definition at line 118 of file phyobject.cpp.
References PhyObject::priv.
| void setKinematic | ( | bool | b, |
| bool | c = false |
||
| ) |
Changes between kinematic/dynamic behaviour for the object.
A kinematic object doesn't interact at all with other objects; it can only be moved directly setting its transformation matrix. By default the object is dynamic
- Parameters:
-
b if true the object is set to kinematic behaviour c if true the object collides with other objects even in kinematic mode, influencing them without being influenced (technically, we set its mass to 0 in Newton Game Dynamics engine)
Definition at line 55 of file phyobject.cpp.
References PhyObject::priv, and WObject::tm.
Referenced by PhyObjectsGroup::setKinematic().
| void setMass | ( | real | newmass | ) |
Set the mass without touching the Inertia data.
Definition at line 208 of file phyobject.cpp.
References PhyObject::priv.
Referenced by PhySphere::createPrivateObject(), PhyCylinder::createPrivateObject(), PhyCone::createPrivateObject(), PhyCompoundObject::createPrivateObject(), PhyBox::createPrivateObject(), PhyiCub::PhyiCub(), and PhyMarXbot::PhyMarXbot().
| void setMassInertiaVec | ( | const wVector & | mi | ) |
Set the Mass and momentum of Inertia: ( mass, Ixx, Iyy, Izz )
Definition at line 182 of file phyobject.cpp.
References PhyObject::priv.
| void setStatic | ( | bool | b | ) |
Makes the object static or not.
A static object is unaffected by external forces
- Parameters:
-
b if true the object is static
Definition at line 105 of file phyobject.cpp.
References PhyObject::priv.
Referenced by PhyObjectsGroup::setStatic().
Member Data Documentation
PhyObjectPrivate* priv [protected] |
Engine encapsulation.
Definition at line 147 of file phyobject.h.
Referenced by PhyObject::changedMatrix(), World::checkContacts(), World::closestPoints(), World::collisionRayCast(), PhySphere::createPrivateObject(), PhyCylinder::createPrivateObject(), PhyCone::createPrivateObject(), PhyCompoundObject::createPrivateObject(), PhyBox::createPrivateObject(), PhyJoint::PhyJoint(), PhyObject::PhyObject(), PhyObject::reset(), PhyObject::setKinematic(), PhyObject::setMass(), PhyObject::setMassInertiaVec(), PhyObject::setStatic(), and PhyObject::~PhyObject().
The documentation for this class was generated from the following files:
- worldsim/include/phyobject.h
- worldsim/src/phyobject.cpp