diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/AddSkyboxAction.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/AddSkyboxAction.java
index ab1ad0611..0cd412451 100644
--- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/AddSkyboxAction.java
+++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/AddSkyboxAction.java
@@ -4,6 +4,7 @@
*/
package com.jme3.gde.terraineditor.sky;
+import com.jme3.asset.TextureKey;
import com.jme3.gde.core.sceneexplorer.nodes.actions.AbstractNewSpatialWizardAction;
import com.jme3.gde.core.sceneexplorer.nodes.actions.NewSpatialAction;
import com.jme3.math.Vector3f;
@@ -68,7 +69,13 @@ public class AddSkyboxAction extends AbstractNewSpatialWizardAction {
Texture textureSingle = (Texture) wiz.getProperty("textureSingle");
Vector3f normalScale = (Vector3f) wiz.getProperty("normalScale");
boolean useSpheremap = (Boolean) wiz.getProperty("useSpheremap");
- return SkyFactory.createSky(pm, textureSingle, normalScale, useSpheremap);
+ boolean flipY = (Boolean) wiz.getProperty("flipY");
+ // reload the texture so we can use flipY
+ TextureKey key = (TextureKey) textureSingle.getKey();
+ TextureKey newKey = new TextureKey(key.getName(), flipY);
+ newKey.setGenerateMips(true);
+ newKey.setAsCube(!useSpheremap);
+ return SkyFactory.createSky(pm, pm.loadTexture(newKey), normalScale, useSpheremap);
}
}
diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/Bundle.properties b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/Bundle.properties
index 4efcbacfa..794a01ca7 100644
--- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/Bundle.properties
+++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/Bundle.properties
@@ -31,3 +31,4 @@ SkyboxVisualPanel2.westPic.text=
SkyboxVisualPanel2.topPic.text=
SkyboxVisualPanel2.bottomPic.text=
SkyboxVisualPanel2.singlePic.text=
+SkyboxVisualPanel2.flipYcheckBox.text=Flip Y
diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.form b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.form
index b8f5b0fa3..291361d1e 100644
--- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.form
+++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.form
@@ -391,7 +391,10 @@
-
+
+
+
+
@@ -418,7 +421,9 @@
-
+
+
+
@@ -483,6 +488,13 @@
+
+
+
+
+
+
+
diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.java
index 242dce20e..7abe313dd 100644
--- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.java
+++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxVisualPanel2.java
@@ -142,6 +142,7 @@ public final class SkyboxVisualPanel2 extends JPanel {
normal2Z = new javax.swing.JTextField();
spheremapCheckBox = new javax.swing.JCheckBox();
singlePic = new javax.swing.JLabel();
+ flipYcheckBox = new javax.swing.JCheckBox();
titleLabel.setFont(new java.awt.Font("Tahoma", 1, 14));
org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(SkyboxVisualPanel2.class, "SkyboxVisualPanel2.titleLabel.text")); // NOI18N
@@ -349,6 +350,8 @@ public final class SkyboxVisualPanel2 extends JPanel {
org.openide.awt.Mnemonics.setLocalizedText(singlePic, org.openide.util.NbBundle.getMessage(SkyboxVisualPanel2.class, "SkyboxVisualPanel2.singlePic.text")); // NOI18N
+ org.openide.awt.Mnemonics.setLocalizedText(flipYcheckBox, org.openide.util.NbBundle.getMessage(SkyboxVisualPanel2.class, "SkyboxVisualPanel2.flipYcheckBox.text")); // NOI18N
+
javax.swing.GroupLayout singleTexturePanelLayout = new javax.swing.GroupLayout(singleTexturePanel);
singleTexturePanel.setLayout(singleTexturePanelLayout);
singleTexturePanelLayout.setHorizontalGroup(
@@ -370,7 +373,9 @@ public final class SkyboxVisualPanel2 extends JPanel {
.addComponent(normal2Y, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)
.addComponent(normal2Z, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(spheremapCheckBox))
+ .addGroup(singleTexturePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(flipYcheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(spheremapCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap(31, Short.MAX_VALUE))
);
singleTexturePanelLayout.setVerticalGroup(
@@ -390,7 +395,9 @@ public final class SkyboxVisualPanel2 extends JPanel {
.addComponent(jLabel9))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(spheremapCheckBox)
- .addContainerGap(98, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(flipYcheckBox)
+ .addContainerGap(75, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -561,6 +568,7 @@ public final class SkyboxVisualPanel2 extends JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel bottomPic;
private javax.swing.JLabel eastPic;
+ private javax.swing.JCheckBox flipYcheckBox;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
@@ -621,4 +629,8 @@ public final class SkyboxVisualPanel2 extends JPanel {
public JCheckBox getSpheremapCheckBox() {
return spheremapCheckBox;
}
+
+ public JCheckBox getFlipYCheckBox() {
+ return flipYcheckBox;
+ }
}
diff --git a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java
index 85010ab92..d58ad0dba 100644
--- a/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java
+++ b/sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java
@@ -143,6 +143,7 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
float z = new Float(comp.getNormal2Z().getText());
wiz.putProperty("normalScale", new Vector3f(x,y,z) );
wiz.putProperty("useSpheremap", comp.getSpheremapCheckBox().isSelected());
+ wiz.putProperty("flipY", comp.getFlipYCheckBox().isSelected());
}
}
}