dimforge / parry

2D and 3D collision-detection library for Rust.
https://parry.rs
Apache License 2.0
565 stars 100 forks source link

Custom TypedShape to reference dyn Shape instead #216

Closed Neo-Zhixing closed 2 months ago

Neo-Zhixing commented 3 months ago

The existing TypedShape::Custom contains a user-defined shape with a type identified by a number.

This number has questionable utility. Let's make it so that TypedShape references the custom shape with a &dyn Shape instead. The user may check for the actual custom shape type using downcast.

Please let me know if there are any reasons to keep this as a u32 I might not be aware of.