From dde203f3478b0fdaa2c3834d02b0df0878395a10 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Thu, 10 Nov 2011 01:44:49 +0000 Subject: [PATCH] SDK: - fix VehicleCreator camera threading git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8630 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../gde/vehiclecreator/VehicleCreatorTopComponent.java | 7 +++++++ .../jme3/gde/vehiclecreator/VehicleEditorController.java | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleCreatorTopComponent.java b/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleCreatorTopComponent.java index 54a1763b9..aafb7770a 100644 --- a/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleCreatorTopComponent.java +++ b/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleCreatorTopComponent.java @@ -44,6 +44,7 @@ public final class VehicleCreatorTopComponent extends TopComponent implements Sc private boolean testing = false; DirectionalLight dirLight = new DirectionalLight(); private HelpCtx ctx = new HelpCtx("sdk.vehicle_creator"); + private VehicleCreatorCameraController cameraController; public VehicleCreatorTopComponent() { initComponents(); @@ -889,6 +890,8 @@ public final class VehicleCreatorTopComponent extends TopComponent implements Sc currentRequest = null; final VehicleEditorController controller = editorController; setLoadedScene(null, false); + cameraController.disable(); + cameraController = null; SceneApplication.getApplication().enqueue(new Callable() { public Void call() throws Exception { @@ -904,6 +907,10 @@ public final class VehicleCreatorTopComponent extends TopComponent implements Sc if (request == sentRequest) { currentRequest = request; editorController = newEditorController; + cameraController = new VehicleCreatorCameraController(SceneApplication.getApplication().getCamera(), SceneApplication.getApplication().getInputManager()); + cameraController.setMaster(this); + cameraController.enable(); + cameraController.setVehicle(request.getRootNode()); setLoadedScene(currentRequest.getDataObject().getNodeDelegate(), true); final VehicleEditorController controller = editorController; SceneApplication.getApplication().enqueue(new Callable() { diff --git a/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleEditorController.java b/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleEditorController.java index d3fb55f43..058ef021e 100644 --- a/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleEditorController.java +++ b/sdk/jme3-vehicle-creator/src/com/jme3/gde/vehiclecreator/VehicleEditorController.java @@ -60,7 +60,6 @@ public class VehicleEditorController implements LookupListener, ActionListener { private Result result2; private List list = new LinkedList(); private SceneToolController toolController; - private VehicleCreatorCameraController cameraController; private Node toolsNode; private BulletAppState bulletState; private boolean testing = false; @@ -107,16 +106,10 @@ public class VehicleEditorController implements LookupListener, ActionListener { SceneApplication.getApplication().getInputManager().addMapping("VehicleEditor_Space", new KeyTrigger(KeyInput.KEY_SPACE)); SceneApplication.getApplication().getInputManager().addMapping("VehicleEditor_Reset", new KeyTrigger(KeyInput.KEY_RETURN)); SceneApplication.getApplication().getInputManager().addListener(this, "VehicleEditor_Left", "VehicleEditor_Right", "VehicleEditor_Up", "VehicleEditor_Down", "VehicleEditor_Space", "VehicleEditor_Reset"); - cameraController = new VehicleCreatorCameraController(SceneApplication.getApplication().getCamera(), SceneApplication.getApplication().getInputManager()); - cameraController.setMaster(this); - cameraController.enable(); - cameraController.setVehicle(rootNode); } public void cleanupApplication() { SceneApplication.getApplication().getInputManager().removeListener(this); - cameraController.disable(); - cameraController = null; SceneApplication.getApplication().getStateManager().detach(getBulletState()); }