in examples, replace deprecated methods and classes
This commit is contained in:
		
							parent
							
								
									e536699d9e
								
							
						
					
					
						commit
						d3f0c2002a
					
				| @ -76,7 +76,7 @@ public class TestChooser extends JDialog { | |||||||
|     /** |     /** | ||||||
|      * Only accessed from EDT |      * Only accessed from EDT | ||||||
|      */ |      */ | ||||||
|     private Object[] selectedClass = null; |     private java.util.List selectedClass = null; | ||||||
|     private boolean showSetting = true; |     private boolean showSetting = true; | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -246,7 +246,7 @@ public class TestChooser extends JDialog { | |||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void startApp(final Object[] appClass){ |     private void startApp(final java.util.List appClass){ | ||||||
|         if (appClass == null){ |         if (appClass == null){ | ||||||
|             JOptionPane.showMessageDialog(rootPane, |             JOptionPane.showMessageDialog(rootPane, | ||||||
|                                           "Please select a test from the list", |                                           "Please select a test from the list", | ||||||
| @ -257,8 +257,8 @@ public class TestChooser extends JDialog { | |||||||
| 
 | 
 | ||||||
|             new Thread(new Runnable(){ |             new Thread(new Runnable(){ | ||||||
|                 public void run(){ |                 public void run(){ | ||||||
|                     for (int i = 0; i < appClass.length; i++) { |                     for (int i = 0; i < appClass.size(); i++) { | ||||||
|                 	    Class<?> clazz = (Class)appClass[i]; |                 	    Class<?> clazz = (Class)appClass.get(i); | ||||||
|                 		try { |                 		try { | ||||||
|                 			if (LegacyApplication.class.isAssignableFrom(clazz)) { |                 			if (LegacyApplication.class.isAssignableFrom(clazz)) { | ||||||
|                     			Object app = clazz.newInstance(); |                     			Object app = clazz.newInstance(); | ||||||
| @ -333,7 +333,7 @@ public class TestChooser extends JDialog { | |||||||
|         list.getSelectionModel().addListSelectionListener( |         list.getSelectionModel().addListSelectionListener( | ||||||
|                 new ListSelectionListener() { |                 new ListSelectionListener() { | ||||||
|                     public void valueChanged(ListSelectionEvent e) { |                     public void valueChanged(ListSelectionEvent e) { | ||||||
|                         selectedClass = list.getSelectedValues(); |                         selectedClass = list.getSelectedValuesList(); | ||||||
|                     } |                     } | ||||||
|                 }); |                 }); | ||||||
|         list.addMouseListener(new MouseAdapter() { |         list.addMouseListener(new MouseAdapter() { | ||||||
| @ -485,7 +485,7 @@ public class TestChooser extends JDialog { | |||||||
|         }); |         }); | ||||||
|         jtf.addActionListener(new ActionListener() { |         jtf.addActionListener(new ActionListener() { | ||||||
|             public void actionPerformed(ActionEvent e) { |             public void actionPerformed(ActionEvent e) { | ||||||
|                 selectedClass = classes.getSelectedValues(); |                 selectedClass = classes.getSelectedValuesList(); | ||||||
|                 startApp(selectedClass); |                 startApp(selectedClass); | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ | |||||||
|  */ |  */ | ||||||
| package jme3test.animation; | package jme3test.animation; | ||||||
| 
 | 
 | ||||||
| import com.jme3.cinematic.events.GuiTrack; | import com.jme3.cinematic.events.GuiEvent; | ||||||
| import de.lessvoid.nifty.Nifty; | import de.lessvoid.nifty.Nifty; | ||||||
| import de.lessvoid.nifty.elements.render.TextRenderer; | import de.lessvoid.nifty.elements.render.TextRenderer; | ||||||
| 
 | 
 | ||||||
| @ -39,7 +39,7 @@ import de.lessvoid.nifty.elements.render.TextRenderer; | |||||||
|  * |  * | ||||||
|  * @author Nehon |  * @author Nehon | ||||||
|  */ |  */ | ||||||
| public class SubtitleTrack extends GuiTrack{ | public class SubtitleTrack extends GuiEvent{ | ||||||
|     private String text=""; |     private String text=""; | ||||||
| 
 | 
 | ||||||
|     public SubtitleTrack(Nifty nifty, String screen,float initialDuration, String text) { |     public SubtitleTrack(Nifty nifty, String screen,float initialDuration, String text) { | ||||||
| @ -50,7 +50,8 @@ public class SubtitleTrack extends GuiTrack{ | |||||||
|     @Override |     @Override | ||||||
|     public void onPlay() { |     public void onPlay() { | ||||||
|         super.onPlay(); |         super.onPlay(); | ||||||
|         nifty.getScreen(screen).findElementByName("text").getRenderer(TextRenderer.class).setText(text); |         nifty.getScreen(screen).findElementById("text") | ||||||
|  |                 .getRenderer(TextRenderer.class).setText(text); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -57,7 +57,7 @@ import com.jme3.scene.CameraNode; | |||||||
| import com.jme3.scene.Geometry; | import com.jme3.scene.Geometry; | ||||||
| import com.jme3.scene.Spatial; | import com.jme3.scene.Spatial; | ||||||
| import com.jme3.scene.shape.Box; | import com.jme3.scene.shape.Box; | ||||||
| import com.jme3.shadow.PssmShadowRenderer; | import com.jme3.shadow.DirectionalLightShadowRenderer; | ||||||
| import de.lessvoid.nifty.Nifty; | import de.lessvoid.nifty.Nifty; | ||||||
| 
 | 
 | ||||||
| public class TestCinematic extends SimpleApplication { | public class TestCinematic extends SimpleApplication { | ||||||
| @ -237,10 +237,11 @@ public class TestCinematic extends SimpleApplication { | |||||||
|         fpp.addFilter(fade); |         fpp.addFilter(fade); | ||||||
| 
 | 
 | ||||||
|         if (renderer.getCaps().contains(Caps.GLSL100)) { |         if (renderer.getCaps().contains(Caps.GLSL100)) { | ||||||
|             PssmShadowRenderer pssm = new PssmShadowRenderer(assetManager, 512, 1); |             DirectionalLightShadowRenderer dlsr | ||||||
|             pssm.setDirection(new Vector3f(0, -1, -1).normalizeLocal()); |                     = new DirectionalLightShadowRenderer(assetManager, 512, 1); | ||||||
|             pssm.setShadowIntensity(0.4f); |             dlsr.setLight(light); | ||||||
|             viewPort.addProcessor(pssm); |             dlsr.setShadowIntensity(0.4f); | ||||||
|  |             viewPort.addProcessor(dlsr); | ||||||
|             viewPort.addProcessor(fpp); |             viewPort.addProcessor(fpp); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -29,6 +29,7 @@ | |||||||
| package jme3test.audio; | package jme3test.audio; | ||||||
| 
 | 
 | ||||||
| import com.jme3.app.SimpleApplication; | import com.jme3.app.SimpleApplication; | ||||||
|  | import com.jme3.audio.AudioData.DataType; | ||||||
| import com.jme3.audio.AudioNode; | import com.jme3.audio.AudioNode; | ||||||
| import com.jme3.audio.Environment; | import com.jme3.audio.Environment; | ||||||
| import com.jme3.material.Material; | import com.jme3.material.Material; | ||||||
| @ -55,13 +56,15 @@ public class TestAmbient extends SimpleApplication { | |||||||
|     Environment env = new Environment(eax); |     Environment env = new Environment(eax); | ||||||
|     audioRenderer.setEnvironment(env); |     audioRenderer.setEnvironment(env); | ||||||
| 
 | 
 | ||||||
|     waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", false); |     waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", | ||||||
|  |             DataType.Buffer); | ||||||
|     waves.setPositional(true); |     waves.setPositional(true); | ||||||
|     waves.setLocalTranslation(new Vector3f(0, 0,0)); |     waves.setLocalTranslation(new Vector3f(0, 0,0)); | ||||||
|     waves.setMaxDistance(100); |     waves.setMaxDistance(100); | ||||||
|     waves.setRefDistance(5); |     waves.setRefDistance(5); | ||||||
| 
 | 
 | ||||||
|     nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", true); |     nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", | ||||||
|  |             DataType.Stream); | ||||||
|     nature.setPositional(false); |     nature.setPositional(false); | ||||||
|     nature.setVolume(3); |     nature.setVolume(3); | ||||||
|      |      | ||||||
|  | |||||||
| @ -34,6 +34,7 @@ package jme3test.audio; | |||||||
| 
 | 
 | ||||||
| import com.jme3.app.SimpleApplication; | import com.jme3.app.SimpleApplication; | ||||||
| import com.jme3.asset.plugins.UrlLocator; | import com.jme3.asset.plugins.UrlLocator; | ||||||
|  | import com.jme3.audio.AudioData; | ||||||
| import com.jme3.audio.AudioNode; | import com.jme3.audio.AudioNode; | ||||||
| 
 | 
 | ||||||
| public class TestMusicStreaming extends SimpleApplication { | public class TestMusicStreaming extends SimpleApplication { | ||||||
| @ -46,7 +47,8 @@ public class TestMusicStreaming extends SimpleApplication { | |||||||
|     @Override |     @Override | ||||||
|     public void simpleInitApp(){ |     public void simpleInitApp(){ | ||||||
|         assetManager.registerLocator("http://www.vorbis.com/music/", UrlLocator.class); |         assetManager.registerLocator("http://www.vorbis.com/music/", UrlLocator.class); | ||||||
|         AudioNode audioSource = new AudioNode(assetManager, "Lumme-Badloop.ogg", true); |         AudioNode audioSource = new AudioNode(assetManager, "Lumme-Badloop.ogg", | ||||||
|  |                 AudioData.DataType.Stream); | ||||||
|         audioSource.setPositional(false); |         audioSource.setPositional(false); | ||||||
|         audioSource.setReverbEnabled(false); |         audioSource.setReverbEnabled(false); | ||||||
|         audioSource.play(); |         audioSource.play(); | ||||||
|  | |||||||
| @ -29,6 +29,7 @@ | |||||||
| package jme3test.audio; | package jme3test.audio; | ||||||
| 
 | 
 | ||||||
| import com.jme3.app.SimpleApplication; | import com.jme3.app.SimpleApplication; | ||||||
|  | import com.jme3.audio.AudioData; | ||||||
| import com.jme3.audio.AudioNode; | import com.jme3.audio.AudioNode; | ||||||
| import com.jme3.audio.Environment; | import com.jme3.audio.Environment; | ||||||
| import com.jme3.math.FastMath; | import com.jme3.math.FastMath; | ||||||
| @ -47,7 +48,8 @@ public class TestReverb extends SimpleApplication { | |||||||
| 
 | 
 | ||||||
|   @Override |   @Override | ||||||
|   public void simpleInitApp() { |   public void simpleInitApp() { | ||||||
|     audioSource = new AudioNode(assetManager, "Sound/Effects/Bang.wav"); |     audioSource = new AudioNode(assetManager, "Sound/Effects/Bang.wav", | ||||||
|  |             AudioData.DataType.Buffer); | ||||||
| 
 | 
 | ||||||
|     float[] eax = new float[]{15, 38.0f, 0.300f, -1000, -3300, 0, |     float[] eax = new float[]{15, 38.0f, 0.300f, -1000, -3300, 0, | ||||||
|       1.49f, 0.54f, 1.00f, -2560, 0.162f, 0.00f, 0.00f, 0.00f, |       1.49f, 0.54f, 1.00f, -2560, 0.162f, 0.00f, 0.00f, 0.00f, | ||||||
|  | |||||||
| @ -30,6 +30,7 @@ | |||||||
| package jme3test.audio; | package jme3test.audio; | ||||||
| 
 | 
 | ||||||
| import com.jme3.app.SimpleApplication; | import com.jme3.app.SimpleApplication; | ||||||
|  | import com.jme3.audio.AudioData; | ||||||
| import com.jme3.audio.AudioNode; | import com.jme3.audio.AudioNode; | ||||||
| 
 | 
 | ||||||
| public class TestWav extends SimpleApplication { | public class TestWav extends SimpleApplication { | ||||||
| @ -54,7 +55,8 @@ public class TestWav extends SimpleApplication { | |||||||
| 
 | 
 | ||||||
|   @Override |   @Override | ||||||
|   public void simpleInitApp() { |   public void simpleInitApp() { | ||||||
|     audioSource = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false); |     audioSource = new AudioNode(assetManager, "Sound/Effects/Gun.wav", | ||||||
|  |             AudioData.DataType.Buffer); | ||||||
|     audioSource.setLooping(false); |     audioSource.setLooping(false); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -102,8 +102,9 @@ public class BombControl extends RigidBodyControl implements PhysicsCollisionLis | |||||||
|         effect.setGravity(0, -5f, 0); |         effect.setGravity(0, -5f, 0); | ||||||
|         effect.setLowLife(.4f); |         effect.setLowLife(.4f); | ||||||
|         effect.setHighLife(.5f); |         effect.setHighLife(.5f); | ||||||
|         effect.setInitialVelocity(new Vector3f(0, 7, 0)); |         effect.getParticleInfluencer() | ||||||
|         effect.setVelocityVariation(1f); |                 .setInitialVelocity(new Vector3f(0, 7, 0)); | ||||||
|  |         effect.getParticleInfluencer().setVelocityVariation(1f); | ||||||
|         effect.setImagesX(2); |         effect.setImagesX(2); | ||||||
|         effect.setImagesY(2); |         effect.setImagesY(2); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
|  | |||||||
| @ -54,9 +54,8 @@ import com.jme3.renderer.Camera; | |||||||
| import com.jme3.renderer.queue.RenderQueue.ShadowMode; | import com.jme3.renderer.queue.RenderQueue.ShadowMode; | ||||||
| import com.jme3.scene.Geometry; | import com.jme3.scene.Geometry; | ||||||
| import com.jme3.scene.Spatial; | import com.jme3.scene.Spatial; | ||||||
| import com.jme3.shadow.PssmShadowRenderer; | import com.jme3.shadow.DirectionalLightShadowRenderer; | ||||||
| import com.jme3.shadow.PssmShadowRenderer.CompareMode; | import com.jme3.shadow.EdgeFilteringMode; | ||||||
| import com.jme3.shadow.PssmShadowRenderer.FilterMode; |  | ||||||
| import com.jme3.system.AppSettings; | import com.jme3.system.AppSettings; | ||||||
| import com.jme3.terrain.geomipmap.TerrainLodControl; | import com.jme3.terrain.geomipmap.TerrainLodControl; | ||||||
| import com.jme3.terrain.geomipmap.TerrainQuad; | import com.jme3.terrain.geomipmap.TerrainQuad; | ||||||
| @ -65,6 +64,7 @@ import com.jme3.terrain.heightmap.ImageBasedHeightMap; | |||||||
| import com.jme3.texture.Texture; | import com.jme3.texture.Texture; | ||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
| @ -113,21 +113,22 @@ public class TestHoveringTank extends SimpleApplication implements AnalogListene | |||||||
|         stateManager.attach(bulletAppState); |         stateManager.attach(bulletAppState); | ||||||
| //        bulletAppState.getPhysicsSpace().enableDebug(assetManager); | //        bulletAppState.getPhysicsSpace().enableDebug(assetManager); | ||||||
|         bulletAppState.getPhysicsSpace().setAccuracy(1f/30f); |         bulletAppState.getPhysicsSpace().setAccuracy(1f/30f); | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds", EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         PssmShadowRenderer pssmr = new PssmShadowRenderer(assetManager, 2048, 3); |         DirectionalLightShadowRenderer dlsr  | ||||||
|         pssmr.setDirection(new Vector3f(-0.5f, -0.3f, -0.3f).normalizeLocal()); |                 = new DirectionalLightShadowRenderer(assetManager, 2048, 3); | ||||||
|         pssmr.setLambda(0.55f); |         dlsr.setLambda(0.55f); | ||||||
|         pssmr.setShadowIntensity(0.6f); |         dlsr.setShadowIntensity(0.6f); | ||||||
|         pssmr.setCompareMode(CompareMode.Hardware); |         dlsr.setEdgeFilteringMode(EdgeFilteringMode.Bilinear); | ||||||
|         pssmr.setFilterMode(FilterMode.Bilinear); |         viewPort.addProcessor(dlsr); | ||||||
|         viewPort.addProcessor(pssmr); |  | ||||||
| 
 | 
 | ||||||
|         setupKeys(); |         setupKeys(); | ||||||
|         createTerrain(); |         createTerrain(); | ||||||
|         buildPlayer(); |         buildPlayer(); | ||||||
| 
 | 
 | ||||||
|         DirectionalLight dl = new DirectionalLight(); |         DirectionalLight dl = new DirectionalLight(); | ||||||
|  |         dlsr.setLight(dl); | ||||||
|         dl.setColor(new ColorRGBA(1.0f, 0.94f, 0.8f, 1f).multLocal(1.3f)); |         dl.setColor(new ColorRGBA(1.0f, 0.94f, 0.8f, 1f).multLocal(1.3f)); | ||||||
|         dl.setDirection(new Vector3f(-0.5f, -0.3f, -0.3f).normalizeLocal()); |         dl.setDirection(new Vector3f(-0.5f, -0.3f, -0.3f).normalizeLocal()); | ||||||
|         rootNode.addLight(dl); |         rootNode.addLight(dl); | ||||||
|  | |||||||
| @ -217,8 +217,9 @@ public class TestWalkingChar extends SimpleApplication implements ActionListener | |||||||
|         effect.setGravity(0, -5, 0); |         effect.setGravity(0, -5, 0); | ||||||
|         effect.setLowLife(.4f); |         effect.setLowLife(.4f); | ||||||
|         effect.setHighLife(.5f); |         effect.setHighLife(.5f); | ||||||
|         effect.setInitialVelocity(new Vector3f(0, 7, 0)); |         effect.getParticleInfluencer() | ||||||
|         effect.setVelocityVariation(1f); |                 .setInitialVelocity(new Vector3f(0, 7, 0)); | ||||||
|  |         effect.getParticleInfluencer().setVelocityVariation(1f); | ||||||
|         effect.setImagesX(2); |         effect.setImagesX(2); | ||||||
|         effect.setImagesY(2); |         effect.setImagesY(2); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
| @ -237,7 +238,9 @@ public class TestWalkingChar extends SimpleApplication implements ActionListener | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void createSky() { |     private void createSky() { | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void createTerrain() { |     private void createTerrain() { | ||||||
|  | |||||||
| @ -36,7 +36,8 @@ import com.jme3.app.SimpleApplication; | |||||||
| import com.jme3.light.DirectionalLight; | import com.jme3.light.DirectionalLight; | ||||||
| import com.jme3.material.Material; | import com.jme3.material.Material; | ||||||
| import com.jme3.math.*; | import com.jme3.math.*; | ||||||
| import com.jme3.post.HDRRenderer; | import com.jme3.post.FilterPostProcessor; | ||||||
|  | import com.jme3.post.filters.ToneMapFilter; | ||||||
| import com.jme3.renderer.Caps; | import com.jme3.renderer.Caps; | ||||||
| import com.jme3.renderer.queue.RenderQueue.ShadowMode; | import com.jme3.renderer.queue.RenderQueue.ShadowMode; | ||||||
| import com.jme3.scene.Geometry; | import com.jme3.scene.Geometry; | ||||||
| @ -44,7 +45,7 @@ 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.scene.shape.Box; | import com.jme3.scene.shape.Box; | ||||||
| import com.jme3.shadow.BasicShadowRenderer; | import com.jme3.shadow.DirectionalLightShadowRenderer; | ||||||
| import com.jme3.texture.Texture; | import com.jme3.texture.Texture; | ||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
| @ -52,8 +53,8 @@ import com.jme3.util.TangentBinormalGenerator; | |||||||
| 
 | 
 | ||||||
| public class TestEverything extends SimpleApplication { | public class TestEverything extends SimpleApplication { | ||||||
| 
 | 
 | ||||||
|     private BasicShadowRenderer bsr; |     private DirectionalLightShadowRenderer dlsr; | ||||||
|     private HDRRenderer hdrRender; |     private ToneMapFilter toneMapFilter; | ||||||
|     private Vector3f lightDir = new Vector3f(-1, -1, .5f).normalizeLocal(); |     private Vector3f lightDir = new Vector3f(-1, -1, .5f).normalizeLocal(); | ||||||
| 
 | 
 | ||||||
|     public static void main(String[] args){ |     public static void main(String[] args){ | ||||||
| @ -63,26 +64,20 @@ public class TestEverything extends SimpleApplication { | |||||||
| 
 | 
 | ||||||
|     public void setupHdr(){ |     public void setupHdr(){ | ||||||
|         if (renderer.getCaps().contains(Caps.GLSL100)){ |         if (renderer.getCaps().contains(Caps.GLSL100)){ | ||||||
|             hdrRender = new HDRRenderer(assetManager, renderer); |             toneMapFilter = new ToneMapFilter(); | ||||||
|             hdrRender.setMaxIterations(40); |             toneMapFilter.setWhitePoint(new Vector3f(3f, 3f, 3f)); | ||||||
|             hdrRender.setSamples(settings.getSamples()); |             FilterPostProcessor fpp = new FilterPostProcessor(assetManager); | ||||||
| 
 |             fpp.addFilter(toneMapFilter); | ||||||
|             hdrRender.setWhiteLevel(3); |             viewPort.addProcessor(fpp); | ||||||
|             hdrRender.setExposure(0.72f); |  | ||||||
|             hdrRender.setThrottle(1); |  | ||||||
| 
 | 
 | ||||||
|     //        setPauseOnLostFocus(false); |     //        setPauseOnLostFocus(false); | ||||||
|     //        new HDRConfig(hdrRender).setVisible(true); |  | ||||||
| 
 |  | ||||||
|             viewPort.addProcessor(hdrRender); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void setupBasicShadow(){ |     public void setupBasicShadow(){ | ||||||
|         if (renderer.getCaps().contains(Caps.GLSL100)){ |         if (renderer.getCaps().contains(Caps.GLSL100)){ | ||||||
|             bsr = new BasicShadowRenderer(assetManager, 1024); |             dlsr = new DirectionalLightShadowRenderer(assetManager, 1024, 1); | ||||||
|             bsr.setDirection(lightDir); |             viewPort.addProcessor(dlsr); | ||||||
|             viewPort.addProcessor(bsr); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -93,16 +88,20 @@ public class TestEverything extends SimpleApplication { | |||||||
|         }else{ |         }else{ | ||||||
|             envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg"); |             envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg"); | ||||||
|         } |         } | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, envMap, new Vector3f(-1,-1,-1), true)); |         rootNode.attachChild(SkyFactory.createSky(assetManager, envMap,  | ||||||
|  |                 new Vector3f(-1,-1,-1), SkyFactory.EnvMapType.SphereMap)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void setupLighting(){ |     public void setupLighting(){ | ||||||
|         boolean hdr = false; |         boolean hdr = false; | ||||||
|         if (hdrRender != null){ |         if (toneMapFilter != null){ | ||||||
|             hdr = hdrRender.isEnabled(); |             hdr = toneMapFilter.isEnabled(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         DirectionalLight dl = new DirectionalLight(); |         DirectionalLight dl = new DirectionalLight(); | ||||||
|  |         if (dlsr != null) { | ||||||
|  |             dlsr.setLight(dl); | ||||||
|  |         } | ||||||
|         dl.setDirection(lightDir); |         dl.setDirection(lightDir); | ||||||
|         if (hdr){ |         if (hdr){ | ||||||
|             dl.setColor(new ColorRGBA(3, 3, 3, 1)); |             dl.setColor(new ColorRGBA(3, 3, 3, 1)); | ||||||
|  | |||||||
| @ -98,8 +98,9 @@ public class TestExplosionEffect extends SimpleApplication { | |||||||
|         flash.setGravity(0, 0, 0); |         flash.setGravity(0, 0, 0); | ||||||
|         flash.setLowLife(.2f); |         flash.setLowLife(.2f); | ||||||
|         flash.setHighLife(.2f); |         flash.setHighLife(.2f); | ||||||
|         flash.setInitialVelocity(new Vector3f(0, 5f, 0)); |         flash.getParticleInfluencer() | ||||||
|         flash.setVelocityVariation(1); |                 .setInitialVelocity(new Vector3f(0, 5f, 0)); | ||||||
|  |         flash.getParticleInfluencer().setVelocityVariation(1); | ||||||
|         flash.setImagesX(2); |         flash.setImagesX(2); | ||||||
|         flash.setImagesY(2); |         flash.setImagesY(2); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
| @ -120,8 +121,9 @@ public class TestExplosionEffect extends SimpleApplication { | |||||||
|         roundspark.setGravity(0, -.5f, 0); |         roundspark.setGravity(0, -.5f, 0); | ||||||
|         roundspark.setLowLife(1.8f); |         roundspark.setLowLife(1.8f); | ||||||
|         roundspark.setHighLife(2f); |         roundspark.setHighLife(2f); | ||||||
|         roundspark.setInitialVelocity(new Vector3f(0, 3, 0)); |         roundspark.getParticleInfluencer() | ||||||
|         roundspark.setVelocityVariation(.5f); |                 .setInitialVelocity(new Vector3f(0, 3, 0)); | ||||||
|  |         roundspark.getParticleInfluencer().setVelocityVariation(.5f); | ||||||
|         roundspark.setImagesX(1); |         roundspark.setImagesX(1); | ||||||
|         roundspark.setImagesY(1); |         roundspark.setImagesY(1); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
| @ -165,8 +167,9 @@ public class TestExplosionEffect extends SimpleApplication { | |||||||
|         smoketrail.setGravity(0, 1, 0); |         smoketrail.setGravity(0, 1, 0); | ||||||
|         smoketrail.setLowLife(.4f); |         smoketrail.setLowLife(.4f); | ||||||
|         smoketrail.setHighLife(.5f); |         smoketrail.setHighLife(.5f); | ||||||
|         smoketrail.setInitialVelocity(new Vector3f(0, 12, 0)); |         smoketrail.getParticleInfluencer() | ||||||
|         smoketrail.setVelocityVariation(1); |                 .setInitialVelocity(new Vector3f(0, 12, 0)); | ||||||
|  |         smoketrail.getParticleInfluencer().setVelocityVariation(1); | ||||||
|         smoketrail.setImagesX(1); |         smoketrail.setImagesX(1); | ||||||
|         smoketrail.setImagesY(3); |         smoketrail.setImagesY(3); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
| @ -190,8 +193,9 @@ public class TestExplosionEffect extends SimpleApplication { | |||||||
|         debris.setGravity(0, 12f, 0); |         debris.setGravity(0, 12f, 0); | ||||||
|         debris.setLowLife(1.4f); |         debris.setLowLife(1.4f); | ||||||
|         debris.setHighLife(1.5f); |         debris.setHighLife(1.5f); | ||||||
|         debris.setInitialVelocity(new Vector3f(0, 15, 0)); |         debris.getParticleInfluencer() | ||||||
|         debris.setVelocityVariation(.60f); |                 .setInitialVelocity(new Vector3f(0, 15, 0)); | ||||||
|  |         debris.getParticleInfluencer().setVelocityVariation(.60f); | ||||||
|         debris.setImagesX(3); |         debris.setImagesX(3); | ||||||
|         debris.setImagesY(3); |         debris.setImagesY(3); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
| @ -214,8 +218,9 @@ public class TestExplosionEffect extends SimpleApplication { | |||||||
|         shockwave.setGravity(0, 0, 0); |         shockwave.setGravity(0, 0, 0); | ||||||
|         shockwave.setLowLife(0.5f); |         shockwave.setLowLife(0.5f); | ||||||
|         shockwave.setHighLife(0.5f); |         shockwave.setHighLife(0.5f); | ||||||
|         shockwave.setInitialVelocity(new Vector3f(0, 0, 0)); |         shockwave.getParticleInfluencer() | ||||||
|         shockwave.setVelocityVariation(0f); |                 .setInitialVelocity(new Vector3f(0, 0, 0)); | ||||||
|  |         shockwave.getParticleInfluencer().setVelocityVariation(0f); | ||||||
|         shockwave.setImagesX(1); |         shockwave.setImagesX(1); | ||||||
|         shockwave.setImagesY(1); |         shockwave.setImagesY(1); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
|  | |||||||
| @ -60,10 +60,11 @@ public class TestMovingParticle extends SimpleApplication { | |||||||
|     public void simpleInitApp() { |     public void simpleInitApp() { | ||||||
|         emit = new ParticleEmitter("Emitter", Type.Triangle, 300); |         emit = new ParticleEmitter("Emitter", Type.Triangle, 300); | ||||||
|         emit.setGravity(0, 0, 0); |         emit.setGravity(0, 0, 0); | ||||||
|         emit.setVelocityVariation(1); |         emit.getParticleInfluencer().setVelocityVariation(1); | ||||||
|         emit.setLowLife(1); |         emit.setLowLife(1); | ||||||
|         emit.setHighLife(1); |         emit.setHighLife(1); | ||||||
|         emit.setInitialVelocity(new Vector3f(0, .5f, 0)); |         emit.getParticleInfluencer() | ||||||
|  |                 .setInitialVelocity(new Vector3f(0, .5f, 0)); | ||||||
|         emit.setImagesX(15); |         emit.setImagesX(15); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
|         mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png")); |         mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png")); | ||||||
|  | |||||||
| @ -57,7 +57,7 @@ public class TestParticleExportingCloning extends SimpleApplication { | |||||||
|         emit.setGravity(0, 0, 0); |         emit.setGravity(0, 0, 0); | ||||||
|         emit.setLowLife(5); |         emit.setLowLife(5); | ||||||
|         emit.setHighLife(10); |         emit.setHighLife(10); | ||||||
|         emit.setInitialVelocity(new Vector3f(0, 0, 0)); |         emit.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 0)); | ||||||
|         emit.setImagesX(15); |         emit.setImagesX(15); | ||||||
|         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); |         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md"); | ||||||
|         mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png")); |         mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png")); | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| package jme3test.helloworld; | package jme3test.helloworld; | ||||||
| 
 | 
 | ||||||
| import com.jme3.app.SimpleApplication; | import com.jme3.app.SimpleApplication; | ||||||
|  | import com.jme3.audio.AudioData.DataType; | ||||||
| import com.jme3.audio.AudioNode; | import com.jme3.audio.AudioNode; | ||||||
| import com.jme3.input.MouseInput; | import com.jme3.input.MouseInput; | ||||||
| import com.jme3.input.controls.ActionListener; | import com.jme3.input.controls.ActionListener; | ||||||
| @ -42,14 +43,16 @@ public class HelloAudio extends SimpleApplication { | |||||||
|   /** We create two audio nodes. */ |   /** We create two audio nodes. */ | ||||||
|   private void initAudio() { |   private void initAudio() { | ||||||
|     /* gun shot sound is to be triggered by a mouse click. */ |     /* gun shot sound is to be triggered by a mouse click. */ | ||||||
|     audio_gun = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false); |     audio_gun = new AudioNode(assetManager,  | ||||||
|  |             "Sound/Effects/Gun.wav", DataType.Buffer); | ||||||
|     audio_gun.setPositional(false); |     audio_gun.setPositional(false); | ||||||
|     audio_gun.setLooping(false); |     audio_gun.setLooping(false); | ||||||
|     audio_gun.setVolume(2); |     audio_gun.setVolume(2); | ||||||
|     rootNode.attachChild(audio_gun); |     rootNode.attachChild(audio_gun); | ||||||
| 
 | 
 | ||||||
|     /* nature sound - keeps playing in a loop. */ |     /* nature sound - keeps playing in a loop. */ | ||||||
|     audio_nature = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", true); |     audio_nature = new AudioNode(assetManager,  | ||||||
|  |             "Sound/Environment/Ocean Waves.ogg", DataType.Stream); | ||||||
|     audio_nature.setLooping(true);  // activate continuous playing |     audio_nature.setLooping(true);  // activate continuous playing | ||||||
|     audio_nature.setPositional(true);    |     audio_nature.setPositional(true);    | ||||||
|     audio_nature.setVolume(3); |     audio_nature.setVolume(3); | ||||||
|  | |||||||
| @ -59,6 +59,7 @@ import com.jme3.shadow.EdgeFilteringMode; | |||||||
| import com.jme3.texture.Texture; | import com.jme3.texture.Texture; | ||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| import com.jme3.util.TangentBinormalGenerator; | import com.jme3.util.TangentBinormalGenerator; | ||||||
| 
 | 
 | ||||||
| public class TestDirectionalLightShadow extends SimpleApplication implements ActionListener, AnalogListener { | public class TestDirectionalLightShadow extends SimpleApplication implements ActionListener, AnalogListener { | ||||||
| @ -155,7 +156,8 @@ public class TestDirectionalLightShadow extends SimpleApplication implements Act | |||||||
|         al.setColor(ColorRGBA.White.mult(0.02f)); |         al.setColor(ColorRGBA.White.mult(0.02f)); | ||||||
|         rootNode.addLight(al); |         rootNode.addLight(al); | ||||||
| 
 | 
 | ||||||
|         Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false); |         Spatial sky = SkyFactory.createSky(assetManager, | ||||||
|  |                 "Scenes/Beach/FullskiesSunset0068.dds", EnvMapType.CubeMap); | ||||||
|         sky.setLocalScale(350); |         sky.setLocalScale(350); | ||||||
| 
 | 
 | ||||||
|         rootNode.attachChild(sky); |         rootNode.attachChild(sky); | ||||||
|  | |||||||
| @ -48,7 +48,8 @@ public class TestEnvironmentMapping extends SimpleApplication { | |||||||
|         chaseCam.setLookAtOffset(new Vector3f(0,0.5f,-1.0f)); |         chaseCam.setLookAtOffset(new Vector3f(0,0.5f,-1.0f)); | ||||||
|         buggy.addControl(chaseCam); |         buggy.addControl(chaseCam); | ||||||
|         rootNode.attachChild(buggy); |         rootNode.attachChild(buggy); | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, tex, false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager, tex, | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         FilterPostProcessor fpp = new FilterPostProcessor(assetManager); |         FilterPostProcessor fpp = new FilterPostProcessor(assetManager); | ||||||
|         BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects); |         BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects); | ||||||
|  | |||||||
| @ -93,7 +93,7 @@ public class TestCustomAnim extends SimpleApplication { | |||||||
|         box.setBuffer(indicesBuf); |         box.setBuffer(indicesBuf); | ||||||
| 
 | 
 | ||||||
|         // Create bind pose buffers |         // Create bind pose buffers | ||||||
|         box.generateBindPose(true); |         box.generateBindPose(); | ||||||
| 
 | 
 | ||||||
|         // Create skeleton |         // Create skeleton | ||||||
|         bone = new Bone("root"); |         bone = new Bone("root"); | ||||||
|  | |||||||
| @ -49,6 +49,7 @@ import com.jme3.scene.Spatial; | |||||||
| import com.jme3.scene.debug.WireFrustum; | import com.jme3.scene.debug.WireFrustum; | ||||||
| import com.jme3.scene.shape.Box; | import com.jme3.scene.shape.Box; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| 
 | 
 | ||||||
| public class TestBloom extends SimpleApplication { | public class TestBloom extends SimpleApplication { | ||||||
| 
 | 
 | ||||||
| @ -114,7 +115,9 @@ public class TestBloom extends SimpleApplication { | |||||||
|         rootNode.addLight(light); |         rootNode.addLight(light); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         Spatial sky = SkyFactory.createSky(assetManager, "Textures/Sky/Bright/FullskiesBlueClear03.dds", false); |         Spatial sky = SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/FullskiesBlueClear03.dds",  | ||||||
|  |                 EnvMapType.CubeMap); | ||||||
|         sky.setCullHint(Spatial.CullHint.Never); |         sky.setCullHint(Spatial.CullHint.Never); | ||||||
|         rootNode.attachChild(sky); |         rootNode.attachChild(sky); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -51,6 +51,7 @@ import com.jme3.scene.Spatial; | |||||||
| import com.jme3.scene.debug.WireFrustum; | import com.jme3.scene.debug.WireFrustum; | ||||||
| import com.jme3.scene.shape.Box; | import com.jme3.scene.shape.Box; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| 
 | 
 | ||||||
| public class TestBloomAlphaThreshold extends SimpleApplication | public class TestBloomAlphaThreshold extends SimpleApplication | ||||||
| { | { | ||||||
| @ -101,7 +102,10 @@ public class TestBloomAlphaThreshold extends SimpleApplication | |||||||
| 		teapot.setLocalScale(10.0f); | 		teapot.setLocalScale(10.0f); | ||||||
| 		rootNode.attachChild(teapot); | 		rootNode.attachChild(teapot); | ||||||
| 
 | 
 | ||||||
| 		Geometry soil = new Geometry("soil", new Box(new Vector3f(0, -13, 550), 800, 10, 700)); |                 Vector3f boxMin1 = new Vector3f(-800f, -23f, -150f); | ||||||
|  |                 Vector3f boxMax1 = new Vector3f(800f, 3f, 1250f); | ||||||
|  |                 Box boxMesh1 = new Box(boxMin1, boxMax1); | ||||||
|  | 		Geometry soil = new Geometry("soil", boxMesh1); | ||||||
| 		soil.setMaterial(matSoil); | 		soil.setMaterial(matSoil); | ||||||
| 		soil.setShadowMode(ShadowMode.CastAndReceive); | 		soil.setShadowMode(ShadowMode.CastAndReceive); | ||||||
| 		rootNode.attachChild(soil); | 		rootNode.attachChild(soil); | ||||||
| @ -110,7 +114,10 @@ public class TestBloomAlphaThreshold extends SimpleApplication | |||||||
| 		matBox.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png")); | 		matBox.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png")); | ||||||
| 		matBox.setFloat("AlphaDiscardThreshold", 0.5f); | 		matBox.setFloat("AlphaDiscardThreshold", 0.5f); | ||||||
|      |      | ||||||
| 		Geometry box = new Geometry("box", new Box(new Vector3f(-3.5f, 10, -2), 2, 2, 2)); |                 Vector3f boxMin2 = new Vector3f(-5.5f, 8f, -4f); | ||||||
|  |                 Vector3f boxMax2 = new Vector3f(-1.5f, 12f, 0f); | ||||||
|  |                 Box boxMesh2 = new Box(boxMin2, boxMax2); | ||||||
|  | 		Geometry box = new Geometry("box", boxMesh2); | ||||||
| 		box.setMaterial(matBox); | 		box.setMaterial(matBox); | ||||||
|                 box.setQueueBucket(RenderQueue.Bucket.Translucent); |                 box.setQueueBucket(RenderQueue.Bucket.Translucent); | ||||||
| 		// box.setShadowMode(ShadowMode.CastAndReceive); | 		// box.setShadowMode(ShadowMode.CastAndReceive); | ||||||
| @ -122,7 +129,9 @@ public class TestBloomAlphaThreshold extends SimpleApplication | |||||||
| 		rootNode.addLight(light); | 		rootNode.addLight(light); | ||||||
| 
 | 
 | ||||||
| 		// load sky | 		// load sky | ||||||
| 		Spatial sky = SkyFactory.createSky(assetManager, "Textures/Sky/Bright/FullskiesBlueClear03.dds", false); | 		Spatial sky = SkyFactory.createSky(assetManager,  | ||||||
|  |                         "Textures/Sky/Bright/FullskiesBlueClear03.dds", | ||||||
|  |                         EnvMapType.CubeMap); | ||||||
| 		sky.setCullHint(Spatial.CullHint.Never); | 		sky.setCullHint(Spatial.CullHint.Never); | ||||||
| 		rootNode.attachChild(sky); | 		rootNode.attachChild(sky); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -49,6 +49,7 @@ import com.jme3.scene.Spatial; | |||||||
| import com.jme3.scene.debug.WireFrustum; | import com.jme3.scene.debug.WireFrustum; | ||||||
| import com.jme3.scene.shape.Box; | import com.jme3.scene.shape.Box; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| 
 | 
 | ||||||
| public class TestCrossHatch extends SimpleApplication { | public class TestCrossHatch extends SimpleApplication { | ||||||
| 
 | 
 | ||||||
| @ -114,7 +115,9 @@ public class TestCrossHatch extends SimpleApplication { | |||||||
|         rootNode.addLight(light); |         rootNode.addLight(light); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         Spatial sky = SkyFactory.createSky(assetManager, "Textures/Sky/Bright/FullskiesBlueClear03.dds", false); |         Spatial sky = SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/FullskiesBlueClear03.dds", | ||||||
|  |                 EnvMapType.CubeMap); | ||||||
|         sky.setCullHint(Spatial.CullHint.Never); |         sky.setCullHint(Spatial.CullHint.Never); | ||||||
|         rootNode.attachChild(sky); |         rootNode.attachChild(sky); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ import com.jme3.terrain.heightmap.ImageBasedHeightMap; | |||||||
| import com.jme3.texture.Texture; | import com.jme3.texture.Texture; | ||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
| @ -65,7 +66,8 @@ public class TestDepthOfField extends SimpleApplication { | |||||||
|         cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0})); |         cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0})); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false); |         Spatial sky = SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Scenes/Beach/FullskiesSunset0068.dds", EnvMapType.CubeMap); | ||||||
|         sky.setLocalScale(350); |         sky.setLocalScale(350); | ||||||
|         mainScene.attachChild(sky); |         mainScene.attachChild(sky); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -77,7 +77,9 @@ public class TestFog extends SimpleApplication { | |||||||
|         cam.setRotation(new Quaternion(0.023536969f, 0.9361278f, -0.016098259f, -0.35050195f)); |         cam.setRotation(new Quaternion(0.023536969f, 0.9361278f, -0.016098259f, -0.35050195f)); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         mainScene.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         mainScene.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
|         createTerrain(mainScene); |         createTerrain(mainScene); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -44,7 +44,6 @@ import com.jme3.renderer.queue.RenderQueue.ShadowMode; | |||||||
| import com.jme3.scene.Geometry; | import com.jme3.scene.Geometry; | ||||||
| import com.jme3.scene.Node; | import com.jme3.scene.Node; | ||||||
| import com.jme3.scene.Spatial; | import com.jme3.scene.Spatial; | ||||||
| import com.jme3.shadow.PssmShadowRenderer; |  | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
| import com.jme3.util.TangentBinormalGenerator; | import com.jme3.util.TangentBinormalGenerator; | ||||||
| 
 | 
 | ||||||
| @ -76,7 +75,9 @@ public class TestLightScattering extends SimpleApplication { | |||||||
|         rootNode.attachChild(scene); |         rootNode.attachChild(scene); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/FullskiesBlueClear03.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager, | ||||||
|  |                 "Textures/Sky/Bright/FullskiesBlueClear03.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         DirectionalLight sun = new DirectionalLight(); |         DirectionalLight sun = new DirectionalLight(); | ||||||
|         Vector3f lightDir = new Vector3f(-0.12f, -0.3729129f, 0.74847335f); |         Vector3f lightDir = new Vector3f(-0.12f, -0.3729129f, 0.74847335f); | ||||||
|  | |||||||
| @ -126,7 +126,9 @@ public class TestMultiViewsFilters extends SimpleApplication { | |||||||
| 
 | 
 | ||||||
|          |          | ||||||
|          |          | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         final FilterPostProcessor fpp = new FilterPostProcessor(assetManager); |         final FilterPostProcessor fpp = new FilterPostProcessor(assetManager); | ||||||
|         final FilterPostProcessor fpp2 = new FilterPostProcessor(assetManager); |         final FilterPostProcessor fpp2 = new FilterPostProcessor(assetManager); | ||||||
|  | |||||||
| @ -72,7 +72,9 @@ public class TestMultiplesFilters extends SimpleApplication { | |||||||
|         cam.setRotation(new Quaternion(0.0016069f, 0.9810479f, -0.008143323f, 0.19358753f)); |         cam.setRotation(new Quaternion(0.0016069f, 0.9810479f, -0.008143323f, 0.19358753f)); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         // create the geometry and attach it |         // create the geometry and attach it | ||||||
|         // load the level from zip or http zip |         // load the level from zip or http zip | ||||||
|  | |||||||
| @ -50,6 +50,7 @@ import com.jme3.system.AppSettings; | |||||||
| import com.jme3.texture.Texture; | import com.jme3.texture.Texture; | ||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| import com.jme3.util.TangentBinormalGenerator; | import com.jme3.util.TangentBinormalGenerator; | ||||||
| 
 | 
 | ||||||
| public class TestPostFilters extends SimpleApplication implements ActionListener { | public class TestPostFilters extends SimpleApplication implements ActionListener { | ||||||
| @ -88,7 +89,9 @@ public class TestPostFilters extends SimpleApplication implements ActionListener | |||||||
|         } else { |         } else { | ||||||
|             envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg"); |             envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg"); | ||||||
|         } |         } | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, envMap, new Vector3f(-1, -1, -1), true)); |         Spatial sky = SkyFactory.createSky(assetManager, envMap,  | ||||||
|  |                 new Vector3f(-1f, -1f, -1f), EnvMapType.SphereMap); | ||||||
|  |         rootNode.attachChild(sky); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void setupLighting() { |     public void setupLighting() { | ||||||
|  | |||||||
| @ -41,12 +41,14 @@ import com.jme3.math.Vector3f; | |||||||
| import com.jme3.renderer.Camera; | import com.jme3.renderer.Camera; | ||||||
| import com.jme3.renderer.ViewPort; | import com.jme3.renderer.ViewPort; | ||||||
| import com.jme3.scene.Geometry; | import com.jme3.scene.Geometry; | ||||||
|  | import com.jme3.scene.Spatial; | ||||||
| import com.jme3.scene.shape.Box; | import com.jme3.scene.shape.Box; | ||||||
| import com.jme3.texture.FrameBuffer; | import com.jme3.texture.FrameBuffer; | ||||||
| import com.jme3.texture.Image.Format; | import com.jme3.texture.Image.Format; | ||||||
| import com.jme3.texture.Texture; | import com.jme3.texture.Texture; | ||||||
| import com.jme3.texture.TextureCubeMap; | import com.jme3.texture.TextureCubeMap; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Renders a rotating box to a cubemap texture, then applies the cubemap |  * Renders a rotating box to a cubemap texture, then applies the cubemap | ||||||
| @ -114,7 +116,9 @@ public class TestRenderToCubemap  extends SimpleApplication { | |||||||
|         cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y); |         cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y); | ||||||
|   |   | ||||||
|         Texture offTex = setupOffscreenView(); |         Texture offTex = setupOffscreenView(); | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, offTex, false)); |         Spatial sky = SkyFactory.createSky(assetManager, offTex,  | ||||||
|  |                 EnvMapType.CubeMap); | ||||||
|  |         rootNode.attachChild(sky); | ||||||
|     } |     } | ||||||
|   |   | ||||||
|     @Override |     @Override | ||||||
|  | |||||||
| @ -66,7 +66,9 @@ public class TestSceneLoading extends SimpleApplication { | |||||||
|         this.flyCam.setMoveSpeed(10); |         this.flyCam.setMoveSpeed(10); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         File file = new File("wildhouse.zip"); |         File file = new File("wildhouse.zip"); | ||||||
|         if (!file.exists()) { |         if (!file.exists()) { | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import com.jme3.texture.Texture; | |||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.texture.Texture2D; | import com.jme3.texture.Texture2D; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| import com.jme3.water.WaterFilter; | import com.jme3.water.WaterFilter; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -73,7 +74,8 @@ public class TestMultiPostWater extends SimpleApplication { | |||||||
|         cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0})); |         cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0})); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false); |         Spatial sky = SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Scenes/Beach/FullskiesSunset0068.dds", EnvMapType.CubeMap); | ||||||
|         sky.setLocalScale(350); |         sky.setLocalScale(350); | ||||||
| 
 | 
 | ||||||
|         mainScene.attachChild(sky); |         mainScene.attachChild(sky); | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| package jme3test.water; | package jme3test.water; | ||||||
| 
 | 
 | ||||||
| import com.jme3.app.SimpleApplication; | import com.jme3.app.SimpleApplication; | ||||||
|  | import com.jme3.audio.AudioData.DataType; | ||||||
| import com.jme3.audio.AudioNode; | import com.jme3.audio.AudioNode; | ||||||
| import com.jme3.audio.LowPassFilter; | import com.jme3.audio.LowPassFilter; | ||||||
| import com.jme3.effect.ParticleEmitter; | import com.jme3.effect.ParticleEmitter; | ||||||
| @ -35,6 +36,7 @@ import com.jme3.texture.Texture; | |||||||
| import com.jme3.texture.Texture.WrapMode; | import com.jme3.texture.Texture.WrapMode; | ||||||
| import com.jme3.texture.Texture2D; | import com.jme3.texture.Texture2D; | ||||||
| import com.jme3.util.SkyFactory; | import com.jme3.util.SkyFactory; | ||||||
|  | import com.jme3.util.SkyFactory.EnvMapType; | ||||||
| import com.jme3.water.WaterFilter; | import com.jme3.water.WaterFilter; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -93,7 +95,8 @@ public class TestPostWater extends SimpleApplication { | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false); |         Spatial sky = SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Scenes/Beach/FullskiesSunset0068.dds", EnvMapType.CubeMap); | ||||||
|         sky.setLocalScale(350); |         sky.setLocalScale(350); | ||||||
| 
 | 
 | ||||||
|         mainScene.attachChild(sky); |         mainScene.attachChild(sky); | ||||||
| @ -149,7 +152,8 @@ public class TestPostWater extends SimpleApplication { | |||||||
|          |          | ||||||
|         uw = cam.getLocation().y < waterHeight; |         uw = cam.getLocation().y < waterHeight; | ||||||
| 
 | 
 | ||||||
|         waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", false); |         waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", | ||||||
|  |                 DataType.Buffer); | ||||||
|         waves.setLooping(true); |         waves.setLooping(true); | ||||||
|         waves.setReverbEnabled(true); |         waves.setReverbEnabled(true); | ||||||
|         if (uw) { |         if (uw) { | ||||||
|  | |||||||
| @ -62,7 +62,9 @@ public class TestPostWaterLake extends SimpleApplication { | |||||||
|       //  cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f)); |       //  cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f)); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         rootNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|         File file = new File("wildhouse.zip"); |         File file = new File("wildhouse.zip"); | ||||||
|          |          | ||||||
|  | |||||||
| @ -66,7 +66,9 @@ public class TestSceneWater extends SimpleApplication { | |||||||
|         cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f)); |         cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f)); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         mainScene.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         mainScene.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
| 
 | 
 | ||||||
|          |          | ||||||
|         File file = new File("wildhouse.zip"); |         File file = new File("wildhouse.zip"); | ||||||
|  | |||||||
| @ -103,7 +103,9 @@ public class TestSimpleWater extends SimpleApplication implements ActionListener | |||||||
|         sceneNode.attachChild(geom); |         sceneNode.attachChild(geom); | ||||||
| 
 | 
 | ||||||
|         // load sky |         // load sky | ||||||
|         sceneNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false)); |         sceneNode.attachChild(SkyFactory.createSky(assetManager,  | ||||||
|  |                 "Textures/Sky/Bright/BrightSky.dds",  | ||||||
|  |                 SkyFactory.EnvMapType.CubeMap)); | ||||||
|         rootNode.attachChild(sceneNode); |         rootNode.attachChild(sceneNode); | ||||||
| 
 | 
 | ||||||
|         //add lightPos Geometry |         //add lightPos Geometry | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user