dimforge / bevy_rapier

Official Rapier plugin for the Bevy game engine.
https://rapier.rs
Apache License 2.0
1.19k stars 256 forks source link

Cannot set initial `ReadMassProperties` #484

Open paholg opened 3 months ago

paholg commented 3 months ago

I would like to spawn an entity and query over its mass in the same frame. This does not seem possible today; the only constructor for ReadMassProperties is default() which sets it to 0.

I understand not wanting this to be mutable in general, but there should be some mechanism to set it initially. The simplest would be to make a new function. This could easily be messed up, since the actual properties are derived from the rapier RigidBody, but I don't think it would be any worse than today, where it's just 0.0 until the physics systems have run.

Vrixyz commented 1 month ago

I think you want AdditionalMassProperties ; more info here: https://www.rapier.rs/docs/user_guides/bevy_plugin/rigid_bodies#mass-properties