123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /*
- * 2D Physic Engine
- * polygon.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_POLYGON_H
- #define PHYSICENGINE_SHAPE_POLYGON_H
- #include <vector>
- #include <physics/vec2.h>
- #include <physics/shape.h>
- struct polygonShape: public shape
- {
- std::vector<vec2> vertices;
- polygonShape() = default;
- polygonShape(const std::vector<vec2> vertices)
- {
- };
- virtual ~polygonShape() = default;
- shapeType getType() const override
- {
- return SHAPE_CIRCLE;
- }
- double getMomentOfInertial() const override
- {
- return 0.0;
- };
- shape *clone() const override
- {
- return new polygonShape(this->vertices);
- };
- };
- #endif /* PHYSICENGINE_SHAPE_POLYGON_H */
|