ARGoS  3
A parallel, multi-engine simulator for swarm robotics
argos::CDynamics2DEngine Class Reference

#include <dynamics2d_engine.h>

+ Inheritance diagram for argos::CDynamics2DEngine:

List of all members.

Classes

struct  SBoundarySegment
struct  SEntityTransferData

Public Types

enum  EShapeType { SHAPE_NORMAL = 0, SHAPE_GRIPPABLE, SHAPE_GRIPPER }
enum  ELayerType { LAYER_FROZEN = 0, LAYER_NORMAL = CP_ALL_LAYERS }

Public Member Functions

 CDynamics2DEngine ()
virtual ~CDynamics2DEngine ()
virtual void Init (TConfigurationNode &t_tree)
 Initializes the resource.
virtual void Reset ()
 Resets the resource.
virtual void Update ()
virtual void Destroy ()
 Undoes whatever was done by Init().
virtual bool IsPointContained (const CVector3 &c_point)
virtual UInt32 GetNumPhysicsEngineEntities ()
virtual void AddEntity (CEntity &c_entity)
 Adds an entity to the physics engine.
virtual void RemoveEntity (CEntity &c_entity)
 Removes an entity from the physics engine.
virtual bool IsEntityTransferNeeded () const
 Returns true if this engine has entities that must be transferred to another engine.
virtual void TransferEntities ()
 Executes the transfer of entities to other engines.
virtual bool IsEntityTransferActive () const
virtual CEmbodiedEntityCheckIntersectionWithRay (Real &f_t_on_ray, const CRay3 &c_ray) const
 Check whether an object in this engine intersects the given ray.
bool CalculateTransfer (Real f_x, Real f_y, std::string &str_engine_id)
void ScheduleEntityForTransfer (CEntity &c_entity, const std::string &str_engine_id)
cpSpace * GetPhysicsSpace ()
cpBody * GetGroundBody ()
Real GetElevation () const
Real GetDamping () const
void SetDamping (Real f_damping)
CVector2 GetGravity () const
void SetGravity (const CVector2 &c_gravity)
void PositionPhysicsToSpace (CVector3 &c_new_pos, const CVector3 &c_original_pos, const cpBody *pt_body)
void OrientationPhysicsToSpace (CQuaternion &c_new_orient, cpBody *pt_body)
void AddPhysicsModel (const std::string &str_id, CDynamics2DModel &c_model)
void RemovePhysicsModel (const std::string &str_id)

Detailed Description

Definition at line 43 of file dynamics2d_engine.h.


Member Enumeration Documentation

Enumerator:
LAYER_FROZEN 
LAYER_NORMAL 

Definition at line 53 of file dynamics2d_engine.h.

Enumerator:
SHAPE_NORMAL 
SHAPE_GRIPPABLE 
SHAPE_GRIPPER 

Definition at line 47 of file dynamics2d_engine.h.


Constructor & Destructor Documentation

virtual argos::CDynamics2DEngine::~CDynamics2DEngine ( ) [inline, virtual]

Definition at line 80 of file dynamics2d_engine.h.


Member Function Documentation

void argos::CDynamics2DEngine::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.

Implements argos::CPhysicsEngine.

Definition at line 225 of file dynamics2d_engine.cpp.

void argos::CDynamics2DEngine::AddPhysicsModel ( const std::string &  str_id,
CDynamics2DModel c_model 
)

Definition at line 334 of file dynamics2d_engine.cpp.

bool argos::CDynamics2DEngine::CalculateTransfer ( Real  f_x,
Real  f_y,
std::string &  str_engine_id 
)

Definition at line 289 of file dynamics2d_engine.cpp.

CEmbodiedEntity * argos::CDynamics2DEngine::CheckIntersectionWithRay ( Real f_t_on_ray,
const CRay3 c_ray 
) const [virtual]

Check whether an object in this engine intersects the given ray.

Parameters:
f_t_on_rayIn the parametric definition of ray = starting_point + t * direction, this parameter is t. A value between 0 and 1 means that the intersection point lies within the given ray; values outside this range mean that the intersection point is outside the ray extrema.
c_rayThe test ray.
Returns:
A pointer to the embodied entity intersecting the ray, or NULL if no intersection occurred.

Implements argos::CPhysicsEngine.

Definition at line 252 of file dynamics2d_engine.cpp.

Undoes whatever was done by Init().

Reimplemented from argos::CPhysicsEngine.

Definition at line 175 of file dynamics2d_engine.cpp.

Definition at line 133 of file dynamics2d_engine.h.

Definition at line 129 of file dynamics2d_engine.h.

Definition at line 141 of file dynamics2d_engine.h.

Definition at line 125 of file dynamics2d_engine.h.

Definition at line 121 of file dynamics2d_engine.h.

void argos::CDynamics2DEngine::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 34 of file dynamics2d_engine.cpp.

virtual bool argos::CDynamics2DEngine::IsEntityTransferActive ( ) const [inline, virtual]

Definition at line 104 of file dynamics2d_engine.h.

virtual bool argos::CDynamics2DEngine::IsEntityTransferNeeded ( ) const [inline, virtual]

Returns true if this engine has entities that must be transferred to another engine.

Implements argos::CPhysicsEngine.

Definition at line 98 of file dynamics2d_engine.h.

bool argos::CDynamics2DEngine::IsPointContained ( const CVector3 c_point) [virtual]

Implements argos::CPhysicsEngine.

Definition at line 190 of file dynamics2d_engine.cpp.

void argos::CDynamics2DEngine::OrientationPhysicsToSpace ( CQuaternion c_new_orient,
cpBody *  pt_body 
)

Definition at line 326 of file dynamics2d_engine.cpp.

void argos::CDynamics2DEngine::PositionPhysicsToSpace ( CVector3 c_new_pos,
const CVector3 c_original_pos,
const cpBody *  pt_body 
)

Definition at line 315 of file dynamics2d_engine.cpp.

void argos::CDynamics2DEngine::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.

Implements argos::CPhysicsEngine.

Definition at line 233 of file dynamics2d_engine.cpp.

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

Definition at line 342 of file dynamics2d_engine.cpp.

void argos::CDynamics2DEngine::Reset ( ) [virtual]

Resets the resource.

Reimplemented from argos::CPhysicsEngine.

Definition at line 146 of file dynamics2d_engine.cpp.

void argos::CDynamics2DEngine::ScheduleEntityForTransfer ( CEntity c_entity,
const std::string &  str_engine_id 
) [inline]

Definition at line 114 of file dynamics2d_engine.h.

void argos::CDynamics2DEngine::SetDamping ( Real  f_damping) [inline]

Definition at line 137 of file dynamics2d_engine.h.

void argos::CDynamics2DEngine::SetGravity ( const CVector2 c_gravity) [inline]

Definition at line 145 of file dynamics2d_engine.h.

Executes the transfer of entities to other engines.

Implements argos::CPhysicsEngine.

Definition at line 240 of file dynamics2d_engine.cpp.

Implements argos::CPhysicsEngine.

Definition at line 157 of file dynamics2d_engine.cpp.


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