Dragonfly  4.3
A text-based game engine
Line.h
1 ///
2 /// A line segment
3 ///
4 
5 #ifndef __LINE_H__
6 #define __LINE_H__
7 
8 #include "Vector.h"
9 
10 namespace df {
11 
12 class Line {
13 
14  private:
15  Vector m_p1; ///< First endpoint.
16  Vector m_p2; ///< Second endpoint.
17 
18  public:
19 
20  /// Create line segment from p1 to p2.
21  Line(Vector init_p1, Vector init_p2);
22 
23  /// Default line segment is at (0,0).
24  Line();
25 
26  void setP1(Vector new_p1); ///< Set first endpoint.
27  Vector getP1() const; ///< Get first endpoint.
28  void setP2(Vector new_p2); ///< Set second endpoint.
29  Vector getP2() const; ///< Get second endpoint.
30 };
31 
32 } // end of namespace df
33 #endif //__LINE_H__
Definition: Line.h:12
Vector m_p1
First endpoint.
Definition: Line.h:15
A 2-d bounding box.
Definition: Box.h:10
Line()
Default line segment is at (0,0).
void setP1(Vector new_p1)
Set first endpoint.
Vector getP1() const
Get first endpoint.
Vector m_p2
Second endpoint.
Definition: Line.h:16
Vector getP2() const
Get second endpoint.
Definition: Vector.h:10
void setP2(Vector new_p2)
Set second endpoint.