1
SFML projects / Simple Fast SFML Physics
« on: April 26, 2022, 07:17:33 pm »
I have written a VERY simple physics library that is designed to be used with SFML. At its highest level it has pre-integrated physics shape classes. The API is designed to be easy and mimics the SFML pointerless API approach.
Right now it ONLY handles AABBs and circular bounds and that is all I expect to add to it myself. It has "PhysicsShape" classes right now for RectangleShape and CircleShape. I do intend to add similar wrappers for the other SFML shape classes soon.
There is NO documentation yet, sorry, I'll get to it when the examples and features are done. There is however a working breakout example.
The library is available on github as https://github.com/profK/SFPhysics and as a nuget package at https://www.nuget.org/packages/SFPhysics/
The breakout example is also in github at https://github.com/profK/Breakout2
The actual code for collision detection and response is heavily borrowed from:
https://gamedevelopment.tutsplus.com/tutorials/how-to-create-a-custom-2d-physics-engine-the-basics-and-impulse-resolution--gamedev-6331
I should note that, although individual collision resolutions are very fast, it over-all scales at O(n^2). Optimizations are on the dev list.
Right now it ONLY handles AABBs and circular bounds and that is all I expect to add to it myself. It has "PhysicsShape" classes right now for RectangleShape and CircleShape. I do intend to add similar wrappers for the other SFML shape classes soon.
There is NO documentation yet, sorry, I'll get to it when the examples and features are done. There is however a working breakout example.
The library is available on github as https://github.com/profK/SFPhysics and as a nuget package at https://www.nuget.org/packages/SFPhysics/
The breakout example is also in github at https://github.com/profK/Breakout2
The actual code for collision detection and response is heavily borrowed from:
https://gamedevelopment.tutsplus.com/tutorials/how-to-create-a-custom-2d-physics-engine-the-basics-and-impulse-resolution--gamedev-6331
I should note that, although individual collision resolutions are very fast, it over-all scales at O(n^2). Optimizations are on the dev list.