cylinder.h
Go to the documentation of this file.
1 
7 #ifndef CYLINDER_H
8 #define CYLINDER_H
9 
10 namespace argos {
11  class CCylinder;
12  class CRay3;
13 }
14 
15 #include <argos3/core/utility/math/vector3.h>
16 
17 namespace argos {
18 
19  class CCylinder {
20 
21  public:
22 
23  CCylinder(Real f_radius,
24  Real f_height,
25  const CVector3& c_base_pos = CVector3(),
26  const CVector3& c_axis = CVector3::Z) :
27  m_fRadius(f_radius),
28  m_fHeight(f_height),
29  m_cBasePos(c_base_pos),
30  m_cAxis(c_axis) {
31  }
32 
33  inline Real GetRadius() const {
34  return m_fRadius;
35  }
36 
37  inline void SetRadius(Real f_radius) {
38  m_fRadius = f_radius;
39  }
40 
41  inline Real GetHeight() const {
42  return m_fHeight;
43  }
44 
45  inline void SetHeight(Real f_height) {
46  m_fHeight = f_height;
47  }
48 
49  inline const CVector3& GetBasePosition() const {
50  return m_cBasePos;
51  }
52 
53  inline void SetBasePosition(const CVector3& c_base_pos) {
54  m_cBasePos = c_base_pos;
55  }
56 
57  inline const CVector3& GetAxis() const {
58  return m_cAxis;
59  }
60 
61  inline void SetAxis(const CVector3& c_axis) {
62  m_cAxis = c_axis;
63  }
64 
65  bool Intersects(Real& f_t_on_ray,
66  const CRay3& c_ray);
67 
68  private:
69 
70  Real m_fRadius;
71  Real m_fHeight;
72  CVector3 m_cBasePos;
73  CVector3 m_cAxis;
74 
75  };
76 }
77 
78 #endif
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
Real GetRadius() const
Definition: cylinder.h:33
bool Intersects(Real &f_t_on_ray, const CRay3 &c_ray)
Definition: cylinder.cpp:9
void SetHeight(Real f_height)
Definition: cylinder.h:45
CCylinder(Real f_radius, Real f_height, const CVector3 &c_base_pos=CVector3(), const CVector3 &c_axis=CVector3::Z)
Definition: cylinder.h:23
void SetBasePosition(const CVector3 &c_base_pos)
Definition: cylinder.h:53
Real GetHeight() const
Definition: cylinder.h:41
const CVector3 & GetAxis() const
Definition: cylinder.h:57
void SetRadius(Real f_radius)
Definition: cylinder.h:37
void SetAxis(const CVector3 &c_axis)
Definition: cylinder.h:61
const CVector3 & GetBasePosition() const
Definition: cylinder.h:49
A 3D vector class.
Definition: vector3.h:31
static const CVector3 Z
The z axis.
Definition: vector3.h:42