UGDK
|
#include <convexpolygon.h>
Public Member Functions | |
ConvexPolygon (const std::vector< ugdk::Vector2D > &vertices) | |
void | set_vertices (const std::vector< ugdk::Vector2D > &vertices) |
bool | Intersects (const ugdk::Vector2D &this_pos, const GeometricShape *obj, const ugdk::Vector2D &that_pos) const |
Checks if this shape intersects another shape. | |
bool | Intersects (const ugdk::Vector2D &this_pos, const Rect *obj, const ugdk::Vector2D &that_pos) const |
Checks if there's an intersection with a Rect. | |
bool | Intersects (const ugdk::Vector2D &this_pos, const Circle *obj, const ugdk::Vector2D &that_pos) const |
Checks if there's an intersection with a Circle. | |
bool | Intersects (const ugdk::Vector2D &this_pos, const ConvexPolygon *obj, const ugdk::Vector2D &that_pos) const |
Checks if there's an intersection with a Convex Polygon. | |
ugdk::ikdtree::Box< 2 > | GetBoundingBox (const ugdk::Vector2D &position) const |
Returns a bounding box for this shape. | |
double | bbox_width () |
double | bbox_height () |
pyramidworks::geometry::ConvexPolygon::ConvexPolygon | ( | const std::vector< ugdk::Vector2D > & | vertices | ) |
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] |
ugdk::ikdtree::Box< 2 > pyramidworks::geometry::ConvexPolygon::GetBoundingBox | ( | const ugdk::Vector2D & | position | ) | const [virtual] |
Returns a bounding box for this shape.
The box is at the shape's position and offset
position | The absolute position for this shape. |
Implements pyramidworks::geometry::GeometricShape.
bool pyramidworks::geometry::ConvexPolygon::Intersects | ( | const ugdk::Vector2D & | this_pos, |
const GeometricShape * | obj, | ||
const ugdk::Vector2D & | that_pos | ||
) | const [virtual] |
Checks if this shape intersects another shape.
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
Implements pyramidworks::geometry::GeometricShape.
bool pyramidworks::geometry::ConvexPolygon::Intersects | ( | const ugdk::Vector2D & | this_pos, |
const Rect * | obj, | ||
const ugdk::Vector2D & | that_pos | ||
) | const [virtual] |
Checks if there's an intersection with a Rect.
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
Implements pyramidworks::geometry::GeometricShape.
bool pyramidworks::geometry::ConvexPolygon::Intersects | ( | const ugdk::Vector2D & | this_pos, |
const Circle * | obj, | ||
const ugdk::Vector2D & | that_pos | ||
) | const [virtual] |
Checks if there's an intersection with a Circle.
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
Implements pyramidworks::geometry::GeometricShape.
bool pyramidworks::geometry::ConvexPolygon::Intersects | ( | const ugdk::Vector2D & | this_pos, |
const ConvexPolygon * | obj, | ||
const ugdk::Vector2D & | that_pos | ||
) | const [virtual] |
Checks if there's an intersection with a Convex Polygon.
this_pos | The absolute position for this shape. |
obj | The shape to compare with. |
that_pos | The absolute position of the other shape. |
Implements pyramidworks::geometry::GeometricShape.
void pyramidworks::geometry::ConvexPolygon::set_vertices | ( | const std::vector< ugdk::Vector2D > & | vertices | ) | [inline] |