#include <Body.h>
Inheritance diagram for ani::Body:
Public Methods | |
Body () | |
Body (const Body &p) | |
virtual | ~Body () |
void | setParticle (bool val=false) |
Body & | operator= (const Body &p) |
virtual void | copy (const Body &p) |
this = p copies all attributes. More... | |
virtual void | computeDerivative (const Body ¤tState, const float ¤tTime) |
computeDerivative. More... | |
virtual void | normalize () |
const gmtl::Point3f & | position () const |
"phase space" (see note above). More... | |
const gmtl::Quatf & | rotation () const |
gmtl::Vec3f | linearVelocity () const |
Calculate v(t). More... | |
gmtl::Vec3f | angularVelocity (const gmtl::Matrix44f &ws_tensor_inv) const |
Calculate w(t) using given inertia tensor w(t) = I^-1(t) L(t). More... | |
gmtl::Vec3f | angularVelocity () const |
Calculate w(t), calcs the inertia tensor for you. More... | |
gmtl::Vec3f | linearMomentum () const |
gmtl::Vec3f | angularMomentum () const |
const gmtl::Vec3f & | accumulatedForce () const |
other things needed by ODE to compute changes in the "phase space". More... | |
const gmtl::Vec3f & | accumulatedTorque () const |
const float & | mass () const |
const gmtl::Vec3f & | volume () const |
PhaseSpaceOperations | |
virtual void | multiplyPhase (const Body &a, float h) |
scale by time. More... | |
virtual void | multiplyPhase (float h) |
scale by time. More... | |
virtual void | addPhase (const Body &a, const Body &b) |
phase space addition operator this = a + b. More... | |
virtual void | addPhase (const Body &a) |
phase space addition operator this += a. More... | |
State Setting Accumulation | |
void | setPosition (const gmtl::Point3f &position) |
void | setVelocity (const gmtl::Vec3f &velocity) |
void | setRotation (const gmtl::Quatf &rot) |
void | setAngularVelocity (gmtl::Vec3f &angularVel) |
set angular momentum with the given angular velocity calculate L(t), if w(t) is known... More... | |
void | applyForce (const gmtl::Vec3f &force) |
Apply a force to the particle Each call to applyForce adds a force vector and torque to the particle. More... | |
void | applyForce (const gmtl::Vec3f &force, const gmtl::Vec3f &location, const gmtl::Vec3f ¢er=gmtl::Vec3f(0.0f, 0.0f, 0.0f)) |
apply a force to a position on the body. More... | |
void | applyTorque (const gmtl::Vec3f &torque) |
Apply a torque to the particle torque is the axis of spin |torque| is the magnitude (i.e. More... | |
virtual void | zeroForce () |
void | setMass (const float &kilograms) |
set the mass units are metric kilograms. More... | |
void | setVolume (gmtl::Vec3f vol) |
Public Attributes | |
gmtl::Point3f | mPosition |
gmtl::Quatf | mRotation |
gmtl::Vec3f | mLinearMomentum |
gmtl::Vec3f | mAngularMomentum |
gmtl::Vec3f | mForceAccumulator |
gmtl::Vec3f | mTorqueAccumulator |
float | mMass |
float | mInvMass |
gmtl::Vec3f | mVolume |
gmtl::Matrix44f | mBodySpaceInertiaTensor |
gmtl::Matrix44f | mBodySpaceInertiaTensorInv |
float | mDragCoef |
bool | mParticle |
Body is able to do newtonian physics through application of force and torque.
Definition at line 102 of file Body.h.
|
Definition at line 105 of file Body.h. References mAngularMomentum, mBodySpaceInertiaTensor, mBodySpaceInertiaTensorInv, mForceAccumulator, mInvMass, mLinearMomentum, mMass, mParticle, mPosition, mRotation, mTorqueAccumulator, and mVolume. Referenced by gator::TravelMethod::TravelMethod(). |
|
Definition at line 123 of file Body.h. References copy(). |
|
|
|
Definition at line 132 of file Body.h. References mParticle. Referenced by ani::FireParticle::FireParticle(). |
|
Definition at line 137 of file Body.h. References copy(). |
|
this = p copies all attributes.
Definition at line 146 of file Body.h. References mAngularMomentum, mBodySpaceInertiaTensor, mBodySpaceInertiaTensorInv, mForceAccumulator, mInvMass, mLinearMomentum, mMass, mParticle, mPosition, mRotation, mTorqueAccumulator, and mVolume. |
|
computeDerivative. The behavior of the system is described by an "Ordinary Differential Equation" (ODE) of the form x' = f( x, t ) where f is a known function, x is the state of the system and x' is the time derivitive of x. Here, f = computeDerivative, x' = this, and x = currentState; This function computes change due to the force accumulator The x' returned assumes time=1, so for example using Euler's method to solve the next step, you will have to scale x' by the amount of time since this func was last called.
Definition at line 187 of file Body.h. References angularVelocity(), linearVelocity(), mAngularMomentum, mForceAccumulator, mLinearMomentum, mParticle, mPosition, mRotation, and mTorqueAccumulator. |
|
|
|
scale by time. this = a * h Definition at line 225 of file Body.h. References mAngularMomentum, mLinearMomentum, mParticle, mPosition, and mRotation. |
|
scale by time. this *= h Definition at line 240 of file Body.h. References mAngularMomentum, mLinearMomentum, mParticle, mPosition, and mRotation. |
|
phase space addition operator this = a + b.
Definition at line 255 of file Body.h. References mAngularMomentum, mLinearMomentum, mParticle, mPosition, and mRotation. |
|
phase space addition operator this += a.
Definition at line 270 of file Body.h. References mAngularMomentum, mLinearMomentum, mParticle, mPosition, and mRotation. |
|
Definition at line 287 of file Body.h. References mPosition, and position(). Referenced by gator::CollisionResponseOperator::exec(). |
|
Definition at line 288 of file Body.h. References mLinearMomentum, and mMass. |
|
Definition at line 289 of file Body.h. References mRotation. |
|
set angular momentum with the given angular velocity calculate L(t), if w(t) is known...
Definition at line 295 of file Body.h. References mAngularMomentum, mBodySpaceInertiaTensor, and mParticle. Referenced by gator::DriveNavigationOperator::exec(). |
|
Apply a force to the particle Each call to applyForce adds a force vector and torque to the particle. call update() to finally apply the accumulated forces which were added with this function. NOTE: the force applied should be with respect to 1.0 unit of time. Definition at line 308 of file Body.h. References mForceAccumulator. Referenced by applyForce(), gator::TireForceOperator::exec(), gator::DriveNavigationOperator::exec(), gator::CollisionResponseOperator::exec(), and gator::Acceleration::exec(). |
|
apply a force to a position on the body. this results in a rotation (torque) Definition at line 316 of file Body.h. References applyForce(), mParticle, and mTorqueAccumulator. |
|
Apply a torque to the particle torque is the axis of spin |torque| is the magnitude (i.e. don't normalize this vec!) Definition at line 331 of file Body.h. References mParticle, and mTorqueAccumulator. |
|
Definition at line 339 of file Body.h. References mForceAccumulator, and mTorqueAccumulator. |
|
set the mass units are metric kilograms.
|
|
|
|
"phase space" (see note above).
Definition at line 373 of file Body.h. References mPosition. Referenced by gator::PlaneCollisionDetector::exec(), gator::CollisionResponseOperator::exec(), ani::getWorldBox(), ani::matrix(), and setPosition(). |
|
Definition at line 374 of file Body.h. References mRotation. Referenced by gator::TireForceOperator::exec(), gator::DriveNavigationOperator::exec(), ani::getLocalBox(), and ani::matrix(). |
|
Calculate v(t).
Definition at line 377 of file Body.h. References mInvMass, and mLinearMomentum. Referenced by computeDerivative(), gator::TireForceOperator::exec(), gator::PlaneCollisionDetector::exec(), gator::DriveNavigationOperator::exec(), and gator::CollisionResponseOperator::exec(). |
|
Calculate w(t) using given inertia tensor w(t) = I^-1(t) L(t).
Definition at line 386 of file Body.h. References mAngularMomentum, and mParticle. Referenced by computeDerivative(). |
|
Calculate w(t), calcs the inertia tensor for you. w(t) = I^-1(t) L(t) Definition at line 397 of file Body.h. References mParticle. |
|
Definition at line 405 of file Body.h. References mLinearMomentum. |
|
Definition at line 410 of file Body.h. References mAngularMomentum. |
|
other things needed by ODE to compute changes in the "phase space".
Definition at line 416 of file Body.h. References mForceAccumulator. |
|
Definition at line 417 of file Body.h. References mTorqueAccumulator. |
|
Definition at line 418 of file Body.h. References mMass. Referenced by gator::TireForceOperator::exec(), gator::DriveNavigationOperator::exec(), gator::CollisionResponseOperator::exec(), and gator::Acceleration::exec(). |
|
Definition at line 419 of file Body.h. References mVolume. Referenced by gator::PlaneCollisionDetector::exec(), and ani::getLocalBox(). |
|
Definition at line 424 of file Body.h. Referenced by addPhase(), Body(), computeDerivative(), copy(), multiplyPhase(), position(), and setPosition(). |
|
Definition at line 425 of file Body.h. Referenced by addPhase(), Body(), computeDerivative(), copy(), multiplyPhase(), normalize(), rotation(), and setRotation(). |
|
Definition at line 426 of file Body.h. Referenced by addPhase(), Body(), computeDerivative(), copy(), linearMomentum(), linearVelocity(), multiplyPhase(), and setVelocity(). |
|
Definition at line 428 of file Body.h. Referenced by addPhase(), angularMomentum(), angularVelocity(), Body(), computeDerivative(), copy(), multiplyPhase(), and setAngularVelocity(). |
|
Definition at line 447 of file Body.h. Referenced by accumulatedForce(), applyForce(), Body(), computeDerivative(), copy(), and zeroForce(). |
|
Definition at line 448 of file Body.h. Referenced by accumulatedTorque(), applyForce(), applyTorque(), Body(), computeDerivative(), copy(), and zeroForce(). |
|
Definition at line 451 of file Body.h. Referenced by Body(), copy(), mass(), setMass(), and setVelocity(). |
|
Definition at line 451 of file Body.h. Referenced by Body(), copy(), linearVelocity(), and setMass(). |
|
|
|
Definition at line 460 of file Body.h. Referenced by Body(), copy(), and setAngularVelocity(). |
|
|
|
|
|
Definition at line 464 of file Body.h. Referenced by addPhase(), angularVelocity(), applyForce(), applyTorque(), Body(), computeDerivative(), copy(), multiplyPhase(), normalize(), setAngularVelocity(), setMass(), setParticle(), and setVolume(). |