From dbcf230b2c601ba1e6b15d5b21771217b199a8ae Mon Sep 17 00:00:00 2001 From: N8n5h <42382648+N8n5h@users.noreply.github.com> Date: Mon, 17 Jun 2019 21:45:09 -0300 Subject: [PATCH] Add a function to find a rigidBody by their id --- Sources/armory/trait/physics/bullet/PhysicsWorld.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/armory/trait/physics/bullet/PhysicsWorld.hx b/Sources/armory/trait/physics/bullet/PhysicsWorld.hx index 4a303172..da2c812f 100644 --- a/Sources/armory/trait/physics/bullet/PhysicsWorld.hx +++ b/Sources/armory/trait/physics/bullet/PhysicsWorld.hx @@ -225,6 +225,12 @@ class PhysicsWorld extends Trait { } return res; } + + public function findBody(id:Int):RigidBody{ + if (rbMap.length == 0) return null; + var rb = rbMap.get(id); + return rb; + } function lateUpdate() { var t = Time.delta * timeScale;