Make cloning rigid-bodies and colliders more idiomatic.

Fix #53
This commit is contained in:
Crozet Sébastien
2020-11-03 14:29:47 +01:00
parent 0cc850dc50
commit 036a246141
6 changed files with 29 additions and 38 deletions

View File

@@ -59,6 +59,10 @@ impl ColliderSet {
parent_handle: RigidBodyHandle,
bodies: &mut RigidBodySet,
) -> ColliderHandle {
// Make sure the internal links are reset, they may not be
// if this rigid-body was obtained by cloning another one.
coll.reset_internal_links();
coll.parent = parent_handle;
let parent = bodies
.get_mut_internal(parent_handle)