added methods to physics to borrow entities by rapier's handles
@@ -388,6 +388,14 @@ impl Physics {
.and_then(move |&h| bodies.get_mut(h))
}
+ /// TODO
+ pub fn body_mut_rapier(
+ &mut self,
+ handle: rapier3d::dynamics::RigidBodyHandle,
+ ) -> Option<&mut RigidBody> {
+ self.bodies.get_mut(handle)
+ }
+
/// TODO
pub fn body(&self, handle: &RigidBodyHandle) -> Option<&RigidBody> {
let bodies = &self.bodies;
@@ -396,6 +404,11 @@ impl Physics {
.and_then(move |&h| bodies.get(h))
}
+ /// TODO
+ pub fn body_rapier(&self, handle: rapier3d::dynamics::RigidBodyHandle) -> Option<&RigidBody> {
+ self.bodies.get(handle)
+ }
+
/// TODO
pub fn contains_body(&self, handle: &RigidBodyHandle) -> bool {
self.body(handle).is_some()
@@ -417,6 +430,11 @@ impl Physics {
.and_then(|&h| colliders.get(h))
}
+ /// TODO
+ pub fn collider_rapier(&self, handle: rapier3d::geometry::ColliderHandle) -> Option<&Collider> {
+ self.colliders.get(handle)
+ }
+
/// TODO
pub fn contains_collider(&self, handle: &ColliderHandle) -> bool {
self.collider(handle).is_some()
