From 31e151fec1ee72f1b17f2baa32518faf5e0d29f6 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Thu, 1 Sep 2011 00:53:54 +0000 Subject: [PATCH] - merge changes to native bullet git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8144 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/bullet/control/KinematicRagdollControl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/src/bullet/com/jme3/bullet/control/KinematicRagdollControl.java b/engine/src/bullet/com/jme3/bullet/control/KinematicRagdollControl.java index aff608382..3470153c8 100644 --- a/engine/src/bullet/com/jme3/bullet/control/KinematicRagdollControl.java +++ b/engine/src/bullet/com/jme3/bullet/control/KinematicRagdollControl.java @@ -165,7 +165,7 @@ public class KinematicRagdollControl implements PhysicsControl, PhysicsCollision return; } TempVars vars = TempVars.get(); - + Quaternion tmpRot1 = vars.quat1; Quaternion tmpRot2 = vars.quat2; @@ -660,7 +660,7 @@ public class KinematicRagdollControl implements PhysicsControl, PhysicsCollision } //dispatching the event if the ragdoll has been hit - if (hit) { + if (hit && listeners != null) { for (RagdollCollisionListener listener : listeners) { listener.collide(hitBone, hitObject, event); } @@ -681,7 +681,8 @@ public class KinematicRagdollControl implements PhysicsControl, PhysicsCollision animControl.setEnabled(mode == Mode.Kinetmatic); baseRigidBody.setKinematic(mode == Mode.Kinetmatic); - TempVars vars = TempVars.get(); + TempVars vars = TempVars.get(); + for (PhysicsBoneLink link : boneLinks.values()) { link.rigidBody.setKinematic(mode == Mode.Kinetmatic); if (mode == Mode.Ragdoll) { @@ -715,8 +716,7 @@ public class KinematicRagdollControl implements PhysicsControl, PhysicsCollision animControl.setEnabled(true); - - TempVars vars = TempVars.get(); + TempVars vars = TempVars.get(); for (PhysicsBoneLink link : boneLinks.values()) { Vector3f p = link.rigidBody.getMotionState().getWorldLocation();