#ifndef _PHYSICS_CIRCLE_ #define _PHYSICS_CIRCLE_ #include "body.h" #include #include #define CIRCLE_POINTS 64 class Circle : public Body { public: Circle (const wgd::InstanceID &); void update(); void draw(); float getArea () const { return wgd::PI * getRadius() * getRadius(); } float getMinX (); float getMaxX (); float getMinY (); float getMaxY (); float getMomentOfInertia () const { return getMass() * getRadiusSq() / 2; } bool contains (const wgd::Vector2D& p); wgd::Vector2D getExtremePoint (const wgd::Vector2D& direction, int& i) const { i = 0; return position() + direction * getRadius(); } INSTANCE(Body, Circle, "circle"); private: static float draw_x[CIRCLE_POINTS]; static float draw_y[CIRCLE_POINTS]; }; #endif