From 5c539f5656fad35c7ced2a380632c470af9f2e93 Mon Sep 17 00:00:00 2001 From: Maselbas Date: Tue, 28 Apr 2015 22:10:07 +0200 Subject: [PATCH] SDK SceneComposer : fix scale tool, now the global option should work --- .../src/com/jme3/gde/scenecomposer/tools/ScaleTool.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/ScaleTool.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/ScaleTool.java index 69f5bfc9c..edde41a24 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/ScaleTool.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/ScaleTool.java @@ -122,7 +122,9 @@ public class ScaleTool extends SceneEditTool { lastScale = scale; toolController.getSelectedSpatial().setLocalScale(scale); } else if (pickedMarker.equals(ARROW_X) || pickedMarker.equals(ARROW_Y) || pickedMarker.equals(ARROW_Z)) { - Vector3f diff = pickManager.getLocalTranslation(constraintAxis); + // Get the translation in the spatial Space + Quaternion worldToSpatial = toolController.getSelectedSpatial().getWorldRotation().inverse(); + Vector3f diff = pickManager.getTranslation(worldToSpatial.mult(constraintAxis)); diff.multLocal(0.5f); Vector3f scale = startScale.add(diff); lastScale = scale;