Ocular Engine
Polygon2D.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_MATH_POLYGON_2D__H__
19 #define __H__OCULAR_MATH_POLYGON_2D__H__
20 
21 #include "Math/Vector2.hpp"
22 #include <vector>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Math
37  {
46  class Polygon2D
47  {
48  public:
49 
50  Polygon2D(std::vector<Point2f> const& points);
51  Polygon2D(Point2f const*, uint32_t numPoints);
52  ~Polygon2D();
53 
58 
65  float getSignedArea();
66 
67  protected:
68 
69  private:
70 
71  std::vector<Point2f> m_Points;
72 
73  Point2f m_Center;
74  bool m_CenterCalculated;
75 
76  float m_SignedArea;
77  bool m_SignedAreaCalculated;
78  };
79  }
83 }
88 //------------------------------------------------------------------------------------------
89 
90 #endif
float getSignedArea()
Definition: Polygon2D.cpp:109
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: Vector2.hpp:44
Definition: Polygon2D.hpp:46
Point2f getCenter()
Definition: Polygon2D.cpp:66