argos::CDynamics3DEngine Class Reference

#include <dynamics3d_engine.h>

Inheritance diagram for argos::CDynamics3DEngine:
Collaboration diagram for argos::CDynamics3DEngine:

Public Member Functions

 CDynamics3DEngine ()
 
virtual ~CDynamics3DEngine ()
 
virtual void Init (TConfigurationNode &t_tree)
 Initializes the resource. More...
 
virtual void Reset ()
 Resets the resource. More...
 
virtual void Update ()
 
virtual void Destroy ()
 Undoes whatever was done by Init(). More...
 
virtual void PostSpaceInit ()
 Executes extra initialization activities after the space has been initialized. More...
 
virtual size_t GetNumPhysicsModels ()
 
virtual bool AddEntity (CEntity &c_entity)
 Adds an entity to the physics engine. More...
 
virtual bool RemoveEntity (CEntity &c_entity)
 Removes an entity from the physics engine. More...
 
virtual void CheckIntersectionWithRay (TEmbodiedEntityIntersectionData &t_data, const CRay3 &c_ray) const
 Check which objects in this engine intersect the given ray. More...
 
btMultiBodyDynamicsWorld & GetWorld ()
 
std::map< std::string, CDynamics3DPlugin * > & GetPhysicsPlugins ()
 
btCollisionDispatcher & GetDispatcher ()
 
const btCollisionDispatcher & GetDispatcher () const
 
btScalar GetDefaultFriction () const
 
void AddPhysicsModel (const std::string &str_id, CDynamics3DModel &c_model)
 
void RemovePhysicsModel (const std::string &str_id)
 
void AddPhysicsPlugin (const std::string &str_id, CDynamics3DPlugin &c_plugin)
 
void RemovePhysicsPlugin (const std::string &str_id)
 
- Public Member Functions inherited from argos::CPhysicsEngine
 CPhysicsEngine ()
 
virtual ~CPhysicsEngine ()
 
virtual bool IsPointContained (const CVector3 &c_point)
 Returns true if the given point is contained in this physics engine. More...
 
bool IsEntityTransferNeeded () const
 Returns true if this engine has entities that must be transferred to another engine. More...
 
bool IsEntityTransferActive () const
 Returns true if entity transfer is active for this engine. More...
 
virtual void ScheduleEntityForTransfer (CEmbodiedEntity &c_entity)
 Schedules an entity of transfer. More...
 
virtual void TransferEntities ()
 Executes the transfer of entities to other engines. More...
 
SVolumeGetVolume ()
 Returns the boundary faces for the volume associated to this engine. More...
 
const SVolumeGetVolume () const
 Returns the boundary faces for the volume associated to this engine. More...
 
UInt32 GetIterations () const
 Returns the number of iterations per simulation clock tick. More...
 
Real GetPhysicsClockTick () const
 Returns the length of the physics engine tick. More...
 
const std::string & GetId () const
 Returns the id of this physics engine. More...
 
void SetId (const std::string &str_id)
 Sets the id of this physics engine. More...
 
- Public Member Functions inherited from argos::CBaseConfigurableResource
virtual ~CBaseConfigurableResource ()
 Class destructor. More...
 

Additional Inherited Members

- Public Types inherited from argos::CPhysicsEngine
typedef std::vector< CPhysicsEngine * > TVector
 
typedef std::map< std::string, CPhysicsEngine *, std::less< std::string > > TMap
 
- Static Public Member Functions inherited from argos::CPhysicsEngine
static Real GetSimulationClockTick ()
 Returns the simulation clock tick. More...
 
static Real GetInverseSimulationClockTick ()
 Returns the inverse of GetSimulationClockTick(). More...
 
static void SetSimulationClockTick (Real f_simulation_clock_tick)
 Sets the simulation clock tick. More...
 

Detailed Description

Definition at line 29 of file dynamics3d_engine.h.

Constructor & Destructor Documentation

argos::CDynamics3DEngine::CDynamics3DEngine ( )

Definition at line 22 of file dynamics3d_engine.cpp.

virtual argos::CDynamics3DEngine::~CDynamics3DEngine ( )
inlinevirtual

Definition at line 35 of file dynamics3d_engine.h.

Member Function Documentation

bool argos::CDynamics3DEngine::AddEntity ( CEntity c_entity)
virtual

Adds an entity to the physics engine.

Important: when you implement this function, you must also take care of adding the physics model to the associated embodied entity.

Returns
true if the entity was added, false otherwise.

Implements argos::CPhysicsEngine.

Definition at line 222 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::AddPhysicsModel ( const std::string &  str_id,
CDynamics3DModel c_model 
)

Definition at line 242 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::AddPhysicsPlugin ( const std::string &  str_id,
CDynamics3DPlugin c_plugin 
)

Definition at line 285 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::CheckIntersectionWithRay ( TEmbodiedEntityIntersectionData t_data,
const CRay3 c_ray 
) const
virtual

Check which objects in this engine intersect the given ray.

Parameters
t_dataThe list of entities that intersect the ray.
c_rayThe test ray.

Implements argos::CPhysicsEngine.

Definition at line 192 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::Destroy ( )
virtual

Undoes whatever was done by Init().

Reimplemented from argos::CPhysicsEngine.

Definition at line 143 of file dynamics3d_engine.cpp.

btScalar argos::CDynamics3DEngine::GetDefaultFriction ( ) const
inline

Definition at line 72 of file dynamics3d_engine.h.

btCollisionDispatcher& argos::CDynamics3DEngine::GetDispatcher ( )
inline

Definition at line 64 of file dynamics3d_engine.h.

const btCollisionDispatcher& argos::CDynamics3DEngine::GetDispatcher ( ) const
inline

Definition at line 68 of file dynamics3d_engine.h.

size_t argos::CDynamics3DEngine::GetNumPhysicsModels ( )
virtual

Implements argos::CPhysicsEngine.

Definition at line 215 of file dynamics3d_engine.cpp.

std::map<std::string, CDynamics3DPlugin*>& argos::CDynamics3DEngine::GetPhysicsPlugins ( )
inline

Definition at line 60 of file dynamics3d_engine.h.

btMultiBodyDynamicsWorld& argos::CDynamics3DEngine::GetWorld ( )
inline

Definition at line 56 of file dynamics3d_engine.h.

void argos::CDynamics3DEngine::Init ( TConfigurationNode t_tree)
virtual

Initializes the resource.

Parameters
t_treethe base of the XML configuration tree to parse
Exceptions
CARGoSExceptionif an error occurs

Reimplemented from argos::CPhysicsEngine.

Definition at line 39 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::PostSpaceInit ( )
virtual

Executes extra initialization activities after the space has been initialized.

By default, this method does nothing. The order in which initialization takes place is:

Exceptions
CARGoSExceptionif an error occurs
See also
Init()
CSpace::Init()

Reimplemented from argos::CPhysicsEngine.

Definition at line 66 of file dynamics3d_engine.cpp.

bool argos::CDynamics3DEngine::RemoveEntity ( CEntity c_entity)
virtual

Removes an entity from the physics engine.

Important: when you implement this function, you must also take care of removing the physics model to the associated embodied entity.

Returns
true if the entity was added, false otherwise.

Implements argos::CPhysicsEngine.

Definition at line 232 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::RemovePhysicsModel ( const std::string &  str_id)

Definition at line 259 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::RemovePhysicsPlugin ( const std::string &  str_id)

Definition at line 293 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::Reset ( )
virtual

Resets the resource.

Reimplemented from argos::CPhysicsEngine.

Definition at line 74 of file dynamics3d_engine.cpp.

void argos::CDynamics3DEngine::Update ( )
virtual

Implements argos::CPhysicsEngine.

Definition at line 173 of file dynamics3d_engine.cpp.