Dragonfly  4.3
A text-based game engine
Circle.h
1 ///
2 /// A 2d circle
3 ///
4 
5 #ifndef __CIRCLE_H__
6 #define __CIRCLE_H__
7 
8 #include "Vector.h"
9 
10 namespace df {
11 
12 class Circle {
13 
14  private:
15  Vector m_center; ///< Circle middle.
16  float m_radius; ///< Circle raduis.
17 
18  public:
19 
20  /// Create circle at center with radius r.
21  Circle(Vector init_center, float init_radius);
22 
23  /// Default circle segment is at (0,0) with radius 0.
24  Circle();
25 
26  void setCenter(Vector new_center); ///< Set center.
27  Vector getCenter() const; ///< Get center.
28  void setRadius(float new_radius); ///< Set radius.
29  float getRadius() const; ///< Get radius.
30 };
31 
32 } // end of namespace df
33 #endif //__CIRCLE_H__
void setCenter(Vector new_center)
Set center.
Definition: Circle.h:12
float m_radius
Circle raduis.
Definition: Circle.h:16
Circle()
Default circle segment is at (0,0) with radius 0.
A 2-d bounding box.
Definition: Box.h:10
Vector m_center
Circle middle.
Definition: Circle.h:15
Vector getCenter() const
Get center.
void setRadius(float new_radius)
Set radius.
float getRadius() const
Get radius.
Definition: Vector.h:10