#include <physical.h>

Public Member Functions | |
| Physical (const std::string &name="Physical") | |
| Physical (TransformableNode &node, const std::string &name="Physical") | |
| Overloaded constructor will use the supplied node instead of creating one internally. | |
| void | SetBodyID (dBodyID bodyID) |
| Sets the ODE body identifier associated with this object. | |
| dBodyID | GetBodyID () const |
| Returns the ODE body identifier associated with this object. | |
| void | EnableDynamics (bool enable=true) |
| Enables or disables dynamics for this object. | |
| bool | DynamicsEnabled () const |
| Checks whether or not dynamics are enabled for this object. | |
| void | SetMass (const dMass *mass) |
| Sets the ODE mass parameters of this object. | |
| void | GetMass (dMass *mass) const |
| Retrieves the ODE mass parameters of this object. | |
| void | SetMass (float mass) |
| Sets the mass of this object. | |
| float | GetMass () const |
| Returns the mass of this object. | |
| void | SetCenterOfGravity (const osg::Vec3 ¢erOfGravity) |
| Sets this object's center of gravity. | |
| void | GetCenterOfGravity (osg::Vec3 &dest) const |
| Retrieves this object's center of gravity. | |
| void | SetInertiaTensor (const osg::Matrix &inertiaTensor) |
| Sets this object's inertia tensor. | |
| void | GetInertiaTensor (osg::Matrix &mat) const |
| Retrieves this object's inertia tensor. | |
| virtual void | PostPhysicsStepUpdate () |
| Updates the state of this object just after a physical simulation step. | |
| virtual bool | FilterContact (dContact *contact, Transformable *collider) |
| Modifies or cancels the specified contact joint definition according to the relationship between this object and the specified collider. | |
Protected Member Functions | |
| virtual | ~Physical () |
Typical use would involve supplying the shape to use for the collision detection and the mass of the body. A Physical instance is not enabled by default and must be enabled by calling EnableDynamics().
Since a Physical is derived from DeltaDrawable, it already has a geometry node associated with it. As such, a collision geometry can be assigned to this body by either supplying the shape properties, or by passing a NULL into the SetCollision*() methods.
| Physical::Physical | ( | const std::string & | name = "Physical" |
) |
| Physical::Physical | ( | TransformableNode & | node, | |
| const std::string & | name = "Physical" | |||
| ) |
Overloaded constructor will use the supplied node instead of creating one internally.
| node | : A node this class should use internally | |
| name | : The name of this instance |
| Physical::~Physical | ( | ) | [protected, virtual] |
| void Physical::SetBodyID | ( | dBodyID | bodyID | ) |
Sets the ODE body identifier associated with this object.
Should only be called by dtCore::Scene. If you call this outside the content of Scene be warning that any transformations you have on bodyID will be removed.
| bodyID | the new body identifier |
| bodyID | the new body identifier |
| dBodyID Physical::GetBodyID | ( | ) | const |
Returns the ODE body identifier associated with this object.
| void Physical::EnableDynamics | ( | bool | enable = true |
) |
Enables or disables dynamics for this object.
| enable | true to enable dynamics, false to disable |
| bool Physical::DynamicsEnabled | ( | ) | const |
Checks whether or not dynamics are enabled for this object.
| void Physical::SetMass | ( | const dMass * | mass | ) |
Sets the ODE mass parameters of this object.
| mass | a pointer to the mass structure to copy |
| void Physical::GetMass | ( | dMass * | mass | ) | const |
Retrieves the ODE mass parameters of this object.
| mass | a pointer to the mass structure to fill |
| void Physical::SetMass | ( | float | mass | ) |
Sets the mass of this object.
| mass | the new mass, in kilograms |
| float Physical::GetMass | ( | ) | const |
Returns the mass of this object.
| void Physical::SetCenterOfGravity | ( | const osg::Vec3 & | centerOfGravity | ) |
Sets this object's center of gravity.
| centerOfGravity | the new center of gravity |
| void Physical::GetCenterOfGravity | ( | osg::Vec3 & | dest | ) | const |
Retrieves this object's center of gravity.
| dest | the vector in which to place the center of gravity |
| void Physical::SetInertiaTensor | ( | const osg::Matrix & | inertiaTensor | ) |
Sets this object's inertia tensor.
| inertiaTensor | the new inertia tensor, uses only the rotation part of the transform matrix | |
| inertiaTensor | the new inertia tensor, only uses the rotation part of the transform matrix |
| void Physical::GetInertiaTensor | ( | osg::Matrix & | dest | ) | const |
Retrieves this object's inertia tensor.
| dest | the matrix in which to place the inertia tensor, uses only rotation part of the transform matrix |
| void Physical::PostPhysicsStepUpdate | ( | ) | [virtual] |
Updates the state of this object just after a physical simulation step.
Should only be called by dtCore::Scene. The default implementation copies the new object position into the user-accessible transformation.
Reimplemented from dtCore::Transformable.
| virtual bool dtCore::Physical::FilterContact | ( | dContact * | contact, | |
| Transformable * | collider | |||
| ) | [inline, virtual] |
Modifies or cancels the specified contact joint definition according to the relationship between this object and the specified collider.
Should only be called by dtCore::Scene.
| contact | the joint definition to modify | |
| collider | the object with which this is colliding |
Reimplemented from dtCore::Transformable.