1234567891011121314151617181920212223242526272829303132333435363738 |
- /*
- * 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 <physics/shape.h>
- 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);
- };
- };
- #endif /* PHYSICENGINE_SHAPE_CIRCLE_H */
|