https://github.com/erayzesen/QuarkPhysics
A 2D Soft Body and Rigid Body Physics Engine.
https://github.com/erayzesen/QuarkPhysics
2d-physics-engine game-development physics-engine physics-simulation rigid-bodies soft-bodies
Last synced: 3 months ago
JSON representation
A 2D Soft Body and Rigid Body Physics Engine.
- Host: GitHub
- URL: https://github.com/erayzesen/QuarkPhysics
- Owner: erayzesen
- License: mit
- Created: 2023-04-30T23:12:52.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-10-17T06:34:37.000Z (4 months ago)
- Last Synced: 2025-10-18T09:44:36.878Z (4 months ago)
- Topics: 2d-physics-engine, game-development, physics-engine, physics-simulation, rigid-bodies, soft-bodies
- Language: C++
- Homepage:
- Size: 122 MB
- Stars: 262
- Watchers: 4
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-cpp - QuarkPhysics - A 2D Soft Body and Rigid Body Physics Engine. [MIT] (Physics)
- awesome-cpp - QuarkPhysics - A 2D Soft Body and Rigid Body Physics Engine. [MIT] (Physics)
README

QuarkPhysics is a 2D physics engine designed for games. Its goal is to provide a reasonable approach to simulate rigid bodies, soft bodies, and different physics models together.
[Documentation](https://erayzesen.github.io/QuarkPhysics/documentation/) | [Examples](https://github.com/erayzesen/QuarkPhysics/tree/master/examples)
---

Show Examples





## Features
* General Features
* Primitive shape types (circle, polygon, rectangle, etc.)
* Physical properties (mass, area, restitution, etc.)
* The API is designed specifically for 2D video games.
* Raycasting
* Collision layer masks for advanced collision filtering
* SAP for broadphase
* Supports sleeping islands to improve CPU performance.
* Flexible and advanced event system.
* Supports UV mapping with QMesh for rendering operations.
* It uses pixels directly as a unit without any abstractions.
* Unlimited shape-mesh support for bodies.
* Simple and consistent API
* Rigid bodies
* Convex polygons support.
* Joints to connect bodies.
* Reasonable stability for stacked objects.
* Kinematic bodies for creating controllable physics objects.
* Area bodies for detecting and reporting collisions.
* Soft Bodies
* Springs to connect particles.
* Mass-spring model.
* Area-volume preserving model.
* Shape matching features.
* Self collisions.
* PBD dynamics.
* Internal springs and internal particles for adding more complexity to soft body simulations.
* Customizable constraints for adding more control to simulations.
* Advanced particle methods.
## Building Examples
You need to install [SFML 2.x](https://www.sfml-dev.org/) and [CMake](https://cmake.org/) on your system before.
Download project, enter the main folder, and call this:
./build.sh -r
Or you can compile the project directly via gcc if you're on linux by calling this:
./run_linux_fast.sh -r
## Using
Copy the "QuarkPhysics" named subfolder in the main folder to your project and use it.
## Integrated Game Engines
* [Godot Engine](https://github.com/erayzesen/godot-quarkphysics)
## Third Party
- [nlohmann's json](https://github.com/nlohmann/json) for the json parsing. (Importing meshes via *.qmesh files)
- [ivanfratric's polypartition](https://github.com/ivanfratric/polypartition) for the convex polygon partition operations
- [SFML](https://www.sfml-dev.org/) library for window,input,opengl.
- [Doxygen-Awsome](https://jothepro.github.io/doxygen-awesome-css/) for the custom themed documentation.
## Roadmap
* ~~1.0~~
* ~~API revisions~~ (v0.9x)
* ~~Optimizations~~ ( v0.9x)
* 1.1
* ~~UV support to QMesh~~ (v1.0.x)
* Fluid dynamics
* 1.2
* Destructable rigid bodies.
* 1.3
* Continuous collision dedection (CCD)
* Multithreading