7 #ifndef EMBODIED_ENTITY_H
8 #define EMBODIED_ENTITY_H
11 class CEmbodiedEntity;
14 #include <argos3/core/simulator/entity/entity.h>
15 #include <argos3/core/simulator/space/positional_indices/grid.h>
16 #include <argos3/core/simulator/space/positional_indices/space_hash.h>
17 #include <argos3/core/utility/datatypes/set.h>
18 #include <argos3/core/utility/math/ray3.h>
19 #include <argos3/core/utility/math/quaternion.h>
20 #include <argos3/core/simulator/physics_engine/physics_engine.h>
21 #include <argos3/core/simulator/physics_engine/physics_model.h>
75 const std::string& str_id,
78 bool b_movable =
true);
298 bool b_check_only =
false,
299 bool b_ignore_collisions =
false);
341 const std::string& str_id);
356 class CEmbodiedEntitySpaceHashUpdater :
public CSpaceHashUpdater<CEmbodiedEntity> {
365 SInt32 m_nMinX, m_nMinY, m_nMinZ;
366 SInt32 m_nMaxX, m_nMaxY, m_nMaxZ;
386 SInt32 m_nMinI, m_nMinJ, m_nMinK;
387 SInt32 m_nMaxI, m_nMaxJ, m_nMaxK;
signed int SInt32
32-bit signed integer.
unsigned int UInt32
32-bit unsigned integer.
The namespace containing all the ARGoS related code.
bool operator==(const SAnchor *ps_anchor, const std::string &str_id)
Returns true if the anchor id matches the given id.
std::vector< CEmbodiedEntity * > TEmbodiedEntityVector
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
std::map< std::string, CEmbodiedEntity * > TEmbodiedEntityMap
CSet< CEmbodiedEntity * > TEmbodiedEntitySet
Basic class for an entity that contains other entities.
This entity is a link to a body in the physics engine.
CQuaternion m_cInitOriginOrientation
void DisableAnchor(const std::string &str_id)
Disables an anchor.
virtual void AddPhysicsModel(const std::string &str_engine_id, CPhysicsModel &c_physics_model)
Adds a new physics model to this embodied entity.
bool IsAnchorEnabled(const std::string &str_id)
Returns true if the given anchor is enabled, false otherwise.
void RemovePhysicsModel(const std::string &str_engine_id)
Removes a physics model from this embodied entity.
CEmbodiedEntity(CComposableEntity *pc_parent)
Class constructor.
const SAnchor & GetAnchor(const std::string &str_id) const
Returns the wanted anchor as a const reference.
SAnchor & GetOriginAnchor()
Returns a non-const reference to the origin anchor associated to this entity.
const SBoundingBox & GetBoundingBox() const
Returns the bounding box of this embodied entity.
SAnchor * m_psOriginAnchor
bool IsMovable() const
Returns true if the entity is movable.
CPhysicsModel::TVector m_tPhysicsModelVector
std::map< std::string, SAnchor * > m_mapAnchors
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void CalculateBoundingBox()
Calculates the bounding box of this entity.
std::vector< SAnchor * > m_vecEnabledAnchors
virtual bool IsCollidingWithSomething() const
Returns true if this entity is colliding with another object.
virtual ~CEmbodiedEntity()
Class destructor.
const CPhysicsModel & GetPhysicsModel(size_t un_idx) const
Returns a physics model associated to this entity.
std::map< std::string, SAnchor * > & GetAnchors()
Returns a map of anchors associated to this embodied entity.
CVector3 m_cInitOriginPosition
UInt32 GetPhysicsModelsNum() const
Returns the number of physics models associated to this entity.
SBoundingBox * m_sBoundingBox
virtual bool MoveTo(const CVector3 &c_position, const CQuaternion &c_orientation, bool b_check_only=false, bool b_ignore_collisions=false)
Moves the entity to the wanted position and orientation.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
void SetMovable(bool b_movable)
Sets whether this entity is movable or not.
std::vector< SAnchor * > & GetEnabledAnchors()
Returns a vector of enabled anchors for fast looping.
CPhysicsModel::TMap m_tPhysicsModelMap
void EnableAnchor(const std::string &str_id)
Enables an anchor.
const SAnchor & GetOriginAnchor() const
Returns a const reference to the origin anchor associated to this entity.
SAnchor & AddAnchor(const std::string &str_id, const CVector3 &c_rel_position=CVector3(), const CQuaternion &c_rel_orientation=CQuaternion())
Adds an anchor to the embodied entity.
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
virtual bool operator()(CEmbodiedEntity &c_entity)
CEmbodiedEntityGridUpdater(CGrid< CEmbodiedEntity > &c_grid)
An anchor related to the body of an entity.
std::map< std::string, CPhysicsModel * > TMap
std::vector< CPhysicsModel * > TVector
The abstract definition of a space hash.
Defines the basic cell updater of the space hash.
Defines a very simple double-linked list that stores unique elements.