ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
#include <dynamics2d_engine.h>
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 CEmbodiedEntity * | CheckIntersectionWithRay (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) |
Definition at line 43 of file dynamics2d_engine.h.
Definition at line 53 of file dynamics2d_engine.h.
Definition at line 47 of file dynamics2d_engine.h.
Definition at line 20 of file dynamics2d_engine.cpp.
virtual argos::CDynamics2DEngine::~CDynamics2DEngine | ( | ) | [inline, virtual] |
Definition at line 80 of file dynamics2d_engine.h.
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.
f_t_on_ray | In 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_ray | The test ray. |
NULL
if no intersection occurred. Implements argos::CPhysicsEngine.
Definition at line 252 of file dynamics2d_engine.cpp.
void argos::CDynamics2DEngine::Destroy | ( | ) | [virtual] |
Undoes whatever was done by Init().
Reimplemented from argos::CPhysicsEngine.
Definition at line 175 of file dynamics2d_engine.cpp.
Real argos::CDynamics2DEngine::GetDamping | ( | ) | const [inline] |
Definition at line 133 of file dynamics2d_engine.h.
Real argos::CDynamics2DEngine::GetElevation | ( | ) | const [inline] |
Definition at line 129 of file dynamics2d_engine.h.
CVector2 argos::CDynamics2DEngine::GetGravity | ( | ) | const [inline] |
Definition at line 141 of file dynamics2d_engine.h.
cpBody* argos::CDynamics2DEngine::GetGroundBody | ( | ) | [inline] |
Definition at line 125 of file dynamics2d_engine.h.
UInt32 argos::CDynamics2DEngine::GetNumPhysicsEngineEntities | ( | ) | [virtual] |
Implements argos::CPhysicsEngine.
Definition at line 218 of file dynamics2d_engine.cpp.
cpSpace* argos::CDynamics2DEngine::GetPhysicsSpace | ( | ) | [inline] |
Definition at line 121 of file dynamics2d_engine.h.
void argos::CDynamics2DEngine::Init | ( | TConfigurationNode & | t_tree | ) | [virtual] |
Initializes the resource.
t_tree | the base of the XML configuration tree to parse |
CARGoSException | if 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.
void argos::CDynamics2DEngine::TransferEntities | ( | ) | [virtual] |
Executes the transfer of entities to other engines.
Implements argos::CPhysicsEngine.
Definition at line 240 of file dynamics2d_engine.cpp.
void argos::CDynamics2DEngine::Update | ( | ) | [virtual] |
Implements argos::CPhysicsEngine.
Definition at line 157 of file dynamics2d_engine.cpp.