michal34512 / MK_Engine

Simple SFML physic engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

About

Simple SFML physic engine

License:MIT License


Languages

Language:C++ 96.5%Language:CMake 3.5%Language:Batchfile 0.0%Language:C 0.0%