SceneToolController AppState is now always after the CameraController in the AppState list in the SceneApplication

experimental
Nehon 10 years ago
parent 52ebd9090c
commit c3ab5b3748
  1. 9
      sdk/jme3-core/src/com/jme3/gde/core/scene/controller/AbstractCameraController.java
  2. 9
      sdk/jme3-core/src/com/jme3/gde/core/scene/controller/SceneToolController.java

@ -97,7 +97,14 @@ public abstract class AbstractCameraController extends AbstractAppState implemen
}
public void enable() {
SceneApplication.getApplication().getStateManager().attach(this);
SceneToolController c = SceneApplication.getApplication().getStateManager().getState(SceneToolController.class);
if(c != null){
SceneApplication.getApplication().getStateManager().detach(c);
SceneApplication.getApplication().getStateManager().attach(this);
SceneApplication.getApplication().getStateManager().attach(c);
}else{
SceneApplication.getApplication().getStateManager().attach(this);
}
final AbstractCameraController cc = SceneApplication.getApplication().getActiveCameraController();
SceneApplication.getApplication().setActiveCameraController(this);

@ -53,7 +53,7 @@ public class SceneToolController implements AppState {
public SceneToolController(AssetManager manager) {
this.toolsNode = new Node("ToolsNode");
initTools();
initTools();
SceneApplication.getApplication().getStateManager().attach(this);
}
@ -416,17 +416,16 @@ public class SceneToolController implements AppState {
// throw new UnsupportedOperationException("Not supported yet.");
}
public void update(float f) {
public void update(float f) {
if (selected == null || selectionShape == null) {
return;
}
selectionShape.setLocalTranslation(selected.getWorldTranslation());
selectionShape.setLocalRotation(selected.getWorldRotation());
//selectionShape.setLocalScale(selected.getWorldScale());
selectionShape.setLocalScale(selected.getWorldScale());
}
public void render(RenderManager rm) {
// throw new UnsupportedOperationException("Not supported yet.");
}

Loading…
Cancel
Save