Nova Physics Versions Save

Lightweight 2D rigid-body physics engine

0.7.0

5 months ago

Happy late new year! 🥳

Nova Physics is back with a massive optimization update!

Highlights 🌟

  • Collision detection optimizations.
    • AABB caching.
    • Polygon transformed vertices caching.
  • SIMD enhancements.
    • Nova now uses AVX operations for integrating velocities & positions. Even though this might not have a huge impact on the overall performance, it's a start for vectorizing all simulation components!
  • Multi-threading!
    • A very experimental module that utilizes OS-threads to schedule tasks. This is only used to parallelize SHG for now.
    • This is pretty inconsistent on Linux.
  • Huge API changes.
    • Now the whole codebase uses nvStruct and nvEnum namings for every struct and enum.
    • Helper functions for body creation is now gone. You have to create shapes manually and pass them. Although, there is new better shape API.

Fixes

  • Fixed the bug where attractive forces behaved differently with substeps.
  • Fixed platform error messages in build script.
  • All broad-phase warnings are gone.
  • Fixed Fedora segfault in exampel demos.

Changelog

  • Improved constraints API for expandability.
  • New constraint: Hinge joint.
  • Added descriptions in constants.h (and few new constants).
  • nvBody_reset_velocities method for clearing body's velocities.
  • nvArray_clear method.
  • Tracy profiler support.
    • Build with --enable-tracy argument to start profiling with Tracy.
  • Renamed nvBroadPhaseAlg_... enum for readability.
  • New polygon functions:
    • Convex hull generation now uses Graham Scan algorithm. Which should be faster than the previous Gift Wrapping implementation.
    • Winding order function.
  • Build system is rewritten.
    • Object file caching for faster compilation times.
    • Better dependency management.
    • Better CLI and argument parsing.
    • Animated progress bar for downloading dependencies.
    • Better and more extendible compiler support.
    • --target=... argument for targeting a specific compiler.
    • --no-profiler argument for disabling built-in profiler.
    • --no-simd argument for disabling usage of SIMD intrinsics.
    • It is now possible to build & run unit tests.
  • Example system reworked.
    • Now all examples demos can be viewed from the same window.
    • Each example demo has its own settings.
    • Code should be easier to read and extend.
  • Benchmark base refactored.

Full changelog: https://github.com/kadir014/nova-physics/compare/0.6.0...0.7.0

0.6.0

7 months ago

Highlights 🌟

  • Build script now supports parallel compiling and Visual Studio build tools.
  • Reworked current constraints API and solvers. They are more stable.
  • Shape factory methods for generating convex hulls or other common shapes.
  • Groups, categories and masks for filtering collisions.

Issue Fixes

  • Fixed the long standing impulse caching bug where systems with high restitution instantly exploded.
  • Fixed Linux warnings for example_base.h.
  • Space now has an internal ID counter to avoid same IDs getting assigned to bodies after removing and adding.

Changes & Additions

  • New examples added: cloth.c and hull.c
    • Also improved some other examples.
  • Reworked the examples README page, and the demo UI.
  • In the collision resolutions, nv_Contant struct is now used to store contact point information.
  • Bodies now have gravity_scale attribute that indicates how are they affected by gravity.
  • Shape factory functions.
    • nv_ShapeFactory_Rect & Box to create rectangle shapes.
    • nv_ShapeFactory_NGon to create regular n-gon shapes.
    • nv_ShapeFactory_ConvexHull to create a convex hull from an array of points.
  • nv_Space_set_broadphase method to change the current broadphase algorithm.
  • Collision groups, categories and masks to filter which bodies collide with each other.
    • nv_Body.collision_group, nv_Body.collision_category and nv_Body.collision_mask are 32-bit unsigned integers, last two are used as bitmasks.
  • Parallel build support for GCC in the build script for faster compilation time and MSVC support.
    • Use the -j<n> option to set the number of processed fired to n
    • Use the -x option to target MSVC.
  • Constraints are moved to their own modules.
  • Constraints now link to the world by passing NULL to body parameter. The anchor point should be changed to world-space.
  • Improved current constraint solvers.
  • Math module is now only header-only.
  • nv_Profiler structs hold information about simulation's various profiling data.
  • The documentation is improved and started to write getting started section.

0.5.2

7 months ago

Updatelog

  • Improved collision persistance.
    • Completely reworked the hash map implementation.
    • Fixed SHG losing collision persistance. However this affects the performance.
    • New nv_Space.collision_persistance attribute defines the number of frames a collision resolution stays alive for.
  • New methods nv_Space_remove & nv_Space_kill
  • Added kill boundaries (nv_Space.kill_bounds & nv_Space.use_kill_bounds).
  • New examples: varying_friction.c and domino.c
  • Matrix API has been refactored and moved to its own header.
  • Improved docs.
  • Better platform detection in nova_builder.py build script.

0.5.1

7 months ago

Updatelog

  • Fixed Manjaro & MSVC compile errors and warnings.
  • Consistent use of Nova integer types along the codebase.
  • Improved documentation

0.5.0

1 year ago

Highlights 🌟

  • Improved broad-phase!
    • Nova Physics now has a Spatial Hash Grid implementation.
  • Body shapes.
    • Now shapes has their own interface. This makes it easier to have multiple shapes and concave polygons in the future.
  • Improved contact point generation.

Updatelog

  • There are two separate broad-phase algorithms now. SHG (Spatial Hash Grid) and Brute-force. Developer can choose whichever they want.
    • nv_BroadPhase_SPATIAL_HASH_GRID & nv_BroadPhase_BRUTE_FORCE.
  • New shape interface with nv_Shape & nv_ShapeType.
  • Polygon contact generation now uses polygon clipping for more accurate contact points.
  • Presolver functions in the solver API has been renamed to nv_presolve_...
  • Most, if not all, of the compiler warnings are fixed.
  • New example fountain.c.
    • Also improved all examples.
  • Improved documentation..

0.4.0

1 year ago

What's new? 🎉

  • New Vector2 API.
    • Utility macros like NV_VEC2(), NV_VEC2_NEW, NV_TO_VEC2, NV_TO_VEC2P
  • Nova Physics now uses an iterative sequential impulse solver with accumulated impulses.
    • This greaaatly increases the collision resolution stability and helps performance with reduced substeps.
    • Erin Catto has great presentations about the topic: GDC 2005 & GDC 2006.
  • A custom build system for Nova Physics that simplifies everything.
    • Learn how to use it here.

Updatelog

  • Nova Physics now uses a custom floating point type nv_float which can be configured while building by the developer.
  • Solver can be configured to use different functions for coefficient mixing.
  • nv_Body_apply_impulse (and nv_Body_apply_pseudo_impulse) methods are used in the solver.
  • nv_Space_clear method to clear all the Space content.
  • nv_Space -> warmstarting field to toggle warm-starting accumulated impulses.
  • Improved example base and new examples demos.
  • Improved sleeping.
    • nv_Space -> sleep_energy_threshold field to determine sleeping energy threshold
    • nv_Space -> sleep_timer_threshold field to determine sleeping time threshold
    • nv_Space -> wake_energy_threshold field to determine waking energy threshold

0.3.1

1 year ago

Changes

  • Fixed orbit.c example
  • New example previews
  • Updated docs

0.3.0

1 year ago

Changes

  • New material API for setting bodies' material properties like density, friction, etc..
    • nv_Material struct and presets like nv_Material_STEEL, nv_Material_WOOD, etc..
  • Constraint support and solvers
    • New constraint: Spring! 🎉
  • New examples and improved example base
  • Bugs & function documentation fixes

0.2.0

1 year ago

First stable release

General changes

  • Attractive forces
  • Bodies now have is_attractor attribute
  • build.py for generating development libraries
  • internal.h for resolving circular includes
  • New example orbit.c, showcasing attractive forces