123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /*
- * 2D Physic Engine
- * box.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_BOX_H
- #define PHYSICENGINE_SHAPE_BOX_H
- #include <vector>
- #include <physics/vec2.h>
- #include <physics/shapes/polygon.h>
- struct boxShape : public polygonShape
- {
- double width;
- double height;
- boxShape() = default;
- boxShape(double width, double height) : width(width), height(height)
- {
- };
- virtual ~boxShape() = default;
- shapeType getType() const override
- {
- return SHAPE_BOX;
- }
- double getMomentOfInertial() const override
- {
- return 0.0;
- };
- shape *clone() const override
- {
- return new boxShape(this->width, this->height);
- };
- };
- #endif /* PHYSICENGINE_SHAPE_BOX_H */
|