shape.h 647 B

123456789101112131415161718192021222324252627282930313233
  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. #include <physics/body.h>
  12. class body;
  13. enum shapeType
  14. {
  15. SHAPE_CIRCLE,
  16. SHAPE_BOX,
  17. SHAPE_POLYGON,
  18. };
  19. struct shape
  20. {
  21. virtual ~shape() = default;
  22. virtual shapeType getType() const = 0;
  23. virtual double getMomentOfInertial() const = 0;
  24. virtual shape *clone() const = 0;
  25. virtual void draw(const body &bod) = 0;
  26. };
  27. #endif /* PHYSICENGINE_SHAPE_H */