🎉🎉🎉 Happy new year everyone! 🎉🎉🎉
The year 2020 is over, so it is time to see what we did so far on our Rapier physics engine, and what are our plans for 2021!
Rapier in 2020
Rapier is a free and open-source physics engine for games, animation and robotics, written entirely with the Rust programming language. It focuses on performance, portability, and (optional) cross-platform determinism. We currently provide four Rust crates for Rapier and two NPM packages:
- rapier2d is optimized for 2D physics.
- rapier3d is optimized for 3D physics.
- bevy_rapier2d for using rapier2d with the Bevy game engine.
- bevy_rapier3d for using rapier3d with the Bevy game engine.
We announced Rapier for the first time at the end of August 2020. Since then, we implemented some essential features like ray-casting, collision filters, access to contact information, rotation locking, and the support of shapes like cylinders and cones. We made sure our cross-platform determinism feature works properly on the new Apple M1 ARM processor. And we set up continuous benchmarking visible on the Rapier website to make sure incremental changes don't destroy performances.
During December 2020 we started working on a large refactoring of the geometry-related code existing partly inside of ncollide and partly inside of Rapier itself. This refactoring is still work-in-progress, as part of the cdl repository (the name isn't definitive, don't hesitate to share your opinion on that issue). This work will be ready for the beginning of February 2021, and will allow us to proceed with our 2021 goals.
Rapier roadmap for 2021
We have very exciting goals for Rapier in 2021! Basically, at the end of 2021 we want Rapier to have all the features one would expect from a physics engine for games. This implies achieving feature-parity with popular C++ physics engines like Box2d, Bullet Physics, and PhysX. There is one exception though: we don't plan to support running physics simulations on the GPU yet. Though this may become a focus at some point in the next years.
Here is a list of some of the most important features we are missing today. This includes when they should become available (ETA):
|64-bits floats||A ||February|
|Sweep tests||Similar to ray-cast, except that we are casting a whole shape instead of just a ray. This is often used to design character controllers.||February|
|Intersection queries||To retrieve all colliders intersecting a given shape.||February|
|Convex polyhedron||To use an arbitrary convex polyhedron as a collider shape.||February|
|Custom shapes||To allow the user to define their own shape types.||February|
|Contact modification||To allow the user to modify/delete a contact before it is handed over to the constraints solver.||March|
|Dominance||To make one dynamic rigid-body act like a kinematic body wrt. another dynamic rigid-body.||March|
|CCD||To prevent fast-moving objects from missing collisions.||April|
|Joint limits, motors||To simulate more realistic vehicles, ragdolls, etc.||May|
|Reduced-coordinates articulations||To simulate more realistic robots with no joint drift.||August|
Note that the contact modification feature is what will allow you to simulate one-way platforms, conveyor belts, as well as colliders with non-uniform restitution and friction coefficients.
We also intend to implement some higher-level features like a character controller and a vehicle controller. Both should be available starting October. Most games will need controllers obeying their specific custom rules, so it is impossible to design a universal solution. Our goal is to provide something useful to start with, to serve as a basis to more specific character and vehicle controllers.
Finally, the last months of 2021 should be mostly dedicated to improving documentations and fixing bugs. Our bevy plugins and JS bindings will be updated progressively through the year in order to always use the latest version of Rapier.
What about fluids simulation?
We also develop Salva, a 2D and 3D fluids simulation engine written in Rust. Salva implements two-ways coupling with Rapier. This means that fluids from Salva can be affected by contact forces originating from Rapier, and rigid-bodies from Rapier can be affected by forces originating from fluids. Our three 2021 objectives for Salva are:
- Cross-platform determinism: just like Rapier, we want to make Salva optionally cross-platform deterministic (under the same assumption of IEEE 754-2008 compliance).
- Performance improvements: we need to apply to Salva what we leaned from Rapier with explicit SIMD optimizations.
- Stability improvements: to improve the quality of the fluids simulation itself and of the two-ways coupling with Rapier.
We intend to work on the first two objectives from February to May 2021. The stability improvements will be a progressive work during the rest of the year.
The Rust game-development community is growing every days and the ecosystem is maturing steadily with major crates like the Amethyst and Bevy game engine, rust-gpu project, and many other incredible projects. By working on Rapier (and some of its dependencies) full-time we aim to provide a high-quality free, open-source, community-friendly, cross-platform game physics simulation library. The year 2021 will allow us to make Rapier reach a level of feature-completeness comparable to its main C++ alternatives.
If you would like to support us with the development of Rapier, please consider sponsoring us on GitHub sponsor. Thank again to all our existing, past, and future sponsors for making all of this possible.
Have a great year 2021! 🥳