123456789101112131415161718192021222324252627 |
- /*
- * 2D Physic Engine
- * force.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 17/06/2022.
- */
- #ifndef PHYSICENGINE_FORCE_H
- #define PHYSICENGINE_FORCE_H
- #include <physics/vec2.h>
- #include <physics/body.h>
- class force
- {
- public:
- static vec2 generateFrictionForce(const body &bodyRef, double k);
- static vec2 generateDragForce(const body &bodyRef, double k);
- static vec2 generateGravitationalForce(const body &a, const body &b, double g,
- double minDistance = 0, double maxDistance = INFINITY);
- static vec2 generateSpringForce(const body &body, vec2 anchor, double restLength, double k);
- static vec2 generateSpringForce(const body &a, const body & b, double restLength, double k);
- };
- #endif /* PHYSICENGINE_FORCE_H */
|