projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed non-used argument, compiler warnings
[physics.git]
/
src
/
Entities
/
Polygon.cpp
diff --git
a/src/Entities/Polygon.cpp
b/src/Entities/Polygon.cpp
index
cd03d85
..
4b3826e
100644
(file)
--- a/
src/Entities/Polygon.cpp
+++ b/
src/Entities/Polygon.cpp
@@
-16,17
+16,18
@@
*/
#include "Polygon.h"
*/
#include "Polygon.h"
-#include "debug.h"
-#include "Vector2.h"
+#include <bear/debug.h>
+#include <bear/Vector2.h>
+using namespace bear;
#include "graphics/graphics.h"
/// ***** Constructors/Destructors *****
#include "graphics/graphics.h"
/// ***** Constructors/Destructors *****
-Polygon::Polygon(const vector<Vector2>& points)
- : PhysicsEntity(Vector2(0,0)), points(points)
+Polygon::Polygon(const vector<Vector2>& points
, const float* color
)
+ : PhysicsEntity(Vector2(0,0)), points(points)
, color(color)
{
DASSERT(0 < points.size());
{
DASSERT(0 < points.size());
@@
-42,7
+43,7
@@
Polygon::~Polygon()
void Polygon::draw() const
{
void Polygon::draw() const
{
- graphics::drawPolygon(points);
+ graphics::drawPolygon(points
, color
);
}
/// ***** Private Class Methods *****
}
/// ***** Private Class Methods *****
@@
-55,11
+56,11
@@
void Polygon::createBindingBox()
for(unsigned int i=1; i<points.size(); i++)
{
for(unsigned int i=1; i<points.size(); i++)
{
- if(points[i].
x < minP.x) minP.x = points[i].x
;
- else if(points[i].
x > maxP.x) maxP.x = points[i].x
;
+ if(points[i].
m_fX < minP.m_fX) minP.m_fX = points[i].m_fX
;
+ else if(points[i].
m_fX > maxP.m_fX) maxP.m_fX = points[i].m_fX
;
- if(points[i].
y < minP.y) minP.y = points[i].y
;
- else if(points[i].
y > maxP.y) maxP.y = points[i].y
;
+ if(points[i].
m_fY < minP.m_fY) minP.m_fY = points[i].m_fY
;
+ else if(points[i].
m_fY > maxP.m_fY) maxP.m_fY = points[i].m_fY
;
}
}
}
}