#include <ODESimulator.h>
Inheritance diagram for opal::ODESimulator:
Public Types | |
enum | SolverType { SOLVER_WORLDSTEP, SOLVER_QUICKSTEP } |
Public Member Functions | |
ODESimulator () | |
void | initData (SimulatorData data) |
virtual | ~ODESimulator () |
virtual void OPAL_CALL | destroy () |
virtual void OPAL_CALL | setMaxCorrectingVel (real vel) |
virtual Solid *OPAL_CALL | createSolid () |
virtual Joint *OPAL_CALL | createJoint () |
virtual Space *OPAL_CALL | createSpace () |
virtual void OPAL_CALL | setGravity (const Vec3r &gravity) |
virtual Vec3r OPAL_CALL | getGravity () const |
virtual void OPAL_CALL | setSolverAccuracy (SolverAccuracyLevel level) |
virtual dWorldID OPAL_CALL | internal_getWorldID () const |
virtual dSpaceID OPAL_CALL | internal_getSpaceID () const |
virtual dJointGroupID OPAL_CALL | internal_getJointGroupID () const |
virtual std::vector< RaycastResult > &OPAL_CALL | internal_fireRay (const Rayr &r, real length, const Solid *attachedSolid, unsigned int rayContactGroup) |
virtual const VolumeQueryResult &OPAL_CALL | internal_queryVolume (const Solid *volume, const Solid *attachedSolid) |
void | internal_addRaycastResult (Solid *solid, const Point3r &intersection, const Vec3r &normal, real depth) |
void | internal_addCollidedSolid (Solid *solid) |
virtual unsigned int OPAL_CALL | internal_getRayContactGroup () |
Protected Member Functions | |
virtual void | stepPhysics () |
Protected Attributes | |
dWorldID | mWorldID |
dSpaceID | mRootSpaceID |
dJointGroupID | mContactJointGroupID |
SolverType | mSolverType |
long int | mCollisionCount |
VolumeQueryResult | mVolumeQueryResult |
const Solid * | mSensorSolid |
unsigned int | mRayContactGroup |
std::vector< RaycastResult > | mRaycastResults |
Definition at line 49 of file ODESimulator.h.
|
The types of ODE constraint solvers.
Definition at line 53 of file ODESimulator.h. |
|
use initData to complete
Definition at line 128 of file ODESimulator.cpp. |
|
Definition at line 133 of file ODESimulator.cpp. |
|
Creates and returns a pointer to a Joint.
Implements opal::Simulator. Definition at line 162 of file ODESimulator.cpp. References opal::Simulator::addJoint(), and mWorldID. |
|
Creates and returns a pointer to a Solid.
Implements opal::Simulator. Definition at line 144 of file ODESimulator.cpp. References opal::Simulator::addSolid(), mRootSpaceID, and mWorldID. |
|
Creates and returns a pointer to a Space which is a child of the Simulator's root Space. Implements opal::Simulator. Definition at line 151 of file ODESimulator.cpp. References opal::Simulator::addSpace(), opal::ODESpace::internal_getSpaceID(), and mRootSpaceID. |
|
Deallocates everything within the Simulator. This should be called when finished with everything. Simulator implementations should call "delete this" within this function. Implements opal::Simulator. Definition at line 169 of file ODESimulator.cpp. References mContactJointGroupID, mRootSpaceID, and mWorldID. |
|
Returns the gravity used in the simulation.
Implements opal::Simulator. Definition at line 1144 of file ODESimulator.cpp. References opal::defaults::gravity, and mWorldID. |
|
|
Helper function for volume collision checking.
Definition at line 1015 of file ODESimulator.cpp. References opal::VolumeQueryResult::internal_addSolid(), opal::ODESolid::internal_getCollisionCount(), opal::ODESolid::internal_setCollisionCount(), mCollisionCount, mSensorSolid, and mVolumeQueryResult. Referenced by opal::ode_hidden::internal_volumeCollisionCallback(). |
|
Helper function used for ray casting which stores RaycastResults.
Definition at line 1033 of file ODESimulator.cpp. References opal::RaycastResult::distance, opal::RaycastResult::intersection, mRaycastResults, mSensorSolid, opal::RaycastResult::normal, and opal::RaycastResult::solid. |
|
Helper function used for ray casting. Immediately fires a ray into the scene and returns intersections results. Uses the ray's contact group parameter to limit collision checks. Implements opal::Simulator. Definition at line 1077 of file ODESimulator.cpp. References opal::Rayr::getDir(), opal::Rayr::getOrigin(), opal::ode_hidden::internal_raycastCollisionCallback(), mRaycastResults, mRayContactGroup, mRootSpaceID, mSensorSolid, and opal::Vec3r::unit(). |
|
Definition at line 1194 of file ODESimulator.cpp. References mContactJointGroupID. Referenced by opal::ode_hidden::internal_collisionCallback(). |
|
Helper function used for ray casting.
Definition at line 1052 of file ODESimulator.cpp. References mRayContactGroup. Referenced by opal::ode_hidden::internal_raycastCollisionCallback(). |
|
Definition at line 1189 of file ODESimulator.cpp. References mRootSpaceID. |
|
Definition at line 1184 of file ODESimulator.cpp. References mWorldID. Referenced by opal::ode_hidden::internal_collisionCallback(). |
|
Helper function used for volume queries.
Implements opal::Simulator. Definition at line 1107 of file ODESimulator.cpp. References opal::VolumeQueryResult::internal_clearSolids(), opal::ode_hidden::internal_volumeCollisionCallback(), mCollisionCount, mRootSpaceID, mSensorSolid, and mVolumeQueryResult. |
|
Sets the gravity used in the simulation.
Implements opal::Simulator. Definition at line 1139 of file ODESimulator.cpp. References opal::defaults::gravity, and mWorldID. Referenced by initData(). |
|
Sets the maximum correcting velocity for interpenetrating objects. The given velocity must be positive. Reimplemented from opal::Simulator. Definition at line 138 of file ODESimulator.cpp. References mWorldID, and opal::Simulator::setMaxCorrectingVel(). |
|
Sets the accuracy level used by the physics engine's constraint solver. Reimplemented from opal::Simulator. Definition at line 1152 of file ODESimulator.cpp. References mSolverType, mWorldID, opal::Simulator::setSolverAccuracy(), opal::SOLVER_ACCURACY_HIGH, opal::SOLVER_ACCURACY_LOW, opal::SOLVER_ACCURACY_MEDIUM, opal::SOLVER_ACCURACY_VERY_HIGH, opal::SOLVER_ACCURACY_VERY_LOW, SOLVER_QUICKSTEP, and SOLVER_WORLDSTEP. Referenced by initData(). |
|
This function is physics engine-specific. It handles collision detection and steps the simulation ahead by a constant step size. Implements opal::Simulator. Definition at line 189 of file ODESimulator.cpp. References opal::Simulator::mSolidList. |
|
Used for volume collision checks.
Definition at line 143 of file ODESimulator.h. Referenced by initData(), internal_addCollidedSolid(), and internal_queryVolume(). |
|
The ODE joint constraint group.
Definition at line 137 of file ODESimulator.h. Referenced by destroy(), initData(), and internal_getJointGroupID(). |
|
A vector of RaycastResults returned from a ray cast.
Definition at line 160 of file ODESimulator.h. Referenced by internal_addRaycastResult(), and internal_fireRay(). |
|
A temporary variable that lets rays to use contact groups. This allows them to limit which Shapes they collide with. Definition at line 157 of file ODESimulator.h. Referenced by initData(), internal_fireRay(), and internal_getRayContactGroup(). |
|
The root of the ODE collision detection hierarchy.
Definition at line 134 of file ODESimulator.h. Referenced by createSolid(), createSpace(), destroy(), initData(), internal_fireRay(), internal_getSpaceID(), and internal_queryVolume(). |
|
Used for ray casting and volume queries. If a RaycastSensor or VolumeSensor is attached to a Solid, this pointer will point to that Solid. It is used to make sure the raycasts and collision query doesn't collide with the attached Solid. Definition at line 153 of file ODESimulator.h. Referenced by initData(), internal_addCollidedSolid(), internal_addRaycastResult(), internal_fireRay(), and internal_queryVolume(). |
|
The type of constraint solver to use.
Definition at line 140 of file ODESimulator.h. Referenced by setSolverAccuracy(). |
|
Temporary list of Solids that collided in a volume collision check. Definition at line 147 of file ODESimulator.h. Referenced by internal_addCollidedSolid(), and internal_queryVolume(). |
|
The ODE world ID used by this Simulator.
Definition at line 131 of file ODESimulator.h. Referenced by createJoint(), createSolid(), destroy(), getGravity(), initData(), internal_getWorldID(), setGravity(), setMaxCorrectingVel(), and setSolverAccuracy(). |