|
@@ -48,6 +48,8 @@ import com.jme3.scene.Node;
|
|
import com.jme3.scene.Spatial;
|
|
import com.jme3.scene.Spatial;
|
|
import com.jme3.scene.Spatial.CullHint;
|
|
import com.jme3.scene.Spatial.CullHint;
|
|
import com.jme3.system.AppSettings;
|
|
import com.jme3.system.AppSettings;
|
|
|
|
+import com.jme3.system.awt.AwtPanel;
|
|
|
|
+import com.jme3.system.awt.AwtPanelsContext;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
@@ -108,11 +110,14 @@ public class SceneApplication extends Application implements LookupProvider, Loo
|
|
private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Opening SceneViewer..");
|
|
private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Opening SceneViewer..");
|
|
private String lastError = "";
|
|
private String lastError = "";
|
|
private boolean started = false;
|
|
private boolean started = false;
|
|
|
|
+ private AwtPanel panel;
|
|
|
|
+ private ViewPort overlayView;
|
|
|
|
|
|
public SceneApplication() {
|
|
public SceneApplication() {
|
|
progressHandle.start(7);
|
|
progressHandle.start(7);
|
|
try {
|
|
try {
|
|
AppSettings newSetting = new AppSettings(true);
|
|
AppSettings newSetting = new AppSettings(true);
|
|
|
|
+ newSetting.setCustomRenderer(AwtPanelsContext.class);
|
|
newSetting.setFrameRate(30);
|
|
newSetting.setFrameRate(30);
|
|
setSettings(newSetting);
|
|
setSettings(newSetting);
|
|
|
|
|
|
@@ -123,9 +128,9 @@ public class SceneApplication extends Application implements LookupProvider, Loo
|
|
//add listener for project selection
|
|
//add listener for project selection
|
|
nodeSelectionResult = Utilities.actionsGlobalContext().lookupResult(JmeSpatial.class);
|
|
nodeSelectionResult = Utilities.actionsGlobalContext().lookupResult(JmeSpatial.class);
|
|
nodeSelectionResult.addLookupListener(this);
|
|
nodeSelectionResult.addLookupListener(this);
|
|
|
|
+// createCanvas();
|
|
|
|
+// startCanvas(true);
|
|
|
|
|
|
- createCanvas();
|
|
|
|
- startCanvas(true);
|
|
|
|
progressHandle.progress("initialize Base Application", 1);
|
|
progressHandle.progress("initialize Base Application", 1);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
getProgressHandle().finish();
|
|
getProgressHandle().finish();
|
|
@@ -136,6 +141,20 @@ public class SceneApplication extends Application implements LookupProvider, Loo
|
|
SceneViewerTopComponent.showOpenGLError(e.toString());
|
|
SceneViewerTopComponent.showOpenGLError(e.toString());
|
|
Exceptions.printStackTrace(e);
|
|
Exceptions.printStackTrace(e);
|
|
}
|
|
}
|
|
|
|
+ start();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public AwtPanel getMainPanel() {
|
|
|
|
+ if (panel == null) {
|
|
|
|
+ panel = ((AwtPanelsContext) getContext()).createPanel(true);
|
|
|
|
+ panel.attachTo(viewPort, guiViewPort, overlayView);
|
|
|
|
+ ((AwtPanelsContext) getContext()).setInputSource(panel);
|
|
|
|
+ }
|
|
|
|
+ return panel;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ViewPort getOverlayView(){
|
|
|
|
+ return overlayView;
|
|
}
|
|
}
|
|
|
|
|
|
private void loadFPSText() {
|
|
private void loadFPSText() {
|
|
@@ -160,6 +179,11 @@ public class SceneApplication extends Application implements LookupProvider, Loo
|
|
public void initialize() {
|
|
public void initialize() {
|
|
try {
|
|
try {
|
|
super.initialize();
|
|
super.initialize();
|
|
|
|
+ {
|
|
|
|
+ overlayView = getRenderManager().createMainView("Overlay", cam);
|
|
|
|
+ overlayView.setClearFlags(false, true, false);
|
|
|
|
+ guiViewPort.setClearFlags(false, false, false);
|
|
|
|
+ }
|
|
getProgressHandle().progress("Setup Camera Controller", 2);
|
|
getProgressHandle().progress("Setup Camera Controller", 2);
|
|
//create camera controler
|
|
//create camera controler
|
|
camController = new SceneCameraController(cam, inputManager);
|
|
camController = new SceneCameraController(cam, inputManager);
|