dimforge / rapier

2D and 3D physics engines focused on performance.
https://rapier.rs
Apache License 2.0
4.04k stars 250 forks source link

Convert a Collider back into a ColliderDesc. #393

Closed viridia closed 2 years ago

viridia commented 2 years ago

For debugging purposes, it would be useful to convert a Collider back into a ColliderDesc - the reason for this is lifetime. Once a collider has been removed from the world, any attempt to access its properties throws an unreachable error. Worse, there's no method on the collider that can be used to detect whether the collider is still valid. For debugging, I'd like to be able to display the properties of the collider without the debug UI having to worry about the lifetime of the collider.

viridia commented 2 years ago

Closing because I realized that this is easier than I thought :)