From 714484047bbacf4d8dc39528b9eaefce2648b295 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Mon, 7 May 2012 23:29:58 +0000 Subject: [PATCH] SDK: - remove some queueing to make tool selection update faster git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9352 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../SceneComposerToolController.java | 10 ++------- .../jme3/gde/scenecomposer/SceneEditTool.java | 22 ++++++++++++------- .../gde/scenecomposer/tools/MoveTool.java | 2 +- .../gde/scenecomposer/tools/ScaleTool.java | 2 +- .../gde/scenecomposer/tools/SelectTool.java | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) 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(); } }