diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java index 2a3bbe647..8dd2b5f33 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java @@ -104,7 +104,7 @@ public class SceneComposerToolController extends SceneToolController { onTopToolsNode.updateGeometricState(); } if (editTool != null) { - editTool.updateToolsTransformation(); + editTool.doUpdateToolsTransformation(); } } @@ -154,13 +154,7 @@ public class SceneComposerToolController extends SceneToolController { public void selectedSpatialTransformed() { if (editTool != null) { - SceneApplication.getApplication().enqueue(new Callable() { - - public Object call() throws Exception { - editTool.updateToolsTransformation(); - return null; - } - }); + editTool.updateToolsTransformation(); } } diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditTool.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditTool.java index 967acc63b..6f8bee479 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditTool.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditTool.java @@ -123,25 +123,31 @@ public abstract class SceneEditTool { /** * Called when the selected spatial has been modified * outside of the tool. + * TODO: why? just move the tool where the object is each frame? */ public void updateToolsTransformation() { SceneApplication.getApplication().enqueue(new Callable() { public Object call() throws Exception { - if (toolController.getSelectedSpatial() != null) { - axisMarker.setLocalTranslation(toolController.getSelectedSpatial().getWorldTranslation()); - axisMarker.setLocalRotation(toolController.getSelectedSpatial().getWorldRotation()); - setAxisMarkerScale(toolController.getSelectedSpatial()); - } else { - axisMarker.setLocalTranslation(Vector3f.ZERO); - axisMarker.setLocalRotation(Quaternion.IDENTITY); - } + doUpdateToolsTransformation(); return null; } + }); } + public void doUpdateToolsTransformation() { + if (toolController.getSelectedSpatial() != null) { + axisMarker.setLocalTranslation(toolController.getSelectedSpatial().getWorldTranslation()); + axisMarker.setLocalRotation(toolController.getSelectedSpatial().getWorldRotation()); + setAxisMarkerScale(toolController.getSelectedSpatial()); + } else { + axisMarker.setLocalTranslation(Vector3f.ZERO); + axisMarker.setLocalRotation(Quaternion.IDENTITY); + } + } + /** * Adjust the scale of the marker so it is relative to the size of the * selected spatial. It will have a minimum scale of 2. diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java index 956fd2140..7ac7d0ca5 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java @@ -145,7 +145,7 @@ public class MoveTool extends SceneEditTool { if (character != null) { character.setPhysicsLocation(toolController.getSelectedSpatial().getWorldTranslation()); } - updateToolsTransformation(); + doUpdateToolsTransformation(); wasDragging = true; } 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 0fd0bf315..0219ea16c 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 @@ -99,7 +99,7 @@ public class ScaleTool extends SceneEditTool { Vector3f scale = toolController.getSelectedSpatial().getLocalScale().add(diff, diff, diff); lastScale = scale; toolController.getSelectedSpatial().setLocalScale(scale); - updateToolsTransformation(); + doUpdateToolsTransformation(); } wasDragging = true; diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.java index c84a84317..8dfaaa482 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.java @@ -44,7 +44,7 @@ public class SelectTool extends SceneEditTool { }); if (result != null) { - updateToolsTransformation(); + doUpdateToolsTransformation(); } }