https://github.com/michal34512/mk_engine
Simple SFML physic engine
https://github.com/michal34512/mk_engine
collision-detection collisions friction physics-engine rotations sfml user-friendly
Last synced: 10 months ago
JSON representation
Simple SFML physic engine
- Host: GitHub
- URL: https://github.com/michal34512/mk_engine
- Owner: michal34512
- License: mit
- Created: 2023-06-17T17:41:38.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-14T13:07:48.000Z (almost 3 years ago)
- Last Synced: 2025-04-08T11:17:46.129Z (about 1 year ago)
- Topics: collision-detection, collisions, friction, physics-engine, rotations, sfml, user-friendly
- Language: C++
- Homepage:
- Size: 6.24 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MK_Engine
The aim of this project was to create a user-friendly physics engine based on the SFML library.
# Calculating collision response
Engine uses widely known formula to calculate collision impulse (that is the collision force with is later applied to colliding objects):
e - greater of the two coefficients of restitution
VAB - the difference between velocities of the objects at the point of collision
massA, massB - objects masses
IA, IB - moments of inertia
rA, rB - vectors from the centers of the objects to the point of collision
t - collision normal
Next the collision impulse is being applied to both objects according to the equations:
Demo preview: