Procházet zdrojové kódy

Merge branch 'master' into netbeans-9

MeFisto94 před 5 roky
rodič
revize
3c9dad483d

+ 1 - 1
fix_engine.sh

@@ -7,7 +7,7 @@ for d in *; do
   if [ -d "$d" ]; then
     pushd $d > /dev/null
     mv jme3-jbullet-$d.pom jbullet.pom
-    patch < $sdk/patches/jbullet_dependencies_version_missing.diff
+    patch < "$sdk/patches/jbullet_dependencies_version_missing.diff"
     mv jbullet.pom jme3-jbullet-$d.pom
     popd > /dev/null
   fi

+ 2 - 0
jdks/download-jdks.sh

@@ -143,6 +143,8 @@ function unpack_windows {
     #unzip -qq tools.zip -d .
     #rm tools.zip
 
+    find . -exec chmod u+w {} \; # Make all file writable to allow uninstaller's cleaner to remove file    
+    
     find . -type f \( -name "*.exe" -o -name "*.dll" \) -exec chmod u+rwx {} \; # Make them executable
 
     find . -type f -name "*.pack" | while read eachFile; do

+ 7 - 0
jme3-core/nbproject/project.xml

@@ -30,6 +30,13 @@
                         <specification-version>3.3.0</specification-version>
                     </run-dependency>
                 </dependency>
+                <dependency>
+                    <code-name-base>com.jme3.gde.project.testdata</code-name-base>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>3.3</specification-version>
+                    </run-dependency>
+                </dependency>
                 <dependency>
                     <code-name-base>org.apache.commons.logging</code-name-base>
                     <build-prerequisite/>

+ 87 - 6
jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java

@@ -46,12 +46,14 @@ import com.jme3.input.FlyByCamera;
 import com.jme3.input.MouseInput;
 import com.jme3.input.controls.MouseAxisTrigger;
 import com.jme3.input.controls.MouseButtonTrigger;
+import com.jme3.light.LightProbe;
 import com.jme3.light.PointLight;
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.Vector3f;
 import com.jme3.renderer.RenderManager;
 import com.jme3.renderer.ViewPort;
 import com.jme3.renderer.queue.RenderQueue.Bucket;
+import com.jme3.scene.Geometry;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 import com.jme3.scene.Spatial.CullHint;
@@ -60,6 +62,7 @@ import com.jme3.system.JmeCanvasContext;
 import com.jme3.system.awt.AwtPanel;
 import com.jme3.system.awt.AwtPanelsContext;
 import com.jme3.system.awt.PaintMode;
+import com.jme3.util.SkyFactory;
 import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -134,6 +137,8 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     private Thread thread;
     private NodeSyncAppState nodeSync;
     private FakeApplication fakeApp;
+    private LightProbe pbrLightProbe;
+    private Spatial pbrSky;
 
     public SceneApplication() {
         Logger.getLogger("com.jme3").addHandler(logHandler);
@@ -183,6 +188,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     private void attachPanel() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 panel.attachTo(true, viewPort, overlayView, guiViewPort);
                 return null;
@@ -334,6 +340,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     }
 
     //TODO: Lookup for Application
+    @Override
     public Lookup createAdditionalLookup(Lookup baseContext) {
         return Lookups.fixed(getApplication());
     }
@@ -348,24 +355,22 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     }
 
     private void notifyOpen(final SceneRequest opened) {
-        for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-            SceneListener sceneViewerListener = it.next();
+        for (SceneListener sceneViewerListener : listeners) {
             sceneViewerListener.sceneOpened(opened);
         }
     }
 
     private void notifyClose(final SceneRequest closed) {
-        for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-            SceneListener sceneViewerListener = it.next();
+        for (SceneListener sceneViewerListener : listeners) {
             sceneViewerListener.sceneClosed(closed);
         }
     }
 
     public void notifyPreview(final PreviewRequest request) {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
-                for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-                    SceneListener sceneViewerListener = it.next();
+                for (SceneListener sceneViewerListener : listeners) {
                     sceneViewerListener.previewCreated(request);
                 }
             }
@@ -388,6 +393,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
         }
         closeScene(currentSceneRequest, request);
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
                 if (request == null) {
                     return;
@@ -418,6 +424,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
                 request.setFakeApp(fakeApp);
                 fakeApp.newAssetManager(manager);
                 enqueue(new Callable() {
+                    @Override
                     public Object call() throws Exception {
                         if (manager != null) {
                             assetManager = manager;
@@ -450,6 +457,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     private void closeScene(final SceneRequest oldRequest, final SceneRequest newRequest) {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
                 if (oldRequest == null) {
                     return;
@@ -474,6 +482,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
                 //TODO: state list is not thread safe..
                 fakeApp.removeCurrentStates();
                 enqueue(new Callable() {
+                    @Override
                     public Object call() throws Exception {
                         if (physicsState != null) {
                             physicsState.getPhysicsSpace().removeAll(rootNode);
@@ -548,6 +557,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     public void enableCamLight(final boolean enabled) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (enabled) {
                     rootNode.removeLight(camLight);
@@ -562,6 +572,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     public void enableStats(final boolean enabled) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (enabled) {
                     guiNode.attachChild(statsGuiNode);
@@ -575,6 +586,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     public void enableWireFrame(final boolean selected) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (selected) {
                     viewPort.addProcessor(wireProcessor);
@@ -585,9 +597,76 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
             }
         });
     }
+    
+    public void enablePBRProbe(final boolean selected) {
+        if (pbrLightProbe == null) {
+            new Thread() {
+                @Override
+                public void run() {
+                    Spatial s = assetManager.loadModel("com/jme3/gde/core/sceneviewer/pbrenv.j3o");
+                    pbrLightProbe = (LightProbe)s.getLocalLightList().get(0);
+                    s.getLocalLightList().clear();
+                    
+                    enqueue(new Callable<Void>() {
+                        @Override
+                        public Void call() throws Exception {
+                            rootNode.addLight(pbrLightProbe);
+                            return null;
+                        }
+                    });
+                }
+                
+            }.start();
+        } else {
+            enqueue(new Callable<Void>() {
+                @Override
+                public Void call() throws Exception {
+                    if (selected) {
+                        rootNode.addLight(pbrLightProbe);
+                    } else {
+                        rootNode.removeLight(pbrLightProbe);
+                    }
+                    return null;
+                }
+            });
+        }
+    }
+    
+    public void enablePBRSkybox(final boolean selected) {
+        if (pbrSky == null) {
+            new Thread() {
+                @Override
+                public void run() {
+                    pbrSky = SkyFactory.createSky(assetManager, "Textures/Sky/Path.hdr", SkyFactory.EnvMapType.EquirectMap);
+                    
+                    enqueue(new Callable<Void>() {
+                        @Override
+                        public Void call() throws Exception {
+                            rootNode.attachChild(pbrSky);
+                            return null;
+                        }
+                    });
+                }
+                
+            }.start();
+        } else {
+            enqueue(new Callable<Void>() {
+                @Override
+                public Void call() throws Exception {
+                    if (selected) {
+                        rootNode.attachChild(pbrSky);
+                    } else {
+                        pbrSky.removeFromParent();
+                    }
+                    return null;
+                }
+            });
+        }
+    }
 
     public void setPhysicsEnabled(final boolean enabled) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (enabled) {
                     if (physicsState == null) {
@@ -636,7 +715,9 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
         NotifyUtil.show("Error starting OpenGL context!", "Click here to go to troubleshooting web page.", MessageType.EXCEPTION, lst, 0);
         logger.log(Level.INFO, exception.getMessage(), exception);
     }
+    
     private static final ActionListener lst = new ActionListener() {
+        @Override
         public void actionPerformed(ActionEvent e) {
             try {
                 HtmlBrowser.URLDisplayer.getDefault().showURL(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting"));

+ 47 - 58
jme3-core/src/com/jme3/gde/core/scene/controller/SceneToolController.java

@@ -1,12 +1,30 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright (c) 2009-2019 jMonkeyEngine All rights reserved. <p/>
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * <p>Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer. <p/> <p>Redistributions
+ * in binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution. <p/> <p>Neither the name of
+ * 'jMonkeyEngine' nor the names of its contributors may be used to endorse or
+ * promote products derived from this software without specific prior written
+ * permission. <p/> <p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
  */
 package com.jme3.gde.core.scene.controller;
 
-import com.jme3.app.Application;
-import com.jme3.app.state.AppState;
-import com.jme3.app.state.AppStateManager;
+import com.jme3.app.state.AbstractAppState;
 import com.jme3.asset.AssetManager;
 import com.jme3.bounding.BoundingBox;
 import com.jme3.bounding.BoundingVolume;
@@ -22,7 +40,6 @@ import com.jme3.gde.core.scene.SceneApplication;
 import com.jme3.material.Material;
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.Vector3f;
-import com.jme3.renderer.RenderManager;
 import com.jme3.scene.Geometry;
 import com.jme3.scene.Mesh;
 import com.jme3.scene.Node;
@@ -33,11 +50,12 @@ import com.jme3.scene.debug.WireBox;
 import java.util.concurrent.Callable;
 
 /**
- * This class can be used or extended by other plugins to display
- * standard tools in the tools scene e.g. a cursor etc.
+ * This class can be used or extended by other plugins to display standard tools
+ * in the tools scene e.g. a cursor etc.
+ *
  * @author normenhansen
  */
-public class SceneToolController implements AppState {
+public class SceneToolController extends AbstractAppState {
 
     protected Node toolsNode;
     protected boolean showSelection = false;
@@ -53,7 +71,7 @@ public class SceneToolController implements AppState {
     @SuppressWarnings("LeakingThisInConstructor")
     public SceneToolController(AssetManager manager) {
         this.toolsNode = new Node("ToolsNode");
-        initTools();        
+        initTools();
         SceneApplication.getApplication().getStateManager().attach(this);
     }
 
@@ -104,9 +122,9 @@ public class SceneToolController implements AppState {
         //grid
         grid = new Geometry("grid", new Grid(20, 20, 1.0f));
         grid.setMaterial(grayMat);
-        grid.setLocalTranslation(-10, 0, -10);        
+        grid.setLocalTranslation(-10, 0, -10);
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 toolsNode.attachChild(cursor);
                 return null;
@@ -116,7 +134,7 @@ public class SceneToolController implements AppState {
 
     public void updateSelection(final Spatial spat) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doUpdateSelection(spat);
                 return null;
@@ -147,7 +165,7 @@ public class SceneToolController implements AppState {
     public void rebuildSelectionBox() {
         if (SceneApplication.getApplication().isAwt()) {
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+                @Override
                 public Object call() throws Exception {
                     doUpdateSelection(selected);
                     return null;
@@ -162,7 +180,7 @@ public class SceneToolController implements AppState {
 
     public void setCursorLocation(final Vector3f location) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSetCursorLocation(location);
                 return null;
@@ -172,13 +190,14 @@ public class SceneToolController implements AppState {
 
     public void doSetCursorLocation(Vector3f location) {
         cursor.setLocalTranslation(location);
-        if (camController != null)
+        if (camController != null) {
             camController.doSetCamFocus(location);
+        }
     }
 
     public void snapCursorToSelection() {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSnapCursorToSelection();
                 return null;
@@ -234,7 +253,7 @@ public class SceneToolController implements AppState {
         selectionGeometry.setLocalTransform(geom.getWorldTransform());
         selectionShape = selectionGeometry;
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 toolsNode.attachChild(selectionGeometry);
                 return null;
@@ -263,7 +282,7 @@ public class SceneToolController implements AppState {
             //selectionGeometry.setLocalScale(scale);
 
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+                @Override
                 public Object call() throws Exception {
                     toolsNode.attachChild(selectionShape);
                     return null;
@@ -300,7 +319,7 @@ public class SceneToolController implements AppState {
             selectionGeometry.setLocalTransform(geom.getWorldTransform());
             selectionShape = selectionGeometry;
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+                @Override
                 public Object call() throws Exception {
                     toolsNode.attachChild(selectionGeometry);
                     return null;
@@ -314,7 +333,7 @@ public class SceneToolController implements AppState {
             final Spatial shape = selectionShape;
             selectionShape = null;
             SceneApplication.getApplication().enqueue(new Callable<Void>() {
-
+                @Override
                 public Void call() throws Exception {
                     shape.removeFromParent();
                     return null;
@@ -323,12 +342,14 @@ public class SceneToolController implements AppState {
         }
     }
 
+    @Override
     public void cleanup() {
+        super.cleanup();
         detachSelectionShape();
         final Spatial cursor = this.cursor;
         final Spatial grid = this.grid;
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
-
+            @Override
             public Void call() throws Exception {
                 cursor.removeFromParent();
                 grid.removeFromParent();
@@ -345,7 +366,7 @@ public class SceneToolController implements AppState {
 
     public void setShowSelection(final boolean showSelection) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSetShowSelection(showSelection);
                 return null;
@@ -364,7 +385,7 @@ public class SceneToolController implements AppState {
 
     public void setShowGrid(final boolean showGrid) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSetShowGrid(showGrid);
                 return null;
@@ -388,33 +409,8 @@ public class SceneToolController implements AppState {
         return toolsNode;
     }
 
-    public void initialize(AppStateManager asm, Application aplctn) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public boolean isInitialized() {
-        return true;
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void setEnabled(boolean bln) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public boolean isEnabled() {
-        return true;
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void stateAttached(AppStateManager asm) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void stateDetached(AppStateManager asm) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void update(float f) {     
+    @Override
+    public void update(float f) {
         if (selected == null || selectionShape == null) {
             return;
         }
@@ -422,14 +418,7 @@ public class SceneToolController implements AppState {
         selectionShape.setLocalTranslation(selected.getWorldTranslation());
         selectionShape.setLocalRotation(selected.getWorldRotation());
         selectionShape.setLocalScale(selected.getWorldScale());
-        
-    }
-    public void render(RenderManager rm) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
 
-    public void postRender() {
-//        throw new UnsupportedOperationException("Not supported yet.");
     }
 
     public Spatial getSelectedSpatial() {

+ 4 - 0
jme3-core/src/com/jme3/gde/core/sceneviewer/Bundle.properties

@@ -11,3 +11,7 @@ SceneViewerTopComponent.jToggleButton2.AccessibleContext.accessibleName=Ortho /
 SceneViewerTopComponent.jToggleButton1.toolTipText=show post filter effects
 SceneViewerTopComponent.jToggleButton1.text=
 SceneViewerTopComponent.enableOrtho.textO=Ortho.
+SceneViewerTopComponent.enablePBREnv.toolTipText=Toggle a PBR Environment
+SceneViewerTopComponent.enablePBREnv.text=
+SceneViewerTopComponent.enablePBRSky.toolTipText=Toggle the Skybox matching the PBR Environment (stay patient)
+SceneViewerTopComponent.enablePBRSky.text=

+ 44 - 0
jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.form

@@ -96,6 +96,50 @@
             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enableWireframeActionPerformed"/>
           </Events>
         </Component>
+        <Component class="javax.swing.JToggleButton" name="enablePBREnv">
+          <Properties>
+            <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpSmile" type="code"/>
+            </Property>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBREnv.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBREnv.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="focusable" type="boolean" value="false"/>
+            <Property name="horizontalTextPosition" type="int" value="0"/>
+            <Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpSmile" type="code"/>
+            </Property>
+            <Property name="verticalTextPosition" type="int" value="3"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enablePBREnvActionPerformed"/>
+          </Events>
+        </Component>
+        <Component class="javax.swing.JToggleButton" name="enablePBRSky">
+          <Properties>
+            <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpMad" type="code"/>
+            </Property>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBRSky.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBRSky.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="focusable" type="boolean" value="false"/>
+            <Property name="horizontalTextPosition" type="int" value="0"/>
+            <Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpMad" type="code"/>
+            </Property>
+            <Property name="verticalTextPosition" type="int" value="3"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enablePBRSkyActionPerformed"/>
+          </Events>
+        </Component>
         <Container class="javax.swing.JPanel" name="jPanel1">
 
           <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>

+ 52 - 1
jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.java

@@ -47,7 +47,8 @@ import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 
 /**
- * Top component which displays something.
+ * This is the component containing the whole scene/model<br />
+ * It also contains the top bar.
  */
 @ConvertAsProperties(dtd = "-//com.jme3.gde.core.sceneviewer//SceneViewer//EN",
 autostore = false)
@@ -92,8 +93,10 @@ public final class SceneViewerTopComponent extends TopComponent {
         //the oGLPanel may naver have the focus.
         //  if ("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false"))) {
         addMouseWheelListener(new MouseWheelListener() {
+            @Override
             public void mouseWheelMoved(final MouseWheelEvent e) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                         String action;
                         if (e.getWheelRotation() < 0) {
@@ -113,11 +116,14 @@ public final class SceneViewerTopComponent extends TopComponent {
             }
         });
         addKeyListener(new KeyListener() {
+            @Override
             public void keyTyped(KeyEvent evt) {
             }
 
+            @Override
             public void keyPressed(final KeyEvent evt) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, false);
@@ -130,8 +136,10 @@ public final class SceneViewerTopComponent extends TopComponent {
                 });
             }
 
+            @Override
             public void keyReleased(final KeyEvent evt) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, false);
@@ -161,6 +169,8 @@ public final class SceneViewerTopComponent extends TopComponent {
         jToggleButton1 = new javax.swing.JToggleButton();
         jSeparator1 = new javax.swing.JToolBar.Separator();
         enableWireframe = new javax.swing.JToggleButton();
+        enablePBREnv = new javax.swing.JToggleButton();
+        enablePBRSky = new javax.swing.JToggleButton();
         jPanel1 = new javax.swing.JPanel();
         enableStats = new javax.swing.JToggleButton();
         oGLPanel = new javax.swing.JPanel();
@@ -211,6 +221,34 @@ public final class SceneViewerTopComponent extends TopComponent {
             }
         });
         jToolBar1.add(enableWireframe);
+
+        enablePBREnv.setIcon(IconList.chimpSmile);
+        org.openide.awt.Mnemonics.setLocalizedText(enablePBREnv, org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBREnv.text")); // NOI18N
+        enablePBREnv.setToolTipText(org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBREnv.toolTipText")); // NOI18N
+        enablePBREnv.setFocusable(false);
+        enablePBREnv.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+        enablePBREnv.setSelectedIcon(IconList.chimpSmile);
+        enablePBREnv.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+        enablePBREnv.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                enablePBREnvActionPerformed(evt);
+            }
+        });
+        jToolBar1.add(enablePBREnv);
+
+        enablePBRSky.setIcon(IconList.chimpMad);
+        org.openide.awt.Mnemonics.setLocalizedText(enablePBRSky, org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBRSky.text")); // NOI18N
+        enablePBRSky.setToolTipText(org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBRSky.toolTipText")); // NOI18N
+        enablePBRSky.setFocusable(false);
+        enablePBRSky.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+        enablePBRSky.setSelectedIcon(IconList.chimpMad);
+        enablePBRSky.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+        enablePBRSky.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                enablePBRSkyActionPerformed(evt);
+            }
+        });
+        jToolBar1.add(enablePBRSky);
         jToolBar1.add(jPanel1);
 
         enableStats.setIcon(IconList.info);
@@ -248,8 +286,19 @@ public final class SceneViewerTopComponent extends TopComponent {
     private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
         FilterExplorerTopComponent.findInstance().setFilterEnabled(jToggleButton1.isSelected());
     }//GEN-LAST:event_jToggleButton1ActionPerformed
+
+    private void enablePBREnvActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enablePBREnvActionPerformed
+        app.enablePBRProbe(enablePBREnv.isSelected());
+    }//GEN-LAST:event_enablePBREnvActionPerformed
+
+    private void enablePBRSkyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enablePBRSkyActionPerformed
+        app.enablePBRSkybox(enablePBRSky.isSelected());
+    }//GEN-LAST:event_enablePBRSkyActionPerformed
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JToggleButton enableCamLight;
+    private javax.swing.JToggleButton enablePBREnv;
+    private javax.swing.JToggleButton enablePBRSky;
     private javax.swing.JToggleButton enableStats;
     private javax.swing.JToggleButton enableWireframe;
     private javax.swing.JPanel jPanel1;
@@ -264,6 +313,7 @@ public final class SceneViewerTopComponent extends TopComponent {
      * only, i.e. deserialization routines; otherwise you could get a
      * non-deserialized instance. To obtain the singleton instance, use
      * {@link #findInstance}.
+     * @return 
      */
     public static synchronized SceneViewerTopComponent getDefault() {
         if (instance == null) {
@@ -275,6 +325,7 @@ public final class SceneViewerTopComponent extends TopComponent {
     /**
      * Obtain the SceneViewerTopComponent instance. Never call
      * {@link #getDefault} directly!
+     * @return 
      */
     public static synchronized SceneViewerTopComponent findInstance() {
         TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);

binární
jme3-core/src/com/jme3/gde/core/sceneviewer/pbrenv.j3o


+ 3 - 3
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.form

@@ -77,7 +77,7 @@
           <Layout>
             <DimensionLayout dim="0">
               <Group type="103" groupAlignment="0" attributes="0">
-                  <EmptySpace min="0" pref="412" max="32767" attributes="0"/>
+                  <EmptySpace min="0" pref="372" max="32767" attributes="0"/>
               </Group>
             </DimensionLayout>
             <DimensionLayout dim="1">
@@ -90,7 +90,7 @@
         <Component class="javax.swing.JButton" name="addButton">
           <Properties>
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
-              <Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/add.png"/>
+              <Image iconType="3" name="/com/jme3/gde/core/editor/icons/add.png"/>
             </Property>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
               <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel2.addButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
@@ -107,7 +107,7 @@
         <Component class="javax.swing.JButton" name="delButton">
           <Properties>
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
-              <Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/remove.png"/>
+              <Image iconType="3" name="/com/jme3/gde/core/editor/icons/remove.png"/>
             </Property>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
               <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel2.delButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>

+ 3 - 3
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java

@@ -135,7 +135,7 @@ public final class SNDefVisualPanel2 extends JPanel {
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 412, Short.MAX_VALUE)
+            .addGap(0, 372, Short.MAX_VALUE)
         );
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -144,7 +144,7 @@ public final class SNDefVisualPanel2 extends JPanel {
 
         jToolBar1.add(jPanel1);
 
-        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/add.png"))); // NOI18N
+        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/core/editor/icons/add.png"))); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.text")); // NOI18N
         addButton.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.toolTipText")); // NOI18N
         addButton.setAlignmentX(0.5F);
@@ -155,7 +155,7 @@ public final class SNDefVisualPanel2 extends JPanel {
         });
         jToolBar1.add(addButton);
 
-        delButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/remove.png"))); // NOI18N
+        delButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/core/editor/icons/remove.png"))); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(delButton, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.text")); // NOI18N
         delButton.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.toolTipText")); // NOI18N
         delButton.setAlignmentX(0.5F);

+ 0 - 3
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/gizmo/light/DirectionalLightGizmo.java

@@ -35,11 +35,8 @@ import com.jme3.bounding.BoundingSphere;
 import com.jme3.bounding.BoundingVolume;
 import com.jme3.gde.core.sceneexplorer.nodes.JmeDirectionalLight;
 import com.jme3.gde.core.sceneexplorer.nodes.gizmo.DirectionalLightGizmoInterface;
-import com.jme3.gde.scenecomposer.SceneComposerToolController;
-import com.jme3.gde.scenecomposer.SceneComposerTopComponent;
 import com.jme3.gde.scenecomposer.gizmo.NodeCallback;
 import com.jme3.light.DirectionalLight;
-import com.jme3.math.FastMath;
 import com.jme3.math.Quaternion;
 import com.jme3.math.Vector3f;
 

+ 1 - 1
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/gizmo/light/LightGizmoFactory.java

@@ -96,7 +96,7 @@ public class LightGizmoFactory {
         mat.setColor("Color", ColorRGBA.White);
         mat.getAdditionalRenderState().setLineWidth(2f);
         
-        Geometry arrow = new Geometry("direction arrow", new Arrow(((DirectionalLight) light).getDirection().mult(5f)));
+        Geometry arrow = new Geometry("direction arrow", new Arrow(new Vector3f(0, 5, 0)));
         arrow.setMaterial(mat);
         arrow.addControl(new LightColorUpdate(light, arrow.getMaterial(), "Color"));
         

+ 2 - 2
version.gradle

@@ -57,7 +57,7 @@ ext {
 }
 
 def getReleaseInfo(String tag) {
-    if (tag == null) {
+    if (tag == null || tag == "") {
         // not a tagged commit
         return null;
     }
@@ -68,7 +68,7 @@ def getReleaseInfo(String tag) {
     tag = tag.substring(1)
     The SDK has it’s own versioning scheme which doesn’t start with v…*/
 
-    String[] parts = tag.split("-", 2);
+    String[] parts = tag.split("-");
     String mainVersion;
     boolean prerelease;
     String releaseName = null;