projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hacks that make a polygon draw
[physics.git]
/
src
/
Entities
/
Polygon.cpp
diff --git
a/src/Entities/Polygon.cpp
b/src/Entities/Polygon.cpp
index
42cfbdb
..
bf2fb00
100644
(file)
--- a/
src/Entities/Polygon.cpp
+++ b/
src/Entities/Polygon.cpp
@@
-16,15
+16,20
@@
*/
#include "Polygon.h"
*/
#include "Polygon.h"
+#include "debug.h"
#include "Vector2.h"
#include "Vector2.h"
+#include "graphics/graphics.h"
+
/// ***** Constructors/Destructors *****
/// ***** Constructors/Destructors *****
-Polygon::Polygon(const
Vector2& pos, vector<Vector2>
points)
- : PhysicsEntity(
pos
), points(points)
+Polygon::Polygon(const
vector<Vector2>&
points)
+ : PhysicsEntity(
Vector2(0,0)
), points(points)
{
{
+ DASSERT(0 < points.size());
+
createBindingBox();
}
Polygon::~Polygon()
createBindingBox();
}
Polygon::~Polygon()
@@
-36,7
+41,7
@@
Polygon::~Polygon()
void Polygon::draw() const
{
void Polygon::draw() const
{
- // TODO
+ graphics::drawPolygon(points);
}
/// ***** Private Class Methods *****
}
/// ***** Private Class Methods *****