1 #ifndef PYRAMIDWORKS_GEOMETRY_CONVEXPOLYGON_H_
2 #define PYRAMIDWORKS_GEOMETRY_CONVEXPOLYGON_H_
16 ConvexPolygon(
const std::vector<ugdk::math::Vector2D>& vertices);
18 void set_vertices(
const std::vector<ugdk::math::Vector2D>& vertices) { vertices_ = vertices; this->CalculateSize(); }
41 bool CheckAxisSeparation(
const std::vector<ugdk::math::Vector2D>& obj1,
const ugdk::math::Vector2D& obj1pos,
47 std::vector<ugdk::math::Vector2D> vertices_;
48 double bbox_half_width_, bbox_half_height_;
Definition: vector2D.h:18
void set_vertices(const std::vector< ugdk::math::Vector2D > &vertices)
Definition: convexpolygon.h:18
Definition: collisionclass.h:13
ConvexPolygon(const std::vector< ugdk::math::Vector2D > &vertices)
bool Intersects(const ugdk::math::Vector2D &this_pos, const GeometricShape *obj, const ugdk::math::Vector2D &that_pos) const
Checks if this shape intersects another shape.
ugdk::structure::Box< 2 > GetBoundingBox(const ugdk::math::Vector2D &position) const
Returns a bounding box for this shape.
Definition: geometricshape.h:13
A convex polygon, one type of GeometricShape. This determines a polygon conposed by at least 3 vertic...
Definition: convexpolygon.h:11
double bbox_width()
Definition: convexpolygon.h:26
double bbox_height()
Definition: convexpolygon.h:27