An open API service indexing awesome lists of open source software.

https://github.com/kadir014/nova-physics

Lightweight 2D rigid-body physics engine
https://github.com/kadir014/nova-physics

2d 2d-physics 2d-physics-engine c impulse physics physics-engine physics-simulation rigid-bodies

Last synced: about 2 months ago
JSON representation

Lightweight 2D rigid-body physics engine

Awesome Lists containing this project

README

          








Nova Physics is a lightweight and easy to use 2D physics engine designed with game development in mind.





You can also read this page in


EN

# Features
- Simple and user-friendly interface
- Portable codebase with no dependencies
- Rigid body dynamics
- Discrete collision detection
- Circle shape
- Convex polygon shape
- Testing shapes against shapes
- Testing shapes against point
- Ray casting
- One-shot contact manifold generation between shapes
- Multiple shapes per body
- Broadphase strategies
- Bruteforce
- Bounding volume hierarchy tree
- Material properties (friction, restitution and density)
- Constraints between bodies
- Distance constraint - can also behave like spring
- Hinge constraint
- Spline path constraint
- [Erin Catto's](https://box2d.org/files/ErinCatto_SequentialImpulses_GDC2006.pdf) sequential impulse solver algorithm
- Great stacking stability
- Semi-implicit (symplectic) Euler integrator
- Collision filtering with masks and grouping
- Built-in profiler
- Optional double-precision mode
- Various interactive demos using SDL2 & OpenGL

# Building
The library uses C99 standard and depends only on the C standard library.

For further instructions see [here](BUILDING.md).

# Examples

Example demos are in [examples](https://github.com/kadir014/nova-physics/blob/main/examples/) directory, enable building demos option in the build system (if not already enabled).

# Documentation
You can access the documentation including the API reference [here](https://nova-physics.rtfd.io).

If you are just getting started, you can use the [introduction page](https://nova-physics.readthedocs.io/en/latest/getting_started/index.html).

# Resources & References
Nova is a passion and learning project for me, and following are some of the many great resources that helped me along the way.
- **Erin Catto**, [GDC Presentations](https://box2d.org/publications/) and [Box2D](https://github.com/erincatto/box2c)
- **Chris Hecker**, [Rigid Body Dynamics](https://chrishecker.com/Rigid_Body_Dynamics)
- **Ian Millington**, [Game Physics Engine Development](https://www.r-5.org/files/books/computers/algo-list/realtime-3d/Ian_Millington-Game_Physics_Engine_Development-EN.pdf)
- **Christer Ericson**, [Real-Time Collision Detection](https://www.r-5.org/files/books/computers/algo-list/realtime-3d/Christer_Ericson-Real-Time_Collision_Detection-EN.pdf)
- **Dirk Gregorius**, [Robust Contact Creation for Physics Simulations](http://media.steampowered.com/apps/valve/2015/DirkGregorius_Contacts.pdf)
- **Randy Gaul**, [Game Physics Articles](https://tutsplus.com/authors/randy-gaul)
- **Allen Chou**, [Physics Blogs](https://allenchou.net/category/physics/)
- **Jacco Bikker**, [How to build a BVH](https://jacco.ompf2.com/2022/04/13/how-to-build-a-bvh-part-1-basics/)
- **Marjin Tamis** & **Giuseppe Maggiore**, [Constraint Based Physics Solver](http://mft-spirit.nl/files/MTamis_ConstraintBasedPhysicsSolver.pdf)
- **Micheal Manzke**, [Multiple Contact Resolution](https://www.scss.tcd.ie/~manzkem/CS7057/cs7057-1516-10-MultipleContacts-mm.pdf)

# License
[MIT](LICENSE) © Kadir Aksoy

Nova Physics is, and always will be, free and open-source. Although I would greatly appreciate [sponsorships!](https://github.com/sponsors/kadir014)