Warning: include(php/utility.php): Failed to open stream: No such file or directory in /home/argos/argos3/doc/api/embedded/a00840_source.php on line 2

Warning: include(): Failed opening 'php/utility.php' for inclusion (include_path='.:/usr/lib64/php') in /home/argos/argos3/doc/api/embedded/a00840_source.php on line 2
The ARGoS Website

pointmass3d_box_model.cpp
Go to the documentation of this file.
1 
8 #include <argos3/core/utility/logging/argos_log.h>
9 #include <argos3/core/utility/math/box.h>
10 #include <argos3/core/simulator/simulator.h>
11 #include <argos3/core/simulator/space/space.h>
12 #include <argos3/plugins/simulator/physics_engines/pointmass3d/pointmass3d_engine.h>
13 
14 namespace argos {
15 
17  CBoxEntity& c_box) :
18  CPointMass3DModel(c_engine, c_box.GetEmbodiedEntity()),
19  m_cBoxEntity(c_box) {}
20 
21  /****************************************/
22  /****************************************/
23 
25  CVector3 cHalfSize = 0.5f * m_cBoxEntity.GetSize();
27  GetEmbodiedEntity().GetOriginAnchor().Position.GetX() - cHalfSize.GetX(),
31  GetEmbodiedEntity().GetOriginAnchor().Position.GetX() + cHalfSize.GetX(),
33  GetEmbodiedEntity().GetOriginAnchor().Position.GetZ() + m_cBoxEntity.GetSize().GetZ());
34  }
35 
36  /****************************************/
37  /****************************************/
38 
40  const CRay3& c_ray) const {
41  CBox m_cShape(m_cBoxEntity.GetSize(),
44  return m_cShape.Intersects(f_t_on_ray, c_ray);
45  }
46 
47  /****************************************/
48  /****************************************/
49 
51 
52  /****************************************/
53  /****************************************/
54 
55 }
A 3D vector class.
Definition: vector3.h:29
CPointMass3DBoxModel(CPointMass3DEngine &c_engine, CBoxEntity &c_box)
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
Real GetX() const
Returns the x coordinate of this vector.
Definition: vector3.h:93
Real GetY() const
Returns the y coordinate of this vector.
Definition: vector3.h:109
CQuaternion Orientation
The orientation of the anchor wrt the global coordinate system.
Definition: physics_model.h:53
void Set(const Real f_x, const Real f_y, const Real f_z)
Sets the vector contents from Cartesian coordinates.
Definition: vector3.h:143
virtual void CalculateBoundingBox()
Calculates the axis-aligned box that contains the entire physics model.
CEmbodiedEntity & GetEmbodiedEntity()
Returns the embodied entity associated to this physics model.
REGISTER_STANDARD_POINTMASS3D_OPERATIONS_ON_ENTITY(CEyeBotEntity, CPointMass3DEyeBotModel)
const SBoundingBox & GetBoundingBox() const
Returns an axis-aligned box that contains the physics model.
CVector3 Position
The position of the anchor wrt the global coordinate system.
Definition: physics_model.h:51
const CVector3 & GetSize() const
Definition: box_entity.h:80
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
Real GetZ() const
Returns the z coordinate of this vector.
Definition: vector3.h:125
bool Intersects(Real &f_t_on_ray, const CRay3 &c_ray)
Definition: box.cpp:9
virtual bool CheckIntersectionWithRay(Real &f_t_on_ray, const CRay3 &c_ray) const
const SAnchor & GetOriginAnchor() const
Returns a const reference to the origin anchor associated to this entity.