4 * Created on: Apr 9, 2012
11 #include "../geometry/constants.h"
14 #include <SDL/SDL_gfxPrimitives.h>
23 : Entity(&shape, 4 * PI * r * r * r / 3)
29 void Ball::Render(SDL_Surface *screen) const {
30 circleRGBA(screen, shape.Center().X(), shape.Center().Y(), shape.Radius(), 0xFF, 0xFF, 0xFF, 0xFF);
31 Vector angle(Vector(0, 1).Rotate(Angle()) * shape.Radius() + Origin());
32 lineRGBA(screen, shape.Center().X(), shape.Center().Y(), angle.X(), angle.Y(), 0xFF, 0xFF, 0xFF, 0xFF);