Resolved conflicts.
--- a/src/proto2/Physics.cc Tue Nov 18 18:50:32 2008 +0000
+++ b/src/proto2/Physics.cc Tue Nov 18 18:54:40 2008 +0000
@@ -30,8 +30,9 @@
Vector newPosition = position + velocity * PHYSICS_TICK_MS * 1000;
//TODO Handle the object as a square or a polygon
- if (newPosition.x < 0 || (newPosition.x > PHYSICS_WORLD_WIDTH)
- || (newPosition.y < 0) || (newPosition.y >= PHYSICS_WORLD_HEIGHT)) {
+
+ if(newPosition.x() < 0 || (newPosition.x() > PHYSICS_WORLD_WIDTH)
+ || (newPosition.y() < 0) || (newPosition.y() >= PHYSICS_WORLD_HEIGHT)) {
// CRASH!
this->velocity *= -1;
--- a/src/proto2/Vector.hh Tue Nov 18 18:50:32 2008 +0000
+++ b/src/proto2/Vector.hh Tue Nov 18 18:54:40 2008 +0000
@@ -3,6 +3,18 @@
#include <complex>
-typedef std::complex<float> Vector;
+class Vector : std::complex<float> {
+
+public:
+ Vector(float x, float y) : std::complex<float> (x, y) {}
+
+ float x() const {
+ return this->real();
+ }
+
+ float y() const {
+ return this->imag();
+ }
+};
#endif