A convex polygon, one type of GeometricShape. This determines a polygon conposed by at least 3 vertices.
More...
#include <pyramidworks/geometry/convexpolygon.h>
A convex polygon, one type of GeometricShape. This determines a polygon conposed by at least 3 vertices.
pyramidworks::geometry::ConvexPolygon::ConvexPolygon |
( |
const std::vector< ugdk::math::Vector2D > & |
vertices | ) |
|
- Parameters
-
vertices | The list of vertices of the polygon, in local coordinates (0,0 is the "center", where this polygon is positioned). vertices[i] and vertices[i+1] form a edge, and vertices[n]-vertices[0] is the closing edge. |
double pyramidworks::geometry::ConvexPolygon::bbox_height |
( |
| ) |
|
|
inline |
double pyramidworks::geometry::ConvexPolygon::bbox_width |
( |
| ) |
|
|
inline |
Returns a bounding box for this shape.
The box is at the shape's position and offset
- Parameters
-
position | The absolute position for this shape. |
- Returns
- A 2D Box around this shape
Implements pyramidworks::geometry::GeometricShape.
Checks if this shape intersects another shape.
- Parameters
-
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
- Returns
- True if there's an intersection.
Implements pyramidworks::geometry::GeometricShape.
Checks if there's an intersection with a Rect.
- Parameters
-
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
- Returns
- True if there's an intersection.
Implements pyramidworks::geometry::GeometricShape.
Checks if there's an intersection with a Circle.
- Parameters
-
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
- Returns
- True if there's an intersection.
Implements pyramidworks::geometry::GeometricShape.
Checks if there's an intersection with a Convex Polygon.
- Parameters
-
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
- Returns
- True if there's an intersection.
Implements pyramidworks::geometry::GeometricShape.
void pyramidworks::geometry::ConvexPolygon::set_vertices |
( |
const std::vector< ugdk::math::Vector2D > & |
vertices | ) |
|
|
inline |
The documentation for this class was generated from the following file: