- remove some queueing to make tool selection update faster

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9352 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent eaf415cd80
commit 714484047b
  1. 8
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerToolController.java
  2. 12
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditTool.java
  3. 2
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java
  4. 2
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/ScaleTool.java
  5. 2
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/SelectTool.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<Object>() {
public Object call() throws Exception {
editTool.updateToolsTransformation();
return null;
}
});
}
}

@ -123,12 +123,21 @@ 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<Object>() {
public Object call() throws Exception {
doUpdateToolsTransformation();
return null;
}
});
}
public void doUpdateToolsTransformation() {
if (toolController.getSelectedSpatial() != null) {
axisMarker.setLocalTranslation(toolController.getSelectedSpatial().getWorldTranslation());
axisMarker.setLocalRotation(toolController.getSelectedSpatial().getWorldRotation());
@ -137,9 +146,6 @@ public abstract class SceneEditTool {
axisMarker.setLocalTranslation(Vector3f.ZERO);
axisMarker.setLocalRotation(Quaternion.IDENTITY);
}
return null;
}
});
}
/**

@ -145,7 +145,7 @@ public class MoveTool extends SceneEditTool {
if (character != null) {
character.setPhysicsLocation(toolController.getSelectedSpatial().getWorldTranslation());
}
updateToolsTransformation();
doUpdateToolsTransformation();
wasDragging = true;
}

@ -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;

@ -44,7 +44,7 @@ public class SelectTool extends SceneEditTool {
});
if (result != null) {
updateToolsTransformation();
doUpdateToolsTransformation();
}
}

Loading…
Cancel
Save