Snaps is a 2D physics engine where every object ultimately "snaps" to a grid.
Its purpose is to enable 2D tile-based games to have smooth and reasonably realistic physics.
🚧 This project is currently a work in progress 🚧
- Collision detection and resolution
- Velocity, Acceleration and Forces
- Friction and Drag
Planned but not ready
- Fluid simulation
- Gas simulation
- Constraints
This project uses CMake to generate project files.
git clone https://github.com/KyrietS/Snaps.git
cmake -S Snaps -B Snaps-build
cmake --build Snaps-buildTests are written using Google Test. The library is fetched automatically by CMake during the configuration step.
There are special type of tests called Scene Tests. They simulate a physical world for a number of steps and make assertions on the way. Such tests have a graphical preview with debugging interface.
The preview opens up automatically when a scene test fails. This behavior can be overridden by a user.
Copyright © 2025 Sebastian Fojcik
Use of this software is granted under the terms of the MIT License.
See the LICENCE for the full license text.
