#include #include #include #include #include #include "debug.h" #include "exception.h" #include "object.h" using namespace JFK; using std::string; object::object() : id(0), x(0), y(0), dx(1), dy(0), v(0), w(0), r(0) { LOG(("JFK::object created %p", (void*)this)); } object::object(const object& o) : id(o.id), x(o.x), y(o.y), dx(o.dx), dy(o.dy), v(o.v), w(o.w), r(o.r) { LOG(("JFK::object created %p", (void*)this)); } object::~object() { LOG(("JFK::object destroyed %p", (void*)this)); } void object::move(double t) { x += v * dx * t; y += v * dy * t; double tmp = dx; dx = cos(w * t) * dx - sin(w * t) * dy; dy = cos(w * t) * dy + sin(w * t) * tmp; }