#include <ODESolid.h>
Inheritance diagram for opal::ODESolid:
Public Member Functions | |
ODESolid (dWorldID worldID, dSpaceID spaceID) | |
virtual | ~ODESolid () |
virtual void OPAL_CALL | init (const SolidData &data) |
virtual void OPAL_CALL | setEnabled (bool e) |
virtual void OPAL_CALL | setSleeping (bool sleeping) |
virtual void OPAL_CALL | setSpace (Space *newSpace) |
virtual bool OPAL_CALL | isSleeping () const |
virtual void OPAL_CALL | setSleepiness (real s) |
virtual void OPAL_CALL | setStatic (bool s) |
virtual void OPAL_CALL | clearShapes () |
virtual void OPAL_CALL | addShape (ShapeData &data) |
virtual void OPAL_CALL | setLocalLinearVel (const Vec3r &vel) |
virtual Vec3r OPAL_CALL | getLocalLinearVel () const |
virtual Vec3r OPAL_CALL | getLocalLinearVelAtLocalPos (const Point3r &p) const |
virtual void OPAL_CALL | setLocalAngularVel (const Vec3r &vel) |
virtual Vec3r OPAL_CALL | getLocalAngularVel () const |
virtual void OPAL_CALL | setGlobalLinearVel (const Vec3r &vel) |
virtual Vec3r OPAL_CALL | getGlobalLinearVel () const |
virtual Vec3r OPAL_CALL | getGlobalLinearVelAtLocalPos (const Point3r &p) const |
virtual void OPAL_CALL | setGlobalAngularVel (const Vec3r &vel) |
virtual Vec3r OPAL_CALL | getGlobalAngularVel () const |
virtual void OPAL_CALL | setMass (const Mass &newmass, const Matrix44r &offset) |
virtual void OPAL_CALL | translateMass (const Vec3r &offset) |
virtual void OPAL_CALL | zeroForces () |
virtual real OPAL_CALL | getMass () const |
virtual Matrix44r OPAL_CALL | getInertiaTensor () const |
virtual void OPAL_CALL | internal_updateOPALTransform () |
virtual void OPAL_CALL | internal_updateEngineTransform () |
dBodyID OPAL_CALL | internal_getBodyID () const |
void OPAL_CALL | internal_setCollisionCount (long int count) |
long int OPAL_CALL | internal_getCollisionCount () const |
const std::vector< GeomData * > *OPAL_CALL | internal_getGeomDataList () const |
void OPAL_CALL | internal_doAngularVelFix () |
void OPAL_CALL | internal_setFreelySpinning (bool fs) |
Protected Member Functions | |
void | setupNewGeom (GeomData *newGeom) |
void | destroyGeoms () |
void | moveToSpace () |
virtual void | applyForce (const Force &f) |
void | addMass (dMass &newMass, const Matrix44r &offset) |
void | setMass (dMass &newMass, const Matrix44r &offset) |
bool | isInertiaNonSymmetric (const dMass &mass) const |
Protected Attributes | |
dBodyID | mBodyID |
dWorldID | mWorldID |
dSpaceID | mSpaceID |
std::vector< GeomData * > | mGeomDataList |
long int | mCollisionCount |
bool | mIsPlaceable |
bool | mNonSymmetricInertia |
bool | mIsFreelySpinning |
real | mPrevAngVelMagSquared |
Definition at line 62 of file ODESolid.h.
|
Definition at line 43 of file ODESolid.cpp. References init(), opal::SolidData::isStatic, mBodyID, mCollisionCount, opal::Solid::mData, mIsFreelySpinning, mIsPlaceable, mNonSymmetricInertia, mPrevAngVelMagSquared, mSpaceID, and mWorldID. |
|
Definition at line 66 of file ODESolid.cpp. References destroyGeoms(), opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. |
|
Adds the given mass to this Solid's existing mass. The offset is relative to the Solid's center. This must be called before setupNewGeom is called. Definition at line 1083 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and mGeomDataList. Referenced by setStatic(). |
|
Adds a Shape to this Solid. Updates the Solid's axis-aligned bounding box. Implements opal::Solid. Definition at line 513 of file ODESolid.cpp. References opal::BOX_SHAPE, opal::Material::density, opal::ShapeData::getType(), opal::ShapeData::material, mSpaceID, and opal::ShapeData::offset. Referenced by init(). |
|
Physics engine-specific function for applying Forces to Solids. Implements opal::Solid. Definition at line 1009 of file ODESolid.cpp. References opal::GLOBAL_FORCE, opal::GLOBAL_FORCE_AT_GLOBAL_POS, opal::GLOBAL_FORCE_AT_LOCAL_POS, opal::GLOBAL_TORQUE, internal_setFreelySpinning(), opal::LOCAL_FORCE, opal::LOCAL_FORCE_AT_GLOBAL_POS, opal::LOCAL_FORCE_AT_LOCAL_POS, opal::LOCAL_TORQUE, mBodyID, opal::Force::pos, opal::Force::type, and opal::Force::vec. |
|
Removes all shapes from this Solid. Resets the Solid's axis-aligned bounding box. Implements opal::Solid. Definition at line 78 of file ODESolid.cpp. References destroyGeoms(), opal::SolidData::destroyShapes(), opal::Solid::mData, and opal::Solid::resetAABB(). |
|
Destroys all of this Solid's ODE geoms.
Definition at line 85 of file ODESolid.cpp. References mGeomDataList. Referenced by clearShapes(), init(), and ~ODESolid(). |
|
Returns the Solid's angular velocity in global coordinates.
Implements opal::Solid. Definition at line 834 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r_RadToDeg(). Referenced by internal_doAngularVelFix(). |
|
Returns the Solid's linear velocity in global coordinates.
Implements opal::Solid. Definition at line 794 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r(). |
|
Given an offset point relative to the Solid's local origin, returns the linear velocity of the point in global coordinates. Implements opal::Solid. Definition at line 807 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r(). |
|
Returns the Solid's inertia tensor as a 4x4 matrix. This will be the identity matrix if the Solid is static. Implements opal::Solid. Definition at line 930 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::Matrix44r::set(). |
|
Returns the Solid's angular velocity in local coordinates.
Implements opal::Solid. Definition at line 766 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r_RadToDeg(). |
|
Returns the Solid's linear velocity in local coordinates.
Implements opal::Solid. Definition at line 716 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r(). |
|
Given an offset point relative to the Solid's local origin, returns the linear velocity of the point in local coordinates. Implements opal::Solid. Definition at line 733 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r(). |
|
Returns the Solid's mass. This will return 0 if the Solid is static. Implements opal::Solid. Definition at line 916 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. |
|
Initializes the Solid with the given data structure. Calling this more than once will automatically destroy all the old Shapes before adding new ones. Implements opal::Solid. Definition at line 111 of file ODESolid.cpp. References addShape(), destroyGeoms(), opal::SolidData::destroyShapes(), opal::SolidData::getNumShapes(), opal::SolidData::getShapeData(), opal::SolidData::isStatic, opal::Solid::mData, setStatic(), opal::Solid::setTransform(), and opal::SolidData::transform. Referenced by ODESolid(). |
|
Fix angular velocities for freely-spinning bodies that have gained angular velocity through explicit integrator inaccuracy. This usually only happens for long, thin objects. Definition at line 1149 of file ODESolid.cpp. References getGlobalAngularVel(), internal_setFreelySpinning(), opal::Vec3r::lengthSquared(), mIsFreelySpinning, mNonSymmetricInertia, mPrevAngVelMagSquared, and setGlobalAngularVel(). |
|
Returns the ODE body ID of this ODESolid.
Definition at line 847 of file ODESolid.cpp. References mBodyID. |
|
Used internally by volume collision checking.
Definition at line 857 of file ODESolid.cpp. References mCollisionCount. Referenced by opal::ODESimulator::internal_addCollidedSolid(). |
|
Returns all geom data objects in this ODESolid.
Definition at line 1144 of file ODESolid.cpp. References mGeomDataList. |
|
Used internally by volume collision checking.
Definition at line 852 of file ODESolid.cpp. References mCollisionCount. Referenced by opal::ODESimulator::internal_addCollidedSolid(). |
|
Sets whether this object is freely-spinning (i.e. no recent physical contacts, no user-generated forces, no user-defined velocity changes). Definition at line 1182 of file ODESolid.cpp. References mIsFreelySpinning. Referenced by applyForce(), internal_doAngularVelFix(), setGlobalAngularVel(), setGlobalLinearVel(), setLocalAngularVel(), and setLocalLinearVel(). |
|
Update the physics engine transform using the OPAL transform.
Implements opal::Solid. Definition at line 201 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, mGeomDataList, mIsPlaceable, and opal::SolidData::transform. |
|
Update the OPAL transform using the physics engine transform.
Implements opal::Solid. Definition at line 190 of file ODESolid.cpp. References mBodyID, opal::Solid::mData, opal::Matrix44r::set(), and opal::SolidData::transform. |
|
Returns true if the given mass has a non-symmetric inertia tensor.
Definition at line 1187 of file ODESolid.cpp. References opal::areEqual(). Referenced by setMass(), and translateMass(). |
|
Returns true if the Solid is sleeping. If the Solid is static, this will always return true. Implements opal::Solid. Definition at line 430 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. |
|
move to geometry to current space
Definition at line 385 of file ODESolid.cpp. References mGeomDataList, and mSpaceID. Referenced by setSpace(). |
|
Sets whether the Solid can collide with other Solids and be physically simulated. Forces applied to this Solid while disabled will be ignored. Reimplemented from opal::Solid. Definition at line 154 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and mGeomDataList. |
|
Sets the Solid's angular velocity in global coordinates.
Implements opal::Solid. Definition at line 822 of file ODESolid.cpp. References opal::degToRad(), internal_setFreelySpinning(), opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. Referenced by internal_doAngularVelFix(). |
|
Sets the Solid's linear velocity in global coordinates.
Implements opal::Solid. Definition at line 783 of file ODESolid.cpp. References internal_setFreelySpinning(), opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. |
|
Sets the Solid's angular velocity in local coordinates.
Implements opal::Solid. Definition at line 752 of file ODESolid.cpp. References internal_setFreelySpinning(), opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::toVec3r_DegToRad(). |
|
Sets the Solid's linear velocity in local coordinates.
Implements opal::Solid. Definition at line 703 of file ODESolid.cpp. References internal_setFreelySpinning(), opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. |
|
Sets the given mass ignoring previous settings.
Definition at line 1121 of file ODESolid.cpp. References isInertiaNonSymmetric(), opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and mNonSymmetricInertia. |
|
Set a new mass, center, and intertia for the solid.
Implements opal::Solid. Definition at line 1047 of file ODESolid.cpp. References opal::Mass::center, opal::Mass::inertia, isInertiaNonSymmetric(), opal::SolidData::isStatic, opal::Mass::mass, mBodyID, opal::Solid::mData, mNonSymmetricInertia, opal::Vec3r::x, opal::Vec3r::y, and opal::Vec3r::z. Referenced by setStatic(). |
|
If this Solid has no ODE body, just return. The sleepiness level will still be saved and applied if this Solid ever becomes dynamic. Reimplemented from opal::Solid. Definition at line 449 of file ODESolid.cpp. References opal::defaults::ode::autoDisableAngularMax, opal::defaults::ode::autoDisableAngularMin, opal::defaults::ode::autoDisableLinearMax, opal::defaults::ode::autoDisableLinearMin, opal::defaults::ode::autoDisableStepsMax, opal::defaults::ode::autoDisableStepsMin, opal::defaults::ode::autoDisableTimeMax, opal::defaults::ode::autoDisableTimeMin, opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::Solid::setSleepiness(). Referenced by setStatic(). |
|
Sets whether the Solid is sleeping (i.e. set this to false to wake up a sleeping Solid). Implements opal::Solid. Definition at line 411 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, and opal::Solid::mData. |
|
Removes the Solid from its current Space and adds it to the new Space. Implements opal::Solid. Definition at line 240 of file ODESolid.cpp. References moveToSpace(), and mSpaceID. |
|
Sets whether the Solid should be static or dynamic.
Implements opal::Solid. Definition at line 248 of file ODESolid.cpp. References addMass(), opal::BOX_SHAPE, opal::CAPSULE_SHAPE, opal::Material::density, opal::ShapeData::getType(), opal::SolidData::isStatic, opal::CapsuleShapeData::length, opal::ShapeData::material, mBodyID, opal::Solid::mData, opal::MESH_SHAPE, mGeomDataList, mWorldID, opal::PLANE_SHAPE, opal::CapsuleShapeData::radius, opal::SphereShapeData::radius, setMass(), setSleepiness(), opal::SolidData::sleepiness, opal::SPHERE_SHAPE, and opal::SolidData::transform. Referenced by init(). |
|
Adds a new GeomData object to the internal list and sets up the ODE geom. Definition at line 952 of file ODESolid.cpp. References opal::GeomData::geomID, opal::SolidData::isStatic, mBodyID, opal::Solid::mData, mGeomDataList, mIsPlaceable, opal::ShapeData::offset, opal::Solid::setTransform(), opal::GeomData::shape, opal::SolidData::transform, and opal::GeomData::transformID. |
|
Translate the Solid's mass using the given offset vector specified in global coordinates. Implements opal::Solid. Definition at line 499 of file ODESolid.cpp. References isInertiaNonSymmetric(), opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and mNonSymmetricInertia. |
|
Removes all forces and torques currently affecting this Solid.
Implements opal::Solid. Definition at line 902 of file ODESolid.cpp. References opal::SolidData::isStatic, mBodyID, opal::Solid::mData, and opal::Solid::mForceList. |
|
|
Used internally by volume collision checking.
Definition at line 191 of file ODESolid.h. Referenced by internal_getCollisionCount(), internal_setCollisionCount(), and ODESolid(). |
|
An internal list of this ODESolid's geom data objects.
Definition at line 188 of file ODESolid.h. Referenced by addMass(), destroyGeoms(), internal_getGeomDataList(), internal_updateEngineTransform(), moveToSpace(), setEnabled(), setStatic(), and setupNewGeom(). |
|
Used to improve ODE's angular velocity calculations for objects with non-symmetric inertia tensors. Definition at line 202 of file ODESolid.h. Referenced by internal_doAngularVelFix(), internal_setFreelySpinning(), and ODESolid(). |
|
True if this ODESolid is "placeable." This is false only for Solids containing planes Shapes. Definition at line 195 of file ODESolid.h. Referenced by internal_updateEngineTransform(), ODESolid(), and setupNewGeom(). |
|
True if the ODESolid has a non-symmetric inertia tensor.
Definition at line 198 of file ODESolid.h. Referenced by internal_doAngularVelFix(), ODESolid(), setMass(), and translateMass(). |
|
Used to improve ODE's angular velocity calculations for objects with non-symmetric inertia tensors. Definition at line 206 of file ODESolid.h. Referenced by internal_doAngularVelFix(), and ODESolid(). |
|
The ODE space ID that contains this ODESolid's geoms.
Definition at line 185 of file ODESolid.h. Referenced by addShape(), moveToSpace(), ODESolid(), and setSpace(). |
|
The ODE world ID that contains this ODESolid's ODE body, if this Solid is dynamic. Definition at line 182 of file ODESolid.h. Referenced by ODESolid(), and setStatic(). |