From ab10b457b0a8cc2bf156380637a2aef0a3d1706f Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Mon, 16 May 2011 16:46:10 +0000 Subject: [PATCH] KinematicRagdollControl : - added support for getting RigidBodies associated with each bone git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7503 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../control/KinematicRagdollControl.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/engine/src/jbullet/com/jme3/bullet/control/KinematicRagdollControl.java b/engine/src/jbullet/com/jme3/bullet/control/KinematicRagdollControl.java index 9884e1e9b..5164603c3 100644 --- a/engine/src/jbullet/com/jme3/bullet/control/KinematicRagdollControl.java +++ b/engine/src/jbullet/com/jme3/bullet/control/KinematicRagdollControl.java @@ -51,7 +51,6 @@ import com.jme3.bullet.objects.PhysicsRigidBody; import com.jme3.export.JmeExporter; import com.jme3.export.JmeImporter; import com.jme3.math.Quaternion; -import com.jme3.math.Transform; import com.jme3.math.Vector3f; import com.jme3.renderer.RenderManager; import com.jme3.renderer.ViewPort; @@ -836,7 +835,9 @@ public class KinematicRagdollControl implements PhysicsControl, PhysicsCollision * Set the CcdMotionThreshold of the given bone's rigidBodies of the ragdoll * @see PhysicsRigidBody#setCcdMotionThreshold(float) * @param value + * @deprecated use getBoneRigidBody(String BoneName).setCcdMotionThreshold(float) instead */ + @Deprecated public void setBoneCcdMotionThreshold(String boneName, float value) { PhysicsBoneLink link = boneLinks.get(boneName); if (link != null) { @@ -848,11 +849,26 @@ public class KinematicRagdollControl implements PhysicsControl, PhysicsCollision * Set the CcdSweptSphereRadius of the given bone's rigidBodies of the ragdoll * @see PhysicsRigidBody#setCcdSweptSphereRadius(float) * @param value + * @deprecated use getBoneRigidBody(String BoneName).setCcdSweptSphereRadius(float) instead */ + @Deprecated public void setBoneCcdSweptSphereRadius(String boneName, float value) { PhysicsBoneLink link = boneLinks.get(boneName); if (link != null) { link.rigidBody.setCcdSweptSphereRadius(value); } } + + /** + * return the rigidBody associated to the given bone + * @param boneName the name of the bone + * @return the associated rigidBody. + */ + public PhysicsRigidBody getBoneRigidBody(String boneName) { + PhysicsBoneLink link = boneLinks.get(boneName); + if (link != null) { + return link.rigidBody; + } + return null; + } }