From d5339a1ec0de5462d02bad2888b1743aebb4408b Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Thu, 23 Apr 2020 12:32:54 -0700 Subject: [PATCH] improve initial camera orientations in jme3test.terrain (9 files) --- .../src/main/java/jme3test/terrain/TerrainFractalGridTest.java | 2 ++ .../main/java/jme3test/terrain/TerrainGridAlphaMapTest.java | 2 ++ .../java/jme3test/terrain/TerrainGridSerializationTest.java | 2 ++ .../src/main/java/jme3test/terrain/TerrainGridTest.java | 3 ++- .../main/java/jme3test/terrain/TerrainGridTileLoaderTest.java | 2 ++ jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java | 3 ++- .../src/main/java/jme3test/terrain/TerrainTestAndroid.java | 3 ++- .../main/java/jme3test/terrain/TerrainTestModifyHeight.java | 3 ++- .../src/main/java/jme3test/terrain/TerrainTestReadWrite.java | 2 ++ 9 files changed, 18 insertions(+), 4 deletions(-) diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainFractalGridTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainFractalGridTest.java index 0ab647d62..27f6a6c60 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainFractalGridTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainFractalGridTest.java @@ -5,6 +5,7 @@ import com.jme3.app.state.ScreenshotAppState; import com.jme3.bullet.control.CharacterControl; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.terrain.geomipmap.TerrainGrid; import com.jme3.terrain.geomipmap.TerrainGridLodControl; @@ -136,6 +137,7 @@ public class TerrainFractalGridTest extends SimpleApplication { this.getCamera().setLocation(new Vector3f(0, 300, 0)); + cam.setRotation(new Quaternion(0.51176f, -0.14f, 0.085f, 0.84336f)); this.viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f)); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java index cf5e9d75c..a8be2ae2b 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java @@ -16,6 +16,7 @@ import com.jme3.light.AmbientLight; import com.jme3.light.DirectionalLight; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector2f; import com.jme3.math.Vector3f; import com.jme3.scene.Geometry; @@ -165,6 +166,7 @@ public class TerrainGridAlphaMapTest extends SimpleApplication { this.getCamera().setLocation(new Vector3f(0, 256, 0)); + cam.setRotation(new Quaternion(-0.1f, 0.89826f, -0.2695f, -0.3325f)); this.viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f)); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java index b20357ded..20321b530 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java @@ -13,6 +13,7 @@ import com.jme3.input.KeyInput; import com.jme3.input.controls.ActionListener; import com.jme3.input.controls.KeyTrigger; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.terrain.geomipmap.TerrainGrid; import com.jme3.terrain.geomipmap.TerrainGridListener; @@ -58,6 +59,7 @@ public class TerrainGridSerializationTest extends SimpleApplication { stateManager.attach(bulletAppState); this.getCamera().setLocation(new Vector3f(0, 256, 0)); + cam.setRotation(new Quaternion(-0.0075f, 0.949784f, -0.312f, -0.0227f)); this.viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f)); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java index 1781b7106..45f0a799b 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java @@ -14,6 +14,7 @@ import com.jme3.input.controls.KeyTrigger; import com.jme3.light.DirectionalLight; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.terrain.geomipmap.TerrainGrid; import com.jme3.terrain.geomipmap.TerrainGridListener; @@ -109,7 +110,7 @@ public class TerrainGridTest extends SimpleApplication { stateManager.attach(bulletAppState); this.getCamera().setLocation(new Vector3f(0, 400, 0)); - this.getCamera().lookAt(new Vector3f(0,0,0), Vector3f.UNIT_Y); + cam.setRotation(new Quaternion(0.61573f, -0.0054f, 0.0042f, 0.78793f)); this.viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f)); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java index 3485e4dc8..dd7f67fad 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java @@ -16,6 +16,7 @@ import com.jme3.input.controls.KeyTrigger; import com.jme3.input.controls.MouseButtonTrigger; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.terrain.Terrain; import com.jme3.terrain.geomipmap.TerrainGrid; @@ -120,6 +121,7 @@ public class TerrainGridTileLoaderTest extends SimpleApplication { stateManager.attach(bulletAppState); this.getCamera().setLocation(new Vector3f(0, 256, 0)); + cam.setRotation(new Quaternion(-0.0075f, 0.949784f, -0.312f, -0.0227f)); this.viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f)); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java index 27bd88c58..dfe50b7b9 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java @@ -40,6 +40,7 @@ import com.jme3.light.DirectionalLight; import com.jme3.light.PointLight; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.scene.Geometry; import com.jme3.terrain.geomipmap.TerrainLodControl; @@ -169,7 +170,7 @@ public class TerrainTest extends SimpleApplication { rootNode.addLight(light); cam.setLocation(new Vector3f(0, 10, -10)); - cam.lookAtDirection(new Vector3f(0, -1.5f, -1).normalizeLocal(), Vector3f.UNIT_Y); + cam.setRotation(new Quaternion(0.012f, 0.964311f, -0.261f, 0.043f)); } public void loadHintText() { diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java index 48f87f358..901896ce9 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java @@ -40,6 +40,7 @@ import com.jme3.light.DirectionalLight; import com.jme3.light.PointLight; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.scene.Geometry; import com.jme3.terrain.geomipmap.TerrainLodControl; @@ -150,7 +151,7 @@ public class TerrainTestAndroid extends SimpleApplication { rootNode.addLight(light); cam.setLocation(new Vector3f(0, 10, -10)); - cam.lookAtDirection(new Vector3f(0, -1.5f, -1).normalizeLocal(), Vector3f.UNIT_Y); + cam.setRotation(new Quaternion(0.01f, 0.964871f, -0.25966f, 0.0387f)); } public void loadHintText() { diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java index b68761593..0b6d1c0fd 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java @@ -45,6 +45,7 @@ import com.jme3.light.DirectionalLight; import com.jme3.material.Material; import com.jme3.material.RenderState.BlendMode; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Ray; import com.jme3.math.Vector2f; import com.jme3.math.Vector3f; @@ -152,7 +153,7 @@ public class TerrainTestModifyHeight extends SimpleApplication { rootNode.addLight(ambLight); cam.setLocation(new Vector3f(0, 256, 0)); - cam.lookAtDirection(new Vector3f(0, -1f, 0).normalizeLocal(), Vector3f.UNIT_X); + cam.setRotation(new Quaternion(0.25966f, 0.690398f, -0.2952f, 0.60727f)); } public void loadHintText() { diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java index 861096298..f92b63fe1 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java @@ -42,6 +42,7 @@ import com.jme3.input.controls.KeyTrigger; import com.jme3.light.DirectionalLight; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; +import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; import com.jme3.scene.Node; import com.jme3.terrain.Terrain; @@ -175,6 +176,7 @@ public class TerrainTestReadWrite extends SimpleApplication { private void createControls() { flyCam.setMoveSpeed(50); cam.setLocation(new Vector3f(0, 100, 0)); + cam.setRotation(new Quaternion(-0.1779f, 0.821934f, -0.39033f, -0.3747f)); inputManager.addMapping("save", new KeyTrigger(KeyInput.KEY_T)); inputManager.addListener(saveActionListener, "save");