# HG changeset patch # User saiam # Date 1227034480 0 # Node ID 360208b631c11bb55fe5ade072a912a6ddd80a83 # Parent 9e1a6506f5a1ddce7effddd65b7d982668e56d47 Resolved conflicts. diff -r 9e1a6506f5a1 -r 360208b631c1 src/proto2/Physics.cc --- 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; diff -r 9e1a6506f5a1 -r 360208b631c1 src/proto2/Vector.hh --- 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 -typedef std::complex Vector; +class Vector : std::complex { + +public: + Vector(float x, float y) : std::complex (x, y) {} + + float x() const { + return this->real(); + } + + float y() const { + return this->imag(); + } +}; #endif