32 #ifndef DOXYGEN_SHOULD_SKIP_THIS 72 template<
typename Iterator>
98 Vector2f
getPoint(std::size_t index)
const;
124 Vector2f
getSupport(Vector2f direction)
const;
133 const Vector2f *
begin()
const;
142 const Vector2f *
end()
const;
183 std::vector<Vector2f> m_points;
186 #ifndef DOXYGEN_SHOULD_SKIP_THIS Polygon(Iterator first, Iterator last)
Constructor from points.
Definition: Polygon.h:73
bool isConvex() const
Check if the polygon is convex.
std::size_t getPointCount() const
Get the number of points of the polygon.
const Vector2f * end() const
Get an iterator past the last point.
Winding getWinding() const
Compute the winding of a convex polygon.
Vector2f getSupport(Vector2f direction) const
Get the farthest point in a direction.
Polygon(ArrayRef< Vector2f > points)
Constructor from an array.
const Vector2f * begin() const
Get an iterator to the first point.
void applyTransform(const Matrix3f &mat)
Apply a transformation to the polygon.
Vector2f getSupport(Vector2f direction, const Transform &transform) const
Get the farthest point in a direction.
void addPoint(Vector2f point)
Add a point to the polygon.
Vector2f getCenter() const
Get the center of the polygon.
The namespace for gf classes.
Definition: Action.h:34
A constant reference to an array and its size.
Definition: ArrayRef.h:42
A convex polygon.
Definition: Polygon.h:52
Opposite direction of a clock's hands.
Vector2f getPoint(std::size_t index) const
Get the i-th point of the polygon.
Polygon()=default
Default constructor.
#define GF_API
Definition: Portability.h:35
Winding
The direction of a polygon's rotation.
Definition: Polygon.h:42
float getArea() const
Compute the area of the polygon.
Same direction as a clock's hands.