/* * 2D Physic Engine * circle.h: * Based on pikuma.com Learn Game Physics Engine Programming course. * Copyright (c) 2022 986-Studio. All rights reserved. * * Created by Manoƫl Trapier on 18/07/2022. */ #ifndef PHYSICENGINE_SHAPE_CIRCLE_H #define PHYSICENGINE_SHAPE_CIRCLE_H #include #include #include struct circleShape: public shape { double radius; circleShape() = default; circleShape(const double radius) : radius(radius) {}; virtual ~circleShape() = default; shapeType getType() const override { return SHAPE_CIRCLE; } double getMomentOfInertial() const override { return 0.0; }; shape *clone() const override { return new circleShape(this->radius); }; void draw(const body &bod) override { graphics::draw::circle(bod.position.x, bod.position.y, this->radius, bod.rotation, bod.colour); }; }; #endif /* PHYSICENGINE_SHAPE_CIRCLE_H */