aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/collider_set.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-02-20 12:55:00 +0100
committerSébastien Crozet <sebastien@crozet.re>2022-03-20 21:49:16 +0100
commitfb20d72ee29de9311a81aec6eb9f02fd2aa35fc4 (patch)
tree45827ac4c754c3670d1ddb2f91fc498515d6b3b8 /src/geometry/collider_set.rs
parente740493b980dc9856864ead3206a4fa02aff965f (diff)
downloadrapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.tar.gz
rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.tar.bz2
rapier-fb20d72ee29de9311a81aec6eb9f02fd2aa35fc4.zip
Joint API and joint motors improvements
Diffstat (limited to 'src/geometry/collider_set.rs')
-rw-r--r--src/geometry/collider_set.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/geometry/collider_set.rs b/src/geometry/collider_set.rs
index 556d190..61675d4 100644
--- a/src/geometry/collider_set.rs
+++ b/src/geometry/collider_set.rs
@@ -129,7 +129,8 @@ impl ColliderSet {
}
/// Inserts a new collider to this set and retrieve its handle.
- pub fn insert(&mut self, mut coll: Collider) -> ColliderHandle {
+ pub fn insert(&mut self, coll: impl Into<Collider>) -> ColliderHandle {
+ let mut coll = coll.into();
// Make sure the internal links are reset, they may not be
// if this rigid-body was obtained by cloning another one.
coll.reset_internal_references();
@@ -142,10 +143,11 @@ impl ColliderSet {
/// Inserts a new collider to this set, attach it to the given rigid-body, and retrieve its handle.
pub fn insert_with_parent(
&mut self,
- mut coll: Collider,
+ coll: impl Into<Collider>,
parent_handle: RigidBodyHandle,
bodies: &mut RigidBodySet,
) -> ColliderHandle {
+ let mut coll = coll.into();
// Make sure the internal links are reset, they may not be
// if this collider was obtained by cloning another one.
coll.reset_internal_references();