|
CHAI3D - ODE MODULE
3.0.0
|
This class implements an ODE dynamic object. More...
#include <CODEGenericBody.h>

Public Member Functions | |
| cODEGenericBody (cODEWorld *a_world) | |
| Constructor of cODEGenericBody. More... | |
| virtual | ~cODEGenericBody () |
| Destructor of cODEGenericBody. More... | |
| virtual void | setLocalPos (const chai3d::cVector3d &a_position) |
| This method sets the local position of object. More... | |
| void | setLocalPos (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0) |
| This method sets the local position of this object. More... | |
| virtual void | setLocalRot (const chai3d::cMatrix3d &a_rotation) |
| This method sets the orientation of this object. More... | |
| void | updateBodyPosition (void) |
| This method updates the position and orientation from the ODE model to CHAI3D model. More... | |
| void | addExternalForce (const chai3d::cVector3d &a_force) |
| This method applies an external force at the center of mass of this object. More... | |
| void | addExternalTorque (const chai3d::cVector3d &a_torque) |
| This method applies an external torque at the center of mass of of this object. More... | |
| void | addExternalForceAtPoint (const chai3d::cVector3d &a_force, const chai3d::cVector3d &a_pos) |
| This method applies an external force at a given position described in global coordinates to this object. More... | |
| void | setMass (const double a_mass) |
| This method assigns a value for the mass of this object. More... | |
| double | getMass () const |
| This method returns the mass value for this object. More... | |
| void | enableDynamics () |
| This method enables dynamics for this object. More... | |
| void | disableDynamics () |
| This method disables dynamics for this object. More... | |
| bool | isStatic () const |
| This method returns true if the object is dynamically static, false otherwise. More... | |
| virtual void | buildDynamicModel () |
| This method creates a dynamic model of the object for modeling collisions between objects. More... | |
| void | createDynamicBoundingBox (const bool a_staticObject=false) |
| This method creates a dynamic box representation for modeling collisions between objects. More... | |
| void | createDynamicSphere (const double a_radius, const bool a_staticObject=false, const chai3d::cVector3d &a_offsetPos=chai3d::cVector3d(0.0, 0.0, 0.0), const chai3d::cMatrix3d &a_offsetRot=chai3d::cIdentity3d()) |
| This method creates a dynamic sphere representation for modeling collisions between objects. More... | |
| void | createDynamicBox (const double a_lengthX, const double a_lengthY, const double a_lengthZ, const bool a_staticObject=false, const chai3d::cVector3d &a_offsetPos=chai3d::cVector3d(0.0, 0.0, 0.0), const chai3d::cMatrix3d &a_offsetRot=chai3d::cIdentity3d()) |
| This method creates a dynamic box representation for modeling collisions between objects. More... | |
| void | createDynamicCapsule (const double a_radius, const double a_length, const bool a_staticObject=false, const chai3d::cVector3d &a_offsetPos=chai3d::cVector3d(0.0, 0.0, 0.0), const chai3d::cMatrix3d &a_offsetRot=chai3d::cIdentity3d()) |
| This method creates a dynamic capsule representation for modeling collisions between objects. More... | |
| void | createDynamicCylinder (const double a_radius, const double a_length, const bool a_staticObject=false, const chai3d::cVector3d &a_offsetPos=chai3d::cVector3d(0.0, 0.0, 0.0), const chai3d::cMatrix3d &a_offsetRot=chai3d::cIdentity3d()) |
| This method creates a dynamic caped cylinder representation for modeling collisions between objects. More... | |
| void | createStaticPlane (const chai3d::cVector3d &a_position, const chai3d::cVector3d &a_normal) |
| This method creates a static plane representation for modeling collisions between objects. More... | |
| void | createDynamicMesh (const bool a_staticObject=false, const chai3d::cVector3d &a_offsetPos=chai3d::cVector3d(0.0, 0.0, 0.0), const chai3d::cMatrix3d &a_offsetRot=chai3d::cIdentity3d()) |
| This method creates a triangle mesh representation for modeling collisions between objects. More... | |
| virtual bool | computeCollisionDetection (const chai3d::cVector3d &a_segmentPointA, const chai3d::cVector3d &a_segmentPointB, chai3d::cCollisionRecorder &a_recorder, chai3d::cCollisionSettings &a_settings) |
| This method computes all collisions between a segment passed as argument and the body image of this object. More... | |
| void | setImageModel (chai3d::cGenericObject *a_imageModel) |
| This method sets a CHAI3D body image for this object. More... | |
| chai3d::cGenericObject * | getImageModel () |
| This method returns a pointer to the CHAI3D body image. More... | |
| void | setShowDynamicCollisionModel (const bool a_show) |
| This method displays or hides the collision model. More... | |
| bool | getShowDynamicCollisionModel () |
| This method returns the display status of the collision model. More... | |
Public Attributes | |
| cODEWorld * | m_ODEWorld |
| Parent world. More... | |
| chai3d::cGenericObject * | m_imageModel |
| Object used to represent the geometry and graphical properties of the object. More... | |
| dBodyID | m_ode_body |
| ODE body. More... | |
| dGeomID | m_ode_geom |
| ODE body geometry. More... | |
| chai3d::cColorf | m_colorDynamicCollisionModel |
| Color used to render collision model. More... | |
Protected Member Functions | |
| virtual void | updateGlobalPositions (const bool a_frameOnly) |
| This method updates the global position frame of this object. More... | |
| virtual void | render (chai3d::cRenderOptions &a_options) |
| This method renders the object graphically using OpenGL. More... | |
| int | buildMeshTable (chai3d::cMultiMesh *a_multiMesh, int a_indexOffset, int a_verticesCount, int a_indexCount) |
| This method builds table of triangles and vertices for ODE multiMesh representation. More... | |
| int | buildMeshTable (chai3d::cMesh *a_mesh, int a_indexOffset, int a_verticesCount, int a_indexCount) |
| This method builds table of triangles and vertices for ODE mesh representation. More... | |
| void | initialize (cODEWorld *a_world) |
| This method initializes the ODE object. More... | |
Protected Attributes | |
| bool | m_static |
| if true then ODE object is static and does not move. More... | |
| dMass | m_ode_mass |
| ODE body mass matrix. More... | |
| double | m_mass |
| Mass of object units: [kg]. More... | |
| float * | m_vertices |
| ODE vertices (for triangle mesh models) - Do not use doubles since not supported under ODE! More... | |
| int * | m_vertexIndices |
| ODE indices (for triangle mesh models). More... | |
| double | m_prevTransform [16] |
| ODE previous tri mesh position and orientation. More... | |
| dTriMeshDataID | m_ode_triMeshDataID |
| ODE triangle mesh ID. More... | |
| bool | m_showDynamicCollisionModel |
| Enable/Disable graphical representation of collision model. More... | |
| cODEDynamicModelType | m_typeDynamicCollisionModel |
| Dynamic model type. More... | |
| double | m_paramDynColModel0 |
| double | m_paramDynColModel1 |
| double | m_paramDynColModel2 |
| chai3d::cVector3d | m_posOffsetDynColModel |
| chai3d::cMatrix3d | m_rotOffsetDynColModel |
cODEGenericBody is a base class for modeling any ODE dynamic body.
|
inline |
|
inlinevirtual |
|
virtual |
This method assigns a desired position to the object.
| a_position | New desired position. |
|
inline |
|
virtual |
This method assigns a desired rotation to the object.
| a_rotation | New desired orientation. |
| void cODEGenericBody::updateBodyPosition | ( | void | ) |
This method updates the position and orientation data from the ODE representation to the CHAI3D representation.
| void cODEGenericBody::addExternalForce | ( | const chai3d::cVector3d & | a_force | ) |
This method applies an external force at the center of mass of the object.
| a_force | Force vector. |
| void cODEGenericBody::addExternalTorque | ( | const chai3d::cVector3d & | a_torque | ) |
This method applies an external torque at the center of mass of the object.
| a_torque | Torque vector. |
| void cODEGenericBody::addExternalForceAtPoint | ( | const chai3d::cVector3d & | a_force, |
| const chai3d::cVector3d & | a_pos | ||
| ) |
This method applies an external force to the object at a given position. the position and force are expressed in global coordinates.
| a_force | Force vector. |
| a_pos | Position (in global coordinates) where force is applied. |
| void cODEGenericBody::setMass | ( | const double | a_mass | ) |
This method assigns a mass value to the current object.
| a_mass | mass value. |
|
inline |
| void cODEGenericBody::enableDynamics | ( | ) |
This method enables the object from being updated within the dynamics simulation.
| void cODEGenericBody::disableDynamics | ( | ) |
This method disables the object from being updated within the dynamics simulation.
|
inline |
|
inlinevirtual |
| void cODEGenericBody::createDynamicBoundingBox | ( | const bool | a_staticObject = false | ) |
This method uses the bounding box of the geometric representation of the object to generate a box that is used for collision detection.
| a_staticObject | If true then object is defined as static. |
| void cODEGenericBody::createDynamicSphere | ( | const double | a_radius, |
| const bool | a_staticObject = false, |
||
| const chai3d::cVector3d & | a_offsetPos = chai3d::cVector3d(0.0, 0.0, 0.0), |
||
| const chai3d::cMatrix3d & | a_offsetRot = chai3d::cIdentity3d() |
||
| ) |
This method creates an ODE dynamic sphere model that is used for collision detection. It is possible to visualize the actual ODE physical model by calling setShowDynamicCollisionModel() method.
| a_radius | Radius of sphere. |
| a_staticObject | If true then object is defined as static. |
| a_offsetPos | Position offset. |
| a_offsetRot | Rotation offset. |
| void cODEGenericBody::createDynamicBox | ( | const double | a_lengthX, |
| const double | a_lengthY, | ||
| const double | a_lengthZ, | ||
| const bool | a_staticObject = false, |
||
| const chai3d::cVector3d & | a_offsetPos = chai3d::cVector3d(0.0, 0.0, 0.0), |
||
| const chai3d::cMatrix3d & | a_offsetRot = chai3d::cIdentity3d() |
||
| ) |
This method creates an ODE dynamic box model. It is possible to visualize the actual ODE physical model by calling setShowDynamicCollisionModel() method.
| a_lengthX | Size of box along the x axis. |
| a_lengthY | Size of box along the y axis. |
| a_lengthZ | Size of box along the z axis. |
| a_staticObject | If true then object is defined as static. |
| a_offsetPos | Position offset. |
| a_offsetRot | Rotation offset. |
| void cODEGenericBody::createDynamicCapsule | ( | const double | a_radius, |
| const double | a_length, | ||
| const bool | a_staticObject = false, |
||
| const chai3d::cVector3d & | a_offsetPos = chai3d::cVector3d(0.0, 0.0, 0.0), |
||
| const chai3d::cMatrix3d & | a_offsetRot = chai3d::cIdentity3d() |
||
| ) |
This method creates an ODE dynamic cylinder model (capsule). It is possible to visualize the actual ODE physical model by calling setShowDynamicCollisionModel() method.
| a_radius | Radius of capsule. |
| a_length | Length of capsule. |
| a_staticObject | If true then object is defined as static. |
| a_offsetPos | Position offset. |
| a_offsetRot | Rotation offset. |
| void cODEGenericBody::createDynamicCylinder | ( | const double | a_radius, |
| const double | a_length, | ||
| const bool | a_staticObject = false, |
||
| const chai3d::cVector3d & | a_offsetPos = chai3d::cVector3d(0.0, 0.0, 0.0), |
||
| const chai3d::cMatrix3d & | a_offsetRot = chai3d::cIdentity3d() |
||
| ) |
This method Create an ODE dynamic cylinder model. It is possible to visualize the actual ODE physical model by calling setShowDynamicCollisionModel() method.
| a_radius | Radius of capsule. |
| a_length | Length of capsule. |
| a_staticObject | If true then object is defined as static. |
| a_offsetPos | Position offset. |
| a_offsetRot | Rotation offset. |
| void cODEGenericBody::createStaticPlane | ( | const chai3d::cVector3d & | a_position, |
| const chai3d::cVector3d & | a_normal | ||
| ) |
This method creates an ODE static model of a plane. It is possible to visualize the actual ODE physical model by calling setShowDynamicCollisionModel() method.
| a_position | Position of a point located on the plane. |
| a_normal | Surface normal of the plane. |
| void cODEGenericBody::createDynamicMesh | ( | const bool | a_staticObject = false, |
| const chai3d::cVector3d & | a_offsetPos = chai3d::cVector3d(0.0, 0.0, 0.0), |
||
| const chai3d::cMatrix3d & | a_offsetRot = chai3d::cIdentity3d() |
||
| ) |
This method creates an ODE dynamic model of a mesh. This model requires the body image to be a mesh and uses it triangles to build its physical model.
| a_staticObject | If true then object is defined as static. |
| a_offsetPos | Position offset. |
| a_offsetRot | Rotation offset. |
|
virtual |
This method checks if a given line segment intersects this object.
| a_segmentPointA | Initial point of segment. |
| a_segmentPointB | End point of segment. |
| a_recorder | Recorder which stores all collision events. |
| a_settings | Structure which contains some rules about how the collision detection should be performed. |
| void cODEGenericBody::setImageModel | ( | chai3d::cGenericObject * | a_imageModel | ) |
This method assigns a generic object such as a mesh or a shape that is used to model the geometry of this current ODE object.
| a_imageModel | CHAI3D graphical image model. |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
This method updates globalPos and globalRot given the localPos and localRot of this object and its parents.
If a_frameOnly is set to false, additional global positions such as vertex positions are computed (which can be time-consuming).
| a_frameOnly | If __true___ then only frame is computed. |
|
protectedvirtual |
This method renders the object graphically using OpenGL.
| a_options | Rendering options. |
|
protected |
This method creates an ODE list of vertices and vertex indices from a mesh and its children.
| a_multiMesh | Current mesh to be added to ODE vertex and triangle list. |
| a_indexOffset | Index offset as meshes are added in one list. |
| a_verticesCount | Vertex counter. |
| a_indexCount | Index counter. |
|
protected |
This method creates an ODE list of vertices and vertex indices from a mesh and its children.
| a_mesh | Current mesh to be added to ODE vertex and triangle list. |
| a_indexOffset | Index offset as meshes are added in one list. |
| a_verticesCount | Vertex counter. |
| a_indexCount | Index counter. |
|
protected |
This method initializes the ODE model.
| a_world | ODE world to which this new object belongs to. |
| cODEWorld* cODEGenericBody::m_ODEWorld |
| chai3d::cGenericObject* cODEGenericBody::m_imageModel |
| dBodyID cODEGenericBody::m_ode_body |
| dGeomID cODEGenericBody::m_ode_geom |
| chai3d::cColorf cODEGenericBody::m_colorDynamicCollisionModel |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Variables which store the parameters of the collision model. Depending of the dynamic model type, these value correspond to lengths or radius.
|
protected |
|
protected |
|
protected |
|
protected |