I am very excited to announce the release of my past 5 months of developments on my pure-rust physics engine: nphysics 0.10!
It actually goes much further than adding deformable bodies so here are the lists of new features. This also implied a lot of work on nalgebra and ncollide, though I won't describe this here as they will be included in the next edition of "This month in rustsim" (which I will write a bit late: tomorrow or next sunday).
The biggest new features are related to deformable bodies, also known as soft-bodies. I implemented the most common deformation model (constraints-based mass-spring system), as well as more accurate ones based on a finite-element method in order to cover a larger set of use-cases:
- Deformable bodies based on a finite-element method for modelling linear elasticity.
- Deformable bodies based on a mass-spring model.
- It is possible to fix in space one or multiple point of a deformable body.
- Plasticity support. This simulates permanent deformations when a deformable body is subjected to a significant stress for a large period of time. See the online demo.
- Full interaction with other bodies and constraints.
I’ve published quite a few videos of those features during the past few months. You can find all of them in my youtube channel.
You can of course run the examples available on the examples2d and examples3d folder of the GitHub repository.
The user-guide has not been updated yet to include details about those deformable bodies. Self-collision are not handled yet.
Lots of smaller additions
During this long period of development, I also added a few features that were requested from time to time:
- User-data associated to bodies and colliders.
- Body and BodyPart are now traits instead of enums.
- The collider Material system has been reworked to allow custom materials, including the ability to have different friction/restitution coefficients at different points of the same collider.
- All bodies and colliders are now constructed with structs following the builder pattern. The user guide has been updated accordingly.
- Full support of capsules and heigthfields (aka. heigthmaps).
- Simulation of conveyor belts using the concept of surface velocity: it is possible to simulate the fact an object moves without actually moving it. See the demo.
- More options for applying a force to a body part: force, impulse, velocity change, or acceleration change. See the dedicated section on the user guide.
- It is now possible at any time to retrieve an iterator through all the colliders in contact/proximity with a specific collider. This is possible because ncollide now maintains an interaction graph.
- It is now possible to lock some translations or rotations of a rigid body or to control them at the velocity level as described there.
The documentation is still work-in-progress so there may still be some dead links. Sorry for the inconvenience!
The next steps
My objectives for the next couple of month will be to address two often requested features on nalgebra and nphysics:
- A better support of complex number on nalgebra.
- Continuous collision detection on nphysics so that fast bodies can be simulated more accurately.
I hope you will enjoy it!
Thank you all for your feedback and your support !