6 #ifndef GDCORE_POLYGON_H
7 #define GDCORE_POLYGON_H
10 #include "GDCore/Vector2.h"
27 mutable std::vector<gd::Vector2f>
38 const std::vector<gd::Vector2f>&
GetVertices()
const {
return vertices; }
46 void Move(
double x,
double y);
56 void Rotate(
double angle);
61 void ComputeEdges()
const;
67 bool IsConvex()
const;
81 static Polygon2d CreateRectangle(
double width,
double height);
Represents a polygon. Usually used for collisions masks.
Definition: Polygon2d.h:21
std::vector< gd::Vector2f > & GetVertices()
Get the vertices composing the polygon.
Definition: Polygon2d.h:33
const std::vector< gd::Vector2f > & GetVertices() const
Get the vertices composing the polygon.
Definition: Polygon2d.h:38
std::vector< gd::Vector2f > edges
Edges. Can be computed from vertices using ComputeEdges()
Definition: Polygon2d.h:28
std::vector< gd::Vector2f > vertices
The vertices composing the polygon.
Definition: Polygon2d.h:24
Utility template class for manipulating 2-dimensional vectors.
Definition: Vector2.h:40