#include <body.h>
Inheritance diagram for oxygen::Body:
Public Member Functions | |
Body () | |
virtual | ~Body () |
dBodyID | GetODEBody () const |
returns the ID of the mangaged ODE body | |
void | Enable () |
enables this body. | |
void | Disable () |
disables this body | |
bool | IsEnabled () const |
returns true if this body is enabled | |
void | UseGravity (bool f) |
sets whether the body is influenced by the world's gravity or not. | |
bool | UsesGravity () const |
returns true, if this body is influenced by the world's gravity | |
void | SetMass (float mass) |
sets the mass of this body | |
void | SetMassParameters (const dMass &mass) |
set the ODE mass parameters of this body | |
float | GetMass () const |
returns the mass of this body | |
void | GetMassParameters (dMass &mass) const |
returns the ODE mass parameters of this body | |
void | SetSphere (float density, float radius) |
sets the mass parameters to represent a sphere of the given radius and density, with the center of mass at (0,0,0) relative to the body. | |
void | SetSphereTotal (float total_mass, float radius) |
sets the mass parameters to represent a sphere of the given radius and total mass, with the center of mass at (0,0,0) relative to the body. | |
void | SetBox (float density, const salt::Vector3f &size) |
Set the mass parameters to represent a box of the given dimensions and density, with the center of mass at (0,0,0) relative to the body. | |
void | SetBoxTotal (float total_mass, const salt::Vector3f &size) |
Set the mass parameters to represent a box of the given dimensions and total mass, with the center of mass at (0,0,0) relative to the body. | |
void | SetCylinder (float density, float radius, float length) |
Set the mass parameters to represent a flat-ended cylinder of the given parameters and density, with the center of mass at (0,0,0) relative to the body. | |
void | SetCylinderTotal (float total_mass, float radius, float length) |
Set the mass parameters to represent a flat-ended cylinder of the given parameters and total mass, with the center of mass at (0,0,0) relative to the body. | |
void | SetCappedCylinder (float density, float radius, float length) |
void | SetCappedCylinderTotal (float total_mass, float radius, float length) |
salt::Vector3f | GetVelocity () const |
returns the current linear velocity vector of this body | |
void | SetVelocity (const salt::Vector3f &vel) |
sets the current linear velocity of this body | |
void | SetRotation (const salt::Matrix &rot) |
sets the roation of this body | |
salt::Vector3f | GetAngularVelocity () const |
returns the current angular velocity of this body | |
void | SetAngularVelocity (const salt::Vector3f &vel) |
sets the current angular velocity of this body | |
void | AddForce (const salt::Vector3f &force) |
applies a force to the managed ODE body | |
void | AddTorque (const salt::Vector3f &torque) |
aplies a force to the managed ODE body | |
void | SetPosition (const salt::Vector3f &pos) |
sets the position of the managed ODE body | |
salt::Vector3f | GetPosition () const |
returns the current poosition of this body | |
Static Public Member Functions | |
static boost::shared_ptr< Body > | GetBody (dBodyID id) |
returns the Body node corresponding to the given ODE body | |
Protected Member Functions | |
virtual void | OnLink () |
creates the managed ODE body and moves it to the position of it's scene-graph parent | |
bool | CreateBody () |
create the managed ODE body; returns true on success | |
Protected Attributes | |
dBodyID | mODEBody |
the managed ode body | |
Private Member Functions | |
virtual void | PostPhysicsUpdateInternal () |
updates the the internal state after physics calculation, i.e. |
A rigid body has various properties from the point of view of the simulation. Some properties change over time: position, linear velocity, orientation and angular velocity. Other body properties are usually constant over time: Mass, Center of mass and Inertia matrix (mass distribution matrix)
Definition at line 38 of file body.h.
|
|
|
Definition at line 35 of file body.cpp. References mODEBody. |
|
applies a force to the managed ODE body
Definition at line 323 of file body.cpp. References mODEBody, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Here is the call graph for this function: ![]() |
|
aplies a force to the managed ODE body
Definition at line 329 of file body.cpp. References mODEBody, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Here is the call graph for this function: ![]() |
|
create the managed ODE body; returns true on success
Definition at line 83 of file body.cpp. References zeitgeist::Object::GetLog(), oxygen::ODEObject::GetWorldID(), and mODEBody. Referenced by OnLink(). Here is the call graph for this function: ![]() |
|
disables this body
Definition at line 54 of file body.cpp. References mODEBody. |
|
enables this body. Each body can be enabled or disabled. Disabled bodies are effectively turned off and are not updated during a simulation step. Disabling bodies is an effective way to save computation time when it is known that the bodies are motionless or otherwise irrelevent to the simulation. Definition at line 49 of file body.cpp. References mODEBody. |
|
returns the current angular velocity of this body
Definition at line 248 of file body.cpp. References mODEBody. |
|
returns the Body node corresponding to the given ODE body
Definition at line 291 of file body.cpp. References zeitgeist::Object::GetSelf(). Referenced by oxygen::Joint::GetBody(). Here is the call graph for this function: ![]() |
|
returns the mass of this body
Definition at line 138 of file body.cpp. References mODEBody. |
|
returns the ODE mass parameters of this body
Definition at line 145 of file body.cpp. References mODEBody. |
|
returns the ID of the mangaged ODE body
Definition at line 44 of file body.cpp. References mODEBody. |
|
returns the current poosition of this body
Definition at line 342 of file body.cpp. References mODEBody. |
|
returns the current linear velocity vector of this body
Definition at line 228 of file body.cpp. References mODEBody. |
|
returns true if this body is enabled
Definition at line 59 of file body.cpp. References mODEBody. |
|
creates the managed ODE body and moves it to the position of it's scene-graph parent
Reimplemented from zeitgeist::Leaf. Definition at line 108 of file body.cpp. References CreateBody(), zeitgeist::Leaf::GetParent(), mODEBody, zeitgeist::Leaf::OnLink(), salt::Matrix::Pos(), SetPosition(), and SetRotation(). Here is the call graph for this function: ![]() |
|
updates the the internal state after physics calculation, i.e. synchronises this scene graph node and the corresponding ODE body. Reimplemented from oxygen::BaseNode. Definition at line 260 of file body.cpp. References zeitgeist::Leaf::GetParent(), salt::Matrix::m, and mODEBody. Here is the call graph for this function: ![]() |
|
sets the current angular velocity of this body
Definition at line 255 of file body.cpp. References mODEBody. |
|
Set the mass parameters to represent a box of the given dimensions and density, with the center of mass at (0,0,0) relative to the body.
Definition at line 169 of file body.cpp. References mODEBody. |
|
Set the mass parameters to represent a box of the given dimensions and total mass, with the center of mass at (0,0,0) relative to the body.
Definition at line 176 of file body.cpp. References mODEBody. |
|
Definition at line 205 of file body.cpp. References mODEBody. |
|
Definition at line 216 of file body.cpp. References mODEBody. |
|
Set the mass parameters to represent a flat-ended cylinder of the given parameters and density, with the center of mass at (0,0,0) relative to the body. The radius of the cylinder is radius. The length of the cylinder is length. The cylinder's long axis is oriented along the body's z axis. Definition at line 183 of file body.cpp. References mODEBody. |
|
Set the mass parameters to represent a flat-ended cylinder of the given parameters and total mass, with the center of mass at (0,0,0) relative to the body. The radius of the cylinder is radius. The length of the cylinder is length. The cylinder's long axis is oriented along the body's z axis. Definition at line 194 of file body.cpp. References mODEBody. |
|
sets the mass of this body
Definition at line 129 of file body.cpp. References mODEBody. |
|
set the ODE mass parameters of this body
Definition at line 150 of file body.cpp. References mODEBody. |
|
sets the position of the managed ODE body
Definition at line 335 of file body.cpp. References mODEBody, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Referenced by OnLink(). Here is the call graph for this function: ![]() |
|
sets the roation of this body
Definition at line 240 of file body.cpp. References oxygen::ODEObject::ConvertRotationMatrix(), and mODEBody. Referenced by OnLink(). Here is the call graph for this function: ![]() |
|
sets the mass parameters to represent a sphere of the given radius and density, with the center of mass at (0,0,0) relative to the body.
Definition at line 155 of file body.cpp. References mODEBody. |
|
sets the mass parameters to represent a sphere of the given radius and total mass, with the center of mass at (0,0,0) relative to the body.
Definition at line 162 of file body.cpp. References mODEBody. |
|
sets the current linear velocity of this body
Definition at line 234 of file body.cpp. References mODEBody. |
|
sets whether the body is influenced by the world's gravity or not. Bodies are constructed to be influenced by the world's gravity by default. Definition at line 64 of file body.cpp. References mODEBody. |
|
returns true, if this body is influenced by the world's gravity
Definition at line 78 of file body.cpp. References mODEBody. |
|
the managed ode body
Definition at line 196 of file body.h. Referenced by AddForce(), AddTorque(), CreateBody(), Disable(), Enable(), GetAngularVelocity(), GetMass(), GetMassParameters(), GetODEBody(), GetPosition(), GetVelocity(), IsEnabled(), OnLink(), PostPhysicsUpdateInternal(), SetAngularVelocity(), SetBox(), SetBoxTotal(), SetCappedCylinder(), SetCappedCylinderTotal(), SetCylinder(), SetCylinderTotal(), SetMass(), SetMassParameters(), SetPosition(), SetRotation(), SetSphere(), SetSphereTotal(), SetVelocity(), UseGravity(), UsesGravity(), and ~Body(). |