/nova-physics

Lightweight 2D rigid-body physics engine

Primary LanguageCMIT LicenseMIT

Nova Physics is a lightweight and easy to use 2D physics engine.

Features

  • Simple and user-friendly interface
  • Rigid body dynamics
  • Primitive shape collisions (circle, rect, polygon, AABB)
  • Physical material properties (friction, restitution and density)
  • Joint constraints (spring, distance, ...)
  • Iterative sequential impulse solver
  • Semi-implicit (symplectic) Euler integrator
  • Collision event callbacks
  • Sleeping bodies to reduce CPU load
  • Attractive forces
  • Portable codebase with no dependencies
  • Various examples using SDL2

Roadmap & Future

Nova Physics is still in its early stages as in 0.x.x versions. There is a large room of improvement and optimization of the API and engine's itself. Here are some important points that needs a touch before reaching the 1.x.x milestone:

  • Faster broad-phase

    Current broad-phase strategy is a spatial hash grid, which works well in lots of cases, however supporting a BVH (bounding volume hierarchy tree) can be a good target for developers to choose for their own simulation needs.

  • Stability & Optimization

    Other than a faster broad-phase, I will be working on general optimizations and refactoring the codebase. SIMD support and a multithreaded solver is also in the schedule but has low priority for obvious reasons.

  • Python Binding

    Nova Physics's Python module (here) is still WIP. I plan it to have an easy-to-use Pythonic interface. Other language binding contributions are also always welcome!

Installing & Building

Nova Phyiscs is lightweight and portable, using only C standard library.

Development libraries are always shipped with the most recent release under the name of nova-physics-X.X.X-devel.zip or .tar.gz. You can download the archive here and link libnova.a with your favorite compiler to use Nova Physics in your project.

But if you want (or need) to build Nova Physics from scratch on your own, use the building guide.

Examples

Example demos are in examples directory, use the example building guide to run examples.

Documentation

You can access the documentations here.

Resources & References

Following are some of the many great resources that helped me to build Nova Physics to this state.

License

MIT © Kadir Aksoy