From ab6bdae7741272832fcb5bf4881af655be65a750 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 5 Feb 2013 17:30:04 +0000 Subject: [PATCH] - fix AbstractPhysicsControl applyTransform git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10340 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/bullet/control/AbstractPhysicsControl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/bullet-common/com/jme3/bullet/control/AbstractPhysicsControl.java b/engine/src/bullet-common/com/jme3/bullet/control/AbstractPhysicsControl.java index fde0f73aa..bf2976144 100644 --- a/engine/src/bullet-common/com/jme3/bullet/control/AbstractPhysicsControl.java +++ b/engine/src/bullet-common/com/jme3/bullet/control/AbstractPhysicsControl.java @@ -119,12 +119,12 @@ public abstract class AbstractPhysicsControl implements PhysicsControl { } /** - * Applies a physics location to the spatial + * Applies a physics transform to the spatial * * @param worldLocation * @param worldRotation */ - protected void applyPhysicsLocation(Vector3f worldLocation, Quaternion worldRotation) { + protected void applyPhysicsTransform(Vector3f worldLocation, Quaternion worldRotation) { if (enabled && spatial != null) { Vector3f localLocation = spatial.getLocalTranslation(); Quaternion localRotationQuat = spatial.getLocalRotation(); @@ -132,6 +132,7 @@ public abstract class AbstractPhysicsControl implements PhysicsControl { localLocation.set(worldLocation).subtractLocal(spatial.getParent().getWorldTranslation()); localLocation.divideLocal(spatial.getParent().getWorldScale()); tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation); + localRotationQuat.set(worldRotation); tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().mult(localRotationQuat, localRotationQuat); spatial.setLocalTranslation(localLocation);