CHAI3D - ODE MODULE  3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cODEWorld Class Reference

This class implements an ODE dynamic world. More...

#include <CODEWorld.h>

Inheritance diagram for cODEWorld:

Public Member Functions

 cODEWorld (chai3d::cWorld *a_parentWorld)
 Constructor of cODEWorld. More...
 
virtual ~cODEWorld ()
 Destructor of cODEWorld. More...
 
void setGravity (chai3d::cVector3d a_gravity)
 This method sets the gravity field vector. More...
 
chai3d::cVector3d getGravity ()
 This method returns the gravity field vector. More...
 
void setLinearDamping (double a_value)
 This method sets a general linear damping term to the objects in the world. More...
 
void setAngularDamping (double a_value)
 This method sets a general angular damping term to the objects in the world. More...
 
void setMaxAngularSpeed (double a_value)
 This method sets a maximum angular speed for objects in the world. More...
 
void updateDynamics (double a_interval)
 This method updates the simulation over a time interval. More...
 
void updateBodyPositions (void)
 This method updates the position and orientation from ODE models to CHAI3D models. More...
 
void updateGlobalPositions (const bool a_frameOnly)
 This method updates all global position frames. 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 any collision between a segment and all objects in this world. More...
 

Public Attributes

std::list< cODEGenericBody * > m_bodies
 List of all ODE dynamic bodies in world. More...
 
dWorldID m_ode_world
 ODE dynamics world. More...
 
dSpaceID m_ode_space
 ODE collision space. More...
 
dJointGroupID m_ode_contactgroup
 ODE contact group. More...
 

Protected Member Functions

virtual void render (chai3d::cRenderOptions &a_options)
 This method render graphically all objects in the world. More...
 

Static Protected Member Functions

static void nearCallback (void *data, dGeomID o1, dGeomID o2)
 This method is an ODE callback that reports collisions. More...
 

Protected Attributes

double m_simulationTime
 Current time of simulation. More...
 
chai3d::cWorld * m_parentWorld
 Parent CHAI3D world. More...
 

Detailed Description

cODEWorld implements a virtual world to handle ODE based objects (cODEGenericBody).

Constructor & Destructor Documentation

cODEWorld::cODEWorld ( chai3d::cWorld *  a_parentWorld)

Constructor of cODEWorld.

Parameters
a_parentWorldPointer to parent CHAI3D world.
cODEWorld::~cODEWorld ( )
virtual

Destructor of cODEWorld.

Member Function Documentation

void cODEWorld::setGravity ( chai3d::cVector3d  a_gravity)

This methods defines a gravity field passed as argument.

Parameters
a_gravityGravity field vector.
cVector3d cODEWorld::getGravity ( )

This methods returns the current gravity field vector.

Returns
Current gravity field vector.
void cODEWorld::setLinearDamping ( double  a_value)
inline
void cODEWorld::setAngularDamping ( double  a_value)
inline
void cODEWorld::setMaxAngularSpeed ( double  a_value)
inline
void cODEWorld::updateDynamics ( double  a_interval)

This methods updates the simulation over a time interval passed as argument

Parameters
a_intervalTime increment.
void cODEWorld::updateBodyPositions ( void  )

This methods updates the position and orientation from ODE models to CHAI3D models.

void cODEWorld::updateGlobalPositions ( const bool  a_frameOnly)

This methods computes 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).

Parameters
a_frameOnlyIf true then only the global frame is computed.
bool cODEWorld::computeCollisionDetection ( const chai3d::cVector3d &  a_segmentPointA,
const chai3d::cVector3d &  a_segmentPointB,
chai3d::cCollisionRecorder &  a_recorder,
chai3d::cCollisionSettings &  a_settings 
)
virtual

This method checks if the given line segment intersects any object located inside the virtual world.

Parameters
a_segmentPointAInitial point of segment.
a_segmentPointBEnd point of segment.
a_recorderRecorder which stores all collision events.
a_settingsStructure which contains some rules about how the collision detection should be performed.
Returns
true if a collision occurred, false otherwise.
void cODEWorld::nearCallback ( void *  a_data,
dGeomID  a_object1,
dGeomID  a_object2 
)
staticprotected

This methods is an ODE callback for handling collision detection.

Parameters
a_dataNot used here.
a_object1Reference to ODE object 1.
a_object2Reference to ODE object 2.
void cODEWorld::render ( chai3d::cRenderOptions &  a_options)
protectedvirtual

This methods renders the world graphically using OpenGL.

Parameters
a_optionsRendering options.

Member Data Documentation

std::list<cODEGenericBody*> cODEWorld::m_bodies
dWorldID cODEWorld::m_ode_world
dSpaceID cODEWorld::m_ode_space
dJointGroupID cODEWorld::m_ode_contactgroup
double cODEWorld::m_simulationTime
protected
chai3d::cWorld* cODEWorld::m_parentWorld
protected

The documentation for this class was generated from the following files:

CHAI3D - ODE MODULE 3.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2015 - CHAI3D
All Rights Reserved.