Version 3.0 was released about 8 months ago. It was a huge update and it needed some refinement. Version 3.1 addresses most of the bugs and build problems. It also introduces some new features and refinements.

Character mover

I’ve added experimental character mover support to 3.1. This uses a geometric solver. It should be useful for games that want greater control than what you get with a dynamic or kinematic body. The geometric mover lives outside the physics world and is implemented as collision queries and a specialized solver. It is a toolkit you can mix and match to get the results you want. There are more details in the documentation and the Mover sample.

Move

New sensor system

The sensor system was built on top of the contact system. This turns out to be the wrong choice if you need sensors to follow different rules than bodies. The new sensor system still uses shapes on bodies, but it doesn’t consider the body type or the body sleeping status. This allows sensors on static bodies to detect shapes on other kinematic or static bodies.

The new sensor system now runs at the end of the update, so the overlap events are not delayed. Sensors produce reliable begin and end touch events and you can also access the current overlaps on a sensor shape.

This system is multithreaded and deterministic.

Rolling resistance and tangent speed

I’ve added rolling resistance and tangent speed as a surface property on shapes. Rolling resistance can be used with any shape with a radius to resist rolling in a manner similar to friction. This means a circle can come to a rest on an incline.

Tangent speed is back from version 2 and allows shape surfaces to behave like conveyor belts.

Both of these features use the high performance SIMD contact solver.

SIMD

It turns out not everyone has a CPU capable of running AVX2. It also turns out hand written SIMD is much more efficient than macro magic.

SSE2 is now the default on x64. You also disable SIMD code completely if you want to drive in the slow lane.

Neon has also been optimized and provides big gains on Apple Silicon.

Performance

Performance continues to be very important for v3.1. Continuous collision performance is roughly doubled. The overhead of restitution is greatly reduced. GJK was optimized to be 20% faster. This is one of the core collision algorithms, so this benefits many collision operations.

Supporting Box2D

If you’d like to sponsor Box2D development, you can sign up using GitHub sponsors or Patreon.