Code Monkey home page Code Monkey logo

nova-physics's Introduction

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

You can also read this page in
EN

Features

  • Simple and user-friendly interface
  • Rigid body dynamics
  • Primitive shape collisions (circle, rect, polygon, AABB)
  • Broad-phase strategies (Spatial hashing & BVH-tree)
  • Physical material properties (friction, restitution and density)
  • Joint constraints (spring, distance, hinge ..)
  • Great stacking stability and collision persistence
  • Erin Catto's iterative sequential impulse solver algorithm
  • Semi-implicit (symplectic) Euler integrator
  • Collision event callbacks
  • Sleeping bodies to reduce CPU load
  • Attractive forces
  • Built-in profiler
  • Portable codebase with no dependencies
  • Various interactive example demos 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 of the important points that needs a touch before reaching the 1.x.x milestone:

  • Better & faster broad-phase

    Current broad-phase strategies available in Nova are a spatial hash grid and a BVH (bounding volume hierarchy) tree. Both are fast but there is still room for improvement, especially for BVH-tree construction and multi-threaded SHG tasks.

  • 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

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 (or libnova.lib) 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

Nova Physics is, and always will be, free and open-source. Although we would greatly appreciate donations!

nova-physics's People

Contributors

kadir014 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nova-physics's Issues

bunch of warnings

You should compile with warnings turned up, you got a bunch of little errors.

example:

in nv_Space_broadphase you have a for loop going over space->bodies->size using 'j' and then inside that for loop you use 'j' again, and you do that a couple times.

also, there's quiet a few instances of signed / unsigned mismatching in for loops

Recommendations

I like this library and am testing it in my 2D game. Here are some recommendations:

  • I recommend including CMAKE build because it is easy to use and cross platform. I could not build the examples with the custom build. Keeps giving errors. A cmake build would make it easier for me to drop it into my projects.
  • I recommend using -Wall build warnings. There were alot of errors when building. I built it with -Wall on C99 standard.
  • I recommend adding more documentation and explanation on various abstract features like constraint and awake/sleep. There is not much understanding in the position_iters and velocity_iters field of the nv_Space_step API.
  • I recommend adding more simple getting started samples. I found the example added to be very difficult to understand.
  • I recommend updating the APIs to make it more friendly to Game development. I am working on a flat plane 2D game and I had to manually zero the gravity variable of the Space object because that was not desired in my Game. Making the gravity force optional in the nv_Space_new() API would have been better. I had to write my own friction logic and clamp to zero logic (once the velocity is under a certain value, set it to zero) to make the feel of the physics more 2D game friendly. Would be awesome to include this as additional API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.