X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?p=physics.git;a=blobdiff_plain;f=src%2FEntities%2FPolygon.cpp;h=bf2fb0021bd8f6c70bb54024a8f54a36fb99dc53;hp=42cfbdbc71331b530ee87e0d0eb832187ea33583;hb=4a76d2e2cf7874e54a4e6688ebf1fa8ca59ce8c1;hpb=002fd13cf3966163e9a7b48ae43f4812661e1cc1 diff --git a/src/Entities/Polygon.cpp b/src/Entities/Polygon.cpp index 42cfbdb..bf2fb00 100644 --- a/src/Entities/Polygon.cpp +++ b/src/Entities/Polygon.cpp @@ -16,15 +16,20 @@ */ #include "Polygon.h" +#include "debug.h" #include "Vector2.h" +#include "graphics/graphics.h" + /// ***** Constructors/Destructors ***** -Polygon::Polygon(const Vector2& pos, vector points) - : PhysicsEntity(pos), points(points) +Polygon::Polygon(const vector& points) + : PhysicsEntity(Vector2(0,0)), points(points) { + DASSERT(0 < points.size()); + createBindingBox(); } Polygon::~Polygon() @@ -36,7 +41,7 @@ Polygon::~Polygon() void Polygon::draw() const { - // TODO + graphics::drawPolygon(points); } /// ***** Private Class Methods *****