force.h 731 B

12345678910111213141516171819202122232425
  1. /*
  2. * 2D Physic Engine
  3. * force.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 17/06/2022.
  8. */
  9. #ifndef PHYSICENGINE_FORCE_H
  10. #define PHYSICENGINE_FORCE_H
  11. #include <physics/vec2.h>
  12. #include <physics/particle.h>
  13. class force
  14. {
  15. public:
  16. static vec2 generateFrictionForce(const particle &particleRef, double k);
  17. static vec2 generateDragForce(const particle &particleRef, double k);
  18. static vec2 generateGravitationalForce(const particle &a, const particle &b, double g,
  19. double minDistance = 0, double maxDistance = INFINITY);
  20. };
  21. #endif /* PHYSICENGINE_FORCE_H */