ARGoS  3
A parallel, multi-engine simulator for swarm robotics
pointmass3d_cylinder_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/cylinder.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  CCylinderEntity& c_cylinder) :
18  CPointMass3DModel(c_engine, c_cylinder.GetEmbodiedEntity()),
19  m_cCylinderEntity(c_cylinder) {}
20 
21  /****************************************/
22  /****************************************/
23 
26  GetEmbodiedEntity().GetOriginAnchor().Position.GetX() - m_cCylinderEntity.GetRadius(),
27  GetEmbodiedEntity().GetOriginAnchor().Position.GetY() - m_cCylinderEntity.GetRadius(),
28  GetEmbodiedEntity().GetOriginAnchor().Position.GetZ());
30  GetEmbodiedEntity().GetOriginAnchor().Position.GetX() + m_cCylinderEntity.GetRadius(),
31  GetEmbodiedEntity().GetOriginAnchor().Position.GetY() + m_cCylinderEntity.GetRadius(),
32  GetEmbodiedEntity().GetOriginAnchor().Position.GetZ() + m_cCylinderEntity.GetHeight());
33  }
34 
35  /****************************************/
36  /****************************************/
37 
39  const CRay3& c_ray) const {
40  CCylinder m_cShape(m_cCylinderEntity.GetRadius(),
41  m_cCylinderEntity.GetHeight(),
42  GetEmbodiedEntity().GetOriginAnchor().Position,
43  CVector3::Z);
44  return m_cShape.Intersects(f_t_on_ray, c_ray);
45  }
46 
47  /****************************************/
48  /****************************************/
49 
51 
52  /****************************************/
53  /****************************************/
54 
55 }
argos::CVector3::Set
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
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CCylinder
Definition: cylinder.h:19
argos::SBoundingBox::MinCorner
CVector3 MinCorner
Definition: physics_model.h:88
argos::SBoundingBox::MaxCorner
CVector3 MaxCorner
Definition: physics_model.h:89
argos::CRay3
Definition: ray3.h:19
argos::CVector3::Z
static const CVector3 Z
The z axis.
Definition: vector3.h:40
argos::CCylinderEntity::GetHeight
Real GetHeight() const
Definition: cylinder_entity.h:84
argos::CPointMass3DCylinderModel::CalculateBoundingBox
virtual void CalculateBoundingBox()
Calculates the axis-aligned box that contains the entire physics model.
Definition: pointmass3d_cylinder_model.cpp:24
argos::CPointMass3DModel
Definition: pointmass3d_model.h:21
argos::CPointMass3DCylinderModel
Definition: pointmass3d_cylinder_model.h:22
argos::CCylinderEntity::GetRadius
Real GetRadius() const
Definition: cylinder_entity.h:76
argos::CCylinder::Intersects
bool Intersects(Real &f_t_on_ray, const CRay3 &c_ray)
Definition: cylinder.cpp:9
argos::CPointMass3DCylinderModel::CheckIntersectionWithRay
virtual bool CheckIntersectionWithRay(Real &f_t_on_ray, const CRay3 &c_ray) const
Definition: pointmass3d_cylinder_model.cpp:38
argos::CCylinderEntity
Definition: cylinder_entity.h:23
argos::CPhysicsModel::GetBoundingBox
const SBoundingBox & GetBoundingBox() const
Returns an axis-aligned box that contains the physics model.
Definition: physics_model.h:198
argos::CPointMass3DCylinderModel::CPointMass3DCylinderModel
CPointMass3DCylinderModel(CPointMass3DEngine &c_engine, CCylinderEntity &c_cylinder)
Definition: pointmass3d_cylinder_model.cpp:16
argos::CPointMass3DEngine
Definition: pointmass3d_engine.h:22
pointmass3d_cylinder_model.h
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
argos::REGISTER_STANDARD_POINTMASS3D_OPERATIONS_ON_ENTITY
REGISTER_STANDARD_POINTMASS3D_OPERATIONS_ON_ENTITY(CEyeBotEntity, CPointMass3DEyeBotModel)
argos::CPhysicsModel::GetEmbodiedEntity
CEmbodiedEntity & GetEmbodiedEntity()
Returns the embodied entity associated to this physics model.
Definition: physics_model.h:133