#include <Solid.h>
Inheritance diagram for opal::Solid:
Public Member Functions | |
Solid () | |
virtual void OPAL_CALL | init (const SolidData &data)=0 |
virtual const SolidData &OPAL_CALL | getData () |
virtual void OPAL_CALL | setName (const std::string &name) |
virtual const std::string &OPAL_CALL | getName () const |
virtual bool OPAL_CALL | isEnabled () const |
virtual void OPAL_CALL | setEnabled (bool e) |
virtual bool OPAL_CALL | isStatic () const |
virtual void OPAL_CALL | setStatic (bool s)=0 |
virtual void OPAL_CALL | setSpace (Space *newSpace)=0 |
virtual void OPAL_CALL | setSleeping (bool sleeping)=0 |
virtual bool OPAL_CALL | isSleeping () const =0 |
virtual void OPAL_CALL | setSleepiness (real s) |
virtual real OPAL_CALL | getSleepiness () const |
virtual void OPAL_CALL | setLinearDamping (real ld) |
virtual real OPAL_CALL | getLinearDamping () const |
virtual void OPAL_CALL | setAngularDamping (real ad) |
virtual real OPAL_CALL | getAngularDamping () const |
virtual void OPAL_CALL | setUserData (void *data) |
virtual void *OPAL_CALL | getUserData () const |
virtual void OPAL_CALL | setTransform (const Matrix44r &t) |
virtual const Matrix44r &OPAL_CALL | getTransform () const |
virtual void OPAL_CALL | setPosition (real x, real y, real z) |
virtual void OPAL_CALL | setPosition (const Point3r &p) |
virtual Point3r OPAL_CALL | getPosition () const |
virtual Vec3r OPAL_CALL | getEulerXYZ () const |
virtual Quaternion OPAL_CALL | getQuaternion () const |
virtual void OPAL_CALL | setQuaternion (const Quaternion &q) |
virtual void OPAL_CALL | setQuaternion (real w, real x, real y, real z) |
virtual void OPAL_CALL | getLocalAABB (real aabb[6]) const |
virtual void OPAL_CALL | getGlobalAABB (real aabb[6]) const |
virtual void OPAL_CALL | clearShapes ()=0 |
virtual void OPAL_CALL | addShape (ShapeData &data)=0 |
virtual void OPAL_CALL | addForce (const Force &f) |
virtual void OPAL_CALL | zeroForces ()=0 |
virtual void OPAL_CALL | setLocalLinearVel (const Vec3r &vel)=0 |
virtual Vec3r OPAL_CALL | getLocalLinearVel () const =0 |
virtual Vec3r OPAL_CALL | getLocalLinearVelAtLocalPos (const Point3r &p) const =0 |
virtual void OPAL_CALL | setLocalAngularVel (const Vec3r &vel)=0 |
virtual Vec3r OPAL_CALL | getLocalAngularVel () const =0 |
virtual void OPAL_CALL | setGlobalLinearVel (const Vec3r &vel)=0 |
virtual Vec3r OPAL_CALL | getGlobalLinearVel () const =0 |
virtual Vec3r OPAL_CALL | getGlobalLinearVelAtLocalPos (const Point3r &p) const =0 |
virtual void OPAL_CALL | setGlobalAngularVel (const Vec3r &vel)=0 |
virtual Vec3r OPAL_CALL | getGlobalAngularVel () const =0 |
virtual void OPAL_CALL | setMass (const Mass &newmass, const Matrix44r &offset)=0 |
virtual void OPAL_CALL | translateMass (const Vec3r &offset)=0 |
virtual void OPAL_CALL | setCollisionEventHandler (CollisionEventHandler *eventHandler) |
virtual CollisionEventHandler *OPAL_CALL | getCollisionEventHandler () const |
virtual real OPAL_CALL | getMass () const =0 |
virtual Matrix44r OPAL_CALL | getInertiaTensor () const =0 |
virtual bool OPAL_CALL | isMoving () const |
virtual void OPAL_CALL | setMovingState (bool moving) |
virtual void OPAL_CALL | setMovementEventHandler (MovementEventHandler *eventHandler) |
virtual MovementEventHandler *OPAL_CALL | getMovementEventHandler () const |
virtual void OPAL_CALL | internal_updateOPALTransform ()=0 |
virtual void OPAL_CALL | internal_updateEngineTransform ()=0 |
virtual void OPAL_CALL | internal_applyForces (real stepSize) |
void | internal_updateSleeping () |
virtual void OPAL_CALL | internal_destroy () |
Protected Member Functions | |
virtual | ~Solid () |
virtual void | applyForce (const Force &f)=0 |
void | addToLocalAABB (const real aabb[6]) |
void | resetAABB () |
Protected Attributes | |
std::vector< Force > | mForceList |
SolidData | mData |
real | mLocalAABB [6] |
CollisionEventHandler * | mCollisionEventHandler |
void * | mUserData |
Private Attributes | |
bool | mIsMoving |
MovementEventHandler * | mMovementEventHandler |
Definition at line 49 of file Solid.h.
|
Definition at line 32 of file Solid.cpp. References resetAABB(), setCollisionEventHandler(), setMovementEventHandler(), setMovingState(), and setUserData(). |
|
Definition at line 43 of file Solid.cpp. References mForceList. |
|
Applies a force/torque to this Solid. If the Solid is disabled, the Solid is static, or the magnitude of the force/torque is zero, this will do nothing. Definition at line 252 of file Solid.cpp. References opal::areEqual(), opal::SolidData::enabled, opal::SolidData::isStatic, opal::Vec3r::lengthSquared(), mData, mForceList, and opal::Force::vec. Referenced by opal::Joint::addForce(), opal::Joint::addTorque(), opal::ThrusterMotor::internal_update(), opal::SpringMotor::internal_update(), and opal::AttractorMotor::internal_update(). |
|
Adds a Shape to this Solid. Updates the Solid's axis-aligned bounding box. Implemented in opal::ODESolid. Referenced by opal::Simulator::createPlane(). |
|
Adds the given axis-aligned bounding box to the Solid's AABB.
Definition at line 318 of file Solid.cpp. References mLocalAABB. |
|
Physics engine-specific function for applying Forces to Solids. Implemented in opal::ODESolid. |
|
Removes all shapes from this Solid. Resets the Solid's axis-aligned bounding box. Implemented in opal::ODESolid. |
|
Returns the amount of angular damping on this Solid.
Definition at line 142 of file Solid.cpp. References opal::SolidData::angularDamping, and mData. |
|
Returns the Solid's collision event handler. If this returns NULL, the Solid is not using one. Definition at line 313 of file Solid.cpp. References mCollisionEventHandler. Referenced by opal::ode_hidden::internal_collisionCallback(). |
|
Returns all data describing the Solid.
Definition at line 81 of file Solid.cpp. References isSleeping(), mData, and opal::SolidData::sleeping. |
|
Returns the euler angles of the Solid's orientation.
Definition at line 185 of file Solid.cpp. References opal::Matrix44r::getEulerXYZ(), mData, and opal::SolidData::transform. |
|
Returns the axis-aligned bounding box for all of the Solid's shapes in global coordinates. Definition at line 215 of file Solid.cpp. References mData, mLocalAABB, and opal::SolidData::transform. |
|
Returns the Solid's angular velocity in global coordinates.
Implemented in opal::ODESolid. Referenced by opal::AccelerationSensor::internal_update(). |
|
Returns the Solid's linear velocity in global coordinates.
Implemented in opal::ODESolid. Referenced by opal::VelocityMotor::internal_update(), opal::SpringMotor::internal_update(), and opal::AccelerationSensor::internal_update(). |
|
Given an offset point relative to the Solid's local origin, returns the linear velocity of the point in global coordinates. Implemented in opal::ODESolid. |
|
Returns the Solid's inertia tensor as a 4x4 matrix. This will be the identity matrix if the Solid is static. Implemented in opal::ODESolid. |
|
Returns the amount of linear damping on this Solid.
Definition at line 131 of file Solid.cpp. References opal::SolidData::linearDamping, and mData. |
|
Returns the axis-aligned bounding box for all of the Solid's shapes relative to the Solid. Definition at line 207 of file Solid.cpp. References mLocalAABB. |
|
Returns the Solid's angular velocity in local coordinates.
Implemented in opal::ODESolid. Referenced by opal::AccelerationSensor::internal_update(). |
|
Returns the Solid's linear velocity in local coordinates.
Implemented in opal::ODESolid. Referenced by opal::AccelerationSensor::internal_update(). |
|
Given an offset point relative to the Solid's local origin, returns the linear velocity of the point in local coordinates. Implemented in opal::ODESolid. |
|
Returns the Solid's mass. This will return 0 if the Solid is static. Implemented in opal::ODESolid. Referenced by opal::AttractorMotor::init(), and opal::SpringMotor::internal_update(). |
|
Returns the Solid's movement event handler. If this returns NULL, the Solid is not using one. Definition at line 71 of file Solid.cpp. References mMovementEventHandler. |
|
Returns the Solid's name.
Definition at line 94 of file Solid.cpp. References mData, and opal::SolidData::name. Referenced by opal::BlueprintInstance::internal_addSolid(). |
|
Returns the position of this Solid in global coordinates.
Definition at line 180 of file Solid.cpp. References opal::Matrix44r::getPosition(), mData, and opal::SolidData::transform. Referenced by opal::SpringMotor::getGlobalAttachPoint(), and opal::AttractorMotor::internal_update(). |
|
Returns a quaternion representing the Solid's orientation.
Definition at line 190 of file Solid.cpp. References opal::Matrix44r::getQuaternion(), mData, and opal::SolidData::transform. |
|
Returns the Solid's sleepiness level.
Definition at line 120 of file Solid.cpp. References mData, and opal::SolidData::sleepiness. |
|
Returns a constant reference to this Solid's transform.
Definition at line 163 of file Solid.cpp. References mData, and opal::SolidData::transform. Referenced by opal::RaycastSensor::firePiercingRay(), opal::RaycastSensor::fireRay(), opal::InclineSensor::getAngle(), opal::SpringMotor::getGlobalAttachPoint(), opal::SpringMotor::internal_update(), opal::VolumeSensor::queryVolume(), opal::SpringMotor::setGlobalAttachPoint(), and opal::InclineSensor::setupInternalVectors(). |
|
Returns the user data pointer (NULL if it has not been set).
Definition at line 152 of file Solid.cpp. References mUserData. |
|
Initializes the Solid with the given data structure. Calling this more than once will automatically destroy all the old Shapes before adding new ones. Implemented in opal::ODESolid. |
|
Loops over the Solid's list of Forces and applies them.
Definition at line 261 of file Solid.cpp. References isSleeping(), opal::SolidData::isStatic, mData, mForceList, and setSleeping(). |
|
Internal function used to destroy this object.
|
|
Update the physics engine transform using the OPAL transform.
Implemented in opal::ODESolid. Referenced by setPosition(), setQuaternion(), and setTransform(). |
|
Update the OPAL transform using the physics engine transform.
Implemented in opal::ODESolid. |
|
Updates the SolidData sleeping value from the physics engine.
|
|
Returns true if the Solid is enabled.
Definition at line 99 of file Solid.cpp. References opal::SolidData::enabled, and mData. |
|
Returns true if the solid has moved since last call of Solid::isMoving().
Definition at line 48 of file Solid.cpp. References mIsMoving. |
|
Returns true if the Solid is sleeping. If the Solid is static, this will always return true. Implemented in opal::ODESolid. Referenced by getData(), and internal_applyForces(). |
|
Returns true if this is a static Solid.
Definition at line 109 of file Solid.cpp. References opal::SolidData::isStatic, and mData. Referenced by opal::ODEJoint::filterSolidForStaticness(). |
|
Resets the Solid's axis-aligned bounding box.
Definition at line 335 of file Solid.cpp. References mLocalAABB. Referenced by opal::ODESolid::clearShapes(), and Solid(). |
|
Sets the amount of angular damping on this Solid.
Definition at line 136 of file Solid.cpp. References opal::SolidData::angularDamping, and mData. |
|
Sets the Solid's collision event handler.
Definition at line 308 of file Solid.cpp. References mCollisionEventHandler. Referenced by Solid(). |
|
Sets whether the Solid can collide with other Solids and be physically simulated. Forces applied to this Solid while disabled will be ignored. Reimplemented in opal::ODESolid. Definition at line 104 of file Solid.cpp. References opal::SolidData::enabled, and mData. |
|
Sets the Solid's angular velocity in global coordinates.
Implemented in opal::ODESolid. |
|
Sets the Solid's linear velocity in global coordinates.
Implemented in opal::ODESolid. |
|
Sets the amount of linear damping on this Solid.
Definition at line 125 of file Solid.cpp. References opal::SolidData::linearDamping, and mData. Referenced by opal::VelocityMotor::init(). |
|
Sets the Solid's angular velocity in local coordinates.
Implemented in opal::ODESolid. |
|
Sets the Solid's linear velocity in local coordinates.
Implemented in opal::ODESolid. |
|
Set a new mass, center, and intertia for the solid.
Implemented in opal::ODESolid. |
|
Sets the Solid's movement event handler.
Definition at line 66 of file Solid.cpp. References mMovementEventHandler. Referenced by Solid(). |
|
Manual set of a moving state.
Definition at line 61 of file Solid.cpp. References mIsMoving. Referenced by Solid(). |
|
Sets the Solid's name.
Definition at line 89 of file Solid.cpp. References mData, and opal::SolidData::name. |
|
Sets the position of this Solid in global coordinates.
Definition at line 175 of file Solid.cpp. References setPosition(). |
|
Sets the position of this Solid in global coordinates.
Definition at line 168 of file Solid.cpp. References internal_updateEngineTransform(), mData, mIsMoving, opal::Matrix44r::setPosition(), and opal::SolidData::transform. Referenced by setPosition(). |
|
Sets a quaternion representing the Solid's orientation.
Definition at line 200 of file Solid.cpp. References internal_updateEngineTransform(), mData, mIsMoving, opal::Matrix44r::setQuaternion(), and opal::SolidData::transform. |
|
Sets a quaternion representing the Solid's orientation.
|
|
Sets the Solid's sleepiness level.
Reimplemented in opal::ODESolid. Definition at line 114 of file Solid.cpp. References mData, and opal::SolidData::sleepiness. Referenced by opal::ODESolid::setSleepiness(). |
|
Sets whether the Solid is sleeping (i.e. set this to false to wake up a sleeping Solid). Implemented in opal::ODESolid. Referenced by internal_applyForces(), and opal::Joint::wakeSolids(). |
|
Removes the Solid from its current Space and adds it to the new Space. Implemented in opal::ODESolid. |
|
Sets whether the Solid should be static or dynamic.
Implemented in opal::ODESolid. Referenced by opal::Simulator::createPlane(). |
|
Sets this Solid's transform matrix.
Definition at line 157 of file Solid.cpp. References internal_updateEngineTransform(), mData, and opal::SolidData::transform. Referenced by opal::ODESolid::init(), opal::VolumeSensor::queryVolume(), and opal::ODESolid::setupNewGeom(). |
|
Set this Solid's user data pointer to some external data. This can be used to let the Solid point to some user object (e.g. an object with a visual mesh). The user data is totally user-managed (i.e. it is not destroyed when the Solid is destroyed). Definition at line 147 of file Solid.cpp. References mUserData. Referenced by Solid(). |
|
Translate the Solid's mass using the given offset vector specified in global coordinates. Implemented in opal::ODESolid. |
|
Removes all forces and torques currently affecting this Solid.
Implemented in opal::ODESolid. |
|
Pointer to this Solid's collision event handler.
Definition at line 293 of file Solid.h. Referenced by getCollisionEventHandler(), and setCollisionEventHandler(). |
|
|
An internal list of this Solid's pending Forces.
Definition at line 281 of file Solid.h. Referenced by addForce(), internal_applyForces(), opal::ODESolid::zeroForces(), and ~Solid(). |
|
Data used for.
Definition at line 301 of file Solid.h. Referenced by isMoving(), setMovingState(), setPosition(), and setQuaternion(). |
|
The axis-aligned bounding box of all shapes in local coordinates. This array stores data in the following order: min x, max x, min y, max y, min z, max z. This gets updated whenever a shape is added or removed. Definition at line 290 of file Solid.h. Referenced by addToLocalAABB(), getGlobalAABB(), getLocalAABB(), and resetAABB(). |
|
Definition at line 302 of file Solid.h. Referenced by getMovementEventHandler(), and setMovementEventHandler(). |
|
Pointer to user data. This is totally user-managed (i.e. OPAL will never delete it). Definition at line 297 of file Solid.h. Referenced by getUserData(), and setUserData(). |