plane.h
Go to the documentation of this file.
1 
7 #ifndef PLANE_H
8 #define PLANE_H
9 
10 namespace argos {
11  class CPlane;
12  class CRay3;
13 }
14 
15 #include <argos3/core/utility/math/vector3.h>
16 
17 namespace argos {
18 
19  class CPlane {
20 
21  public:
22 
23  CPlane() :
24  m_cNormal(CVector3::Z) {}
25 
26  CPlane(const CVector3& c_position,
27  const CVector3& c_normal) :
28  m_cPosition(c_position),
29  m_cNormal(c_normal) {}
30 
31  CPlane(const CVector3& c_point_1,
32  const CVector3& c_point_2,
33  const CVector3& c_point_3) {
34  SetFromThreePoints(c_point_1, c_point_2, c_point_3);
35  }
36 
37  ~CPlane() {}
38 
39  inline const CVector3& GetPosition() const {
40  return m_cPosition;
41  }
42 
43  inline void SetPosition(const CVector3& c_position) {
44  m_cPosition = c_position;
45  }
46 
47  inline const CVector3& GetNormal() const {
48  return m_cNormal;
49  }
50 
51  inline void SetNormal(const CVector3& c_normal) {
52  m_cNormal = c_normal;
53  }
54 
55  void SetFromThreePoints(const CVector3& c_point_1,
56  const CVector3& c_point_2,
57  const CVector3& c_point_3);
58 
59  bool Intersects(Real& f_t_on_ray,
60  const CRay3& c_ray);
61 
62  private:
63 
64  CVector3 m_cPosition;
65  CVector3 m_cNormal;
66 
67  };
68 
69 }
70 
71 #endif
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
bool Intersects(Real &f_t_on_ray, const CRay3 &c_ray)
Definition: plane.cpp:21
const CVector3 & GetPosition() const
Definition: plane.h:39
CPlane(const CVector3 &c_position, const CVector3 &c_normal)
Definition: plane.h:26
void SetFromThreePoints(const CVector3 &c_point_1, const CVector3 &c_point_2, const CVector3 &c_point_3)
Definition: plane.cpp:9
void SetNormal(const CVector3 &c_normal)
Definition: plane.h:51
const CVector3 & GetNormal() const
Definition: plane.h:47
void SetPosition(const CVector3 &c_position)
Definition: plane.h:43
CPlane(const CVector3 &c_point_1, const CVector3 &c_point_2, const CVector3 &c_point_3)
Definition: plane.h:31
A 3D vector class.
Definition: vector3.h:31