projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finished changes to deps directory building
[physics.git]
/
src
/
Entities
/
Polygon.cpp
diff --git
a/src/Entities/Polygon.cpp
b/src/Entities/Polygon.cpp
index
ecaf2c4
..
9f1aa43
100644
(file)
--- a/
src/Entities/Polygon.cpp
+++ b/
src/Entities/Polygon.cpp
@@
-16,9
+16,10
@@
*/
#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"
#include "graphics/graphics.h"
@@
-26,7
+27,7
@@
/// ***** Constructors/Destructors *****
Polygon::Polygon(const vector<Vector2>& points, const float* color)
/// ***** Constructors/Destructors *****
Polygon::Polygon(const vector<Vector2>& points, const float* color)
- : PhysicsEntity(Vector2(0,0)),
points(points),
color(color)
+ : PhysicsEntity(Vector2(0,0)),
m_points(points), m_
color(color)
{
DASSERT(0 < points.size());
{
DASSERT(0 < points.size());
@@
-42,24
+43,24
@@
Polygon::~Polygon()
void Polygon::draw() const
{
void Polygon::draw() const
{
- graphics::drawPolygon(
points,
color);
+ graphics::drawPolygon(
m_points, m_
color);
}
/// ***** Private Class Methods *****
void Polygon::createBindingBox()
{
}
/// ***** Private Class Methods *****
void Polygon::createBindingBox()
{
- DASSERT(0 < points.size());
+ DASSERT(0 <
m_
points.size());
- m
axP =
points.at(0);
- m
inP =
points.at(0);
+ m
_maxP = m_
points.at(0);
+ m
_minP = m_
points.at(0);
- for(unsigned int i=1; i<points.size(); i++)
+ for(unsigned int i=1; i<
m_
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(
m_points[i].m_fX < m_minP.m_fX) m_minP.m_fX = m_points[i].m_fX
;
+ else if(
m_points[i].m_fX > m_maxP.m_fX) m_maxP.m_fX = m_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(
m_points[i].m_fY < m_minP.m_fY) m_minP.m_fY = m_points[i].m_fY
;
+ else if(
m_points[i].m_fY > m_maxP.m_fY) m_maxP.m_fY = m_points[i].m_fY
;
}
}
}
}