A modular and efficient 2D physics simulation engine supporting Euler and Verlet integration methods. The simulator features complete separation of physics and rendering processes, ensuring smooth and accurate simulations independent of rendering performance.
Simulation.mp4
- Integration Methods: Supports both Euler and Verlet integration.
- Interpolation: Implements physics interpolation using an interpolation factor, allowing smooth rendering of objects between physics updates.
- Collision Detection: Includes collision detection with a bounding box.
- Basic Forces:
- Gravity
- Air Resistance
- High Modularity: Key functions are encapsulated in separate classes. Modular parts are implemented as virtual classes to enable easy customization and extensibility.
- Spatial Hash Grid (WIP): Efficient collision handling between particles is under development.
- FPS Independence: Rendering frame rate does not affect the physics frame rate.
- Bounding Box Visualization: Includes a grid rendering for visualizing the bounding box.
- SDL3 for rendering [https://github.com/libsdl-org/SDL/releases]
- SDL3 TTF. Install from [https://github.com/libsdl-org/SDL_ttf]
glmfor vector math. Install usingsudo apt install -y libglm-devspdlogfor logging. Install usingsudo apt install -y libspdlog-dev
- Implement Euler and Verlet integration.
- Add bounding box collision detection.
- Separate physics and rendering processes.
- Implement spatial hash grid for particle-particle collision.
- Extend force system for custom forces.
- Add support for more complex shapes and constraints.