dynamics2d_single_body_object_model.h
Go to the documentation of this file.
1 
7 #ifndef DYNAMICS2D_SINGLE_BODY_OBJECT_MODEL_H
8 #define DYNAMICS2D_SINGLE_BODY_OBJECT_MODEL_H
9 
10 namespace argos {
11  class CDynamics2DSingleBodyObjectModel;
12 }
13 
14 #include <argos3/plugins/simulator/physics_engines/dynamics2d/dynamics2d_model.h>
15 #include <argos3/plugins/simulator/physics_engines/dynamics2d/chipmunk-physics/include/chipmunk.h>
16 
17 namespace argos {
18 
48 
49  public:
50 
58  CComposableEntity& c_entity);
59 
65 
71  return m_cEntity;
72  }
73 
78  inline const CComposableEntity& GetComposableEntity() const {
79  return m_cEntity;
80  }
81 
86  inline cpBody* GetBody() {
87  return m_ptBody;
88  }
89 
94  inline const cpBody* GetBody() const {
95  return m_ptBody;
96  }
97 
98  virtual void Reset();
99 
100  virtual void MoveTo(const CVector3& c_position,
101  const CQuaternion& c_orientation);
102 
103  virtual void CalculateBoundingBox();
104 
105  virtual void UpdateEntityStatus();
106 
107  virtual void UpdateFromEntityStatus() = 0;
108 
109  virtual bool IsCollidingWithSomething() const;
110 
133  virtual void SetBody(cpBody* pt_body,
134  Real f_height);
135 
139  void UpdateOriginAnchor(SAnchor& s_anchor);
140 
141  private:
142 
143  CComposableEntity& m_cEntity;
144  cpBody* m_ptBody;
145  };
146 
147 }
148 
149 #endif
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
Basic class for an entity that contains other entities.
An anchor related to the body of an entity.
Definition: physics_model.h:38
A 3D vector class.
Definition: vector3.h:31
The base class for models in the dynamics 2D engine.
Base class for object models with a single body.
CDynamics2DSingleBodyObjectModel(CDynamics2DEngine &c_engine, CComposableEntity &c_entity)
Class constructor.
cpBody * GetBody()
Returns the body as non-const pointer.
virtual void MoveTo(const CVector3 &c_position, const CQuaternion &c_orientation)
virtual void UpdateEntityStatus()
Updates the status of the associated entity.
CComposableEntity & GetComposableEntity()
Returns the associated composable entity as a non-const reference.
const CComposableEntity & GetComposableEntity() const
Returns the associated composable entity as a const reference.
void UpdateOriginAnchor(SAnchor &s_anchor)
Updates the origin anchor associated to the embodied entity.
virtual void SetBody(cpBody *pt_body, Real f_height)
Sets the body and registers the default origin anchor method.
virtual bool IsCollidingWithSomething() const
Returns true if this model is colliding with another model.
const cpBody * GetBody() const
Returns the body as const pointer.
virtual void CalculateBoundingBox()
Calculates the axis-aligned box that contains the entire physics model.
virtual void UpdateFromEntityStatus()=0
Updates the state of this model from the status of the associated entity.