This month in Dimforge #3 (November 2020)

Welcome to the third edition of This month in Dimforge! This is the third edition of this newsletter that replaces the This month in rustsim we published before Dimforge was created. This will provide you with a summary of important updates that occurred within the dimforge community. This includes in particular updates about the rapier (physics engine), salva (fluid simulation), ncollide (collision-detection), nalgebra (linear algebra), and simba (abstract algebra) crates. This third edition will contain updates for the month of November 2020.

Join us on discord and on our user forum!
You can support us on GitHub sponsors!

Rapier 0.4.0

The version of Rapier 0.4.0 includes a few important new features:

  • The ability to read contact and proximity information from the NarrowPhase. In particular, it is possible to retrieve one specific contact pair (given two collider handles), or to retrieve all the contact pairs involving one specific collider.
  • The ability to lock translations and/or rotations caused by forces on a rigid-body. For example, it is possible to lock all the rotations of a rigid-body except along one or two coordinate axes, without using joints. Locking rotations has been a common feature request from our community, for games with a player modeled as a dynamic rigid-body which should not rotate.

In the following demo, you can see a blue cuboid with all its translations locked, and all its rotations locked except along the x coordinate axis. The capsule (initialized in a tilted position) on the other hand has all its rotations locked. All this is achieved without any joints:

Locked rotations demo

Finally, we tested Rapier on the new Apple M1 chip. It worked very well except for some cases where the cross-platform determinism of Rapier broke. We fixed this problem, which means that enabling the enhanced-determinism of Rapier will allow you to get the exact same results for the same simulations running on, e.g., MacOs with an Apple M1 ARM processor, and Ubuntu with an AMD Ryzen 9 X86 processor!

You may see the CHANGELOG of Rapier for more details on other changes we made in Rapier 0.4.

Bevy rapier plugin 0.6.0

We released the version 0.6.0 of our Bevy plugin for Rapier bevy_rapier. This includes:

  • The automatic removal of rigid-bodies, colliders, and joints from the Rapier structures when the entity they are attached to are removed from the Bevy ECS. Thanks to Robert Swain for this contribution!
  • The ability to attach multiple colliders to a single rigid-body using Bevy hierarchy: one just has to spawn an entity with a RigidBodyBuilder component, and multiple children entities with one ColliderBuild component each. Thanks to @blamelessgames for this contribution!
  • The adaptive change of number of timesteps executed by the Rapier plugin at each render loop iteration is now disabled by default: you can re-enable it by setting RapierConfiguration.time_dependent_number_of_timesteps to true.

Salva 0.5.0

The integration of Rapier with our particle-based fluids simulation engine Salva has been completed and released in Salva v0.5.0. With this release, Salva no longer supports nphysics. In the following demo, you can see three fluids from Salva: two with a high elasticity (acting like jelly), and one with no elasticity (acting like water). These fluids interact with four rigid-bodies: the ground with a Polyline shape, and three dynamic bodies with Ball, Cuboid, and Capsule shapes.

Salva rapier integration demo

We also added to Salva the ability to retrieve all the fluid particles located inside an AABB or a shape defined in our ncollide crate. This can be useful for, e.g., spawning new particles ensuring there isn't anything there already.

Rapier.js 0.2.13

Our Typescript/JS bindings for Rapier have been significantly improved. They have as many features as the Rust version of Rapier now! In particular, we added bindings to support:

  • Heightfield and triangle-mesh colliders.
  • Collision groups and solver groups.
  • Rotation and/or translation locking for rigid-bodies.
  • Linear and angular damping for dynamic rigid-bodies.
  • The ability to remove joints.
  • Prismatic and fixed joints.
  • The ability to set the velocity of a rigid-body after its creation.

You may see the CHANGELOG of rapier.js for more details on other changes we made since its version 0.2.6.

What's next

Last month, we said we would add the support of arbitrary convex polyhedron shapes during November. This has been postponed to make it part to a larger piece of work: during December (and possibly January 2021), we will work on a significant refactoring of all the geometry-related code used by Rapier.

Right now, the geometry-related code (including collision detection and ray-casting) used by Rapier is partially located inside of the Rapier crate itself, and partially inside of our ncollide crate. We intend to move all the geometry code out of Rapier completely for better separation of concerns. We are not sure yet if all this will be moved inside of ncollide, or if we will create a new crate that will be the successor of ncollide (similarly to when we created Rapier as a successor of nphysics.

This refactoring is the first step before adding some essential features, like CCD (continuous collision-detection) and the support of custom collider shapes.


We would like to thank the whole community and code contributors. In particular, thanks to the code contributors from the past month1:

Finally, thanks to all the former, current and new supporters through GitHub sponsors! This help is greatly appreciated and allows us to continue working on open-source exclusively.

  1. The list of contributors is automatically generated from the past months' github commit history. Don't hesitate to let us know if your name should have been mentioned here.