August 12th, 2024

Box2D 3.0 Released

Box2D version 3.0 has been released after 18 months, featuring a new collision system, a redesigned API in C, improved performance, and new features like capsules and a Soft Step solver.

Read original articleLink Icon
Box2D 3.0 Released

Box2D version 3.0 has been officially released after 18 months of development. The new version introduces significant changes, including a complete overhaul of continuous collision and response, utilizing a hybrid speculative and time of impact approach. This design eliminates the need for polygon skins, supports rounded polygons, and minimizes movement pauses. The API has been redesigned to consist solely of enums, structs, and functions, moving away from C++ classes, which enhances readability and reduces the risk of memory issues. The library has transitioned from C++ to C, which has improved performance and debugging capabilities, although it presented some challenges due to MSVC's limitations. Performance enhancements focus on multithreading and SIMD, with v3 reportedly being more than twice as fast as v2.4. New features include the addition of capsules, a Soft Step solver for improved stability, and enhanced precision for larger simulation worlds. The release also emphasizes the importance of community feedback during the development process. A video celebrating the release has been made available, and there is an invitation for sponsorship to support ongoing development.

- Box2D 3.0 introduces a new collision response system and a redesigned API.

- The library has transitioned from C++ to C, enhancing performance and debugging.

- Version 3.0 is reported to be over twice as fast as its predecessor, v2.4.

- New features include capsules, a Soft Step solver, and improved simulation precision.

- Community feedback played a crucial role in the development of v3.

Link Icon 5 comments
By @maccard - 6 months
Writing a Physics engine from scratch is a great fun. You can get results super quickly, it's very, very optimisable, and there's no end of features you can support. It's also surprisingly doable, in 2D. 3D is an entirely different can of worms.

It's also an incredibly humbling experience to write one, and benchmark it against Box2D to see just how slow your implementation is.

By @bun_terminator - 6 months
Context: This is a widely used C++ library for 2D physics. It has always been super flexible/hackable, easy to setup and rock stable physics. Therefore a popular choice for games. Good to see that some of the code idiosyncrasies have disappeared (it had a lot of pointers and callbacks)
By @sgt - 6 months
Will it be possible to use Box2D 3.0 on WASM? So in other words write your game code in C, and then run it seamlessly in your browser.
By @sgt - 6 months
> "I want a simple type-safe dynamic array with bounds checking. Pretty please?"

Isn't there a simple header based library for this?