shape.h 563 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * 2D Physic Engine
  3. * shape.h:
  4. * Based on pikuma.com Learn Game Physics Engine Programming course.
  5. * Copyright (c) 2022 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 18/07/2022.
  8. */
  9. #ifndef PHYSICENGINE_SHAPE_H
  10. #define PHYSICENGINE_SHAPE_H
  11. enum shapeType
  12. {
  13. SHAPE_CIRCLE,
  14. SHAPE_BOX,
  15. SHAPE_POLYGON,
  16. };
  17. struct shape
  18. {
  19. virtual ~shape() = default;
  20. virtual shapeType getType() const = 0;
  21. virtual double getMomentOfInertial() const = 0;
  22. virtual shape *clone() const = 0;
  23. };
  24. #endif /* PHYSICENGINE_SHAPE_H */