Improve the API for initializing/setting mass-properties

This commit is contained in:
Sébastien Crozet
2022-07-05 14:59:14 +02:00
parent b8d46a6b1d
commit ba081fb6f5
7 changed files with 294 additions and 175 deletions

View File

@@ -1,3 +1,26 @@
## Unreleased
### Fixed
### Modified
- The `RigidBodyBuilder::additional_mass` method will now result in the additional angular inertia
being automatically computed based on the shapes of the colliders attached to the rigid-body.
- Remove the deprecated methods `RigidBodyBuilder::mass`, `::principal_angular_inertia`, `::principal_inertia`.
- Remove the methods `RigidBodyBuilder::additional_principal_angular_inertia`. Use
`RigidBodyBuilder::additional_mass_properties` instead.
### Added
- Add `RigidBody::recompute_mass_properties_from_colliders` to force the immediate computation
of a rigid-bodys mass properties (instead of waiting for them to be recomputed during the next
timestep). This is useful to be able to read immediately the result of a change of a rigid-body
additional mass-properties or a change of one of its colliders mass-properties.
- Add `RigidBody::set_additional_mass` to set the additional mass for the collider. The additional
angular inertia is automatically computed based on the attached colliders shapes.
- Add `Collider::set_density`, `::set_mass`, `set_mass_properties`, to alter a colliders mass
properties. Note that `::set_mass` will result in the colliders angular inertia being automatically
computed based on this mass and on its shape.
- Add `ColliderBuilder::mass` to set the mass of the collider instead of its density. Its angular
inertia tensor will be automatically computed based on this mass and its shape.
## v0.13.0 (31 May 2022)
### Fixed
- Fix incorrect sensor events being generated after collider removal.