From 112a77fd5dfcb85c636740740488b374fbb5e714 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 10 Apr 2016 11:59:49 -0400 Subject: [PATCH] test: don't use deprecated box constructor --- .../java/jme3test/android/SimpleTexturedTest.java | 2 +- .../main/java/com/jme3/cinematic/MotionPath.java | 3 ++- .../jme3test/animation/TestCameraMotionPath.java | 3 ++- .../main/java/jme3test/animation/TestCinematic.java | 3 ++- .../java/jme3test/animation/TestMotionPath.java | 3 ++- .../java/jme3test/app/TestAppStateLifeCycle.java | 2 +- .../main/java/jme3test/app/TestBareBonesApp.java | 2 +- .../java/jme3test/app/TestReleaseDirectMemory.java | 2 +- .../src/main/java/jme3test/audio/TestAmbient.java | 2 +- .../src/main/java/jme3test/awt/TestAwtPanels.java | 2 +- .../src/main/java/jme3test/awt/TestSafeCanvas.java | 2 +- .../main/java/jme3test/batching/TestBatchNode.java | 4 ++-- .../jme3test/batching/TestBatchNodeCluster.java | 2 +- .../java/jme3test/batching/TestBatchNodeTower.java | 2 +- .../main/java/jme3test/bullet/TestAttachDriver.java | 2 +- .../main/java/jme3test/bullet/TestBrickTower.java | 4 ++-- .../main/java/jme3test/bullet/TestBrickWall.java | 4 ++-- .../src/main/java/jme3test/bullet/TestCcd.java | 2 +- .../java/jme3test/bullet/TestCollisionGroups.java | 2 +- .../main/java/jme3test/bullet/TestGhostObject.java | 2 +- .../java/jme3test/bullet/TestRagdollCharacter.java | 2 +- .../main/java/jme3test/bullet/TestWalkingChar.java | 2 +- .../main/java/jme3test/collision/TestMousePick.java | 6 ++++-- .../java/jme3test/effect/TestSoftParticles.java | 4 ++-- .../src/main/java/jme3test/games/CubeField.java | 13 +++++++++---- .../main/java/jme3test/helloworld/HelloAssets.java | 2 +- .../main/java/jme3test/helloworld/HelloInput.java | 2 +- .../jme3test/light/TestDirectionalLightShadow.java | 3 ++- .../main/java/jme3test/light/TestPssmShadow.java | 3 ++- .../src/main/java/jme3test/light/TestShadow.java | 2 +- .../main/java/jme3test/light/TestShadowsPerf.java | 2 +- .../src/main/java/jme3test/light/TestSpotLight.java | 2 +- .../java/jme3test/light/TestSpotLightShadows.java | 2 +- .../java/jme3test/model/shape/TestBillboard.java | 3 ++- .../src/main/java/jme3test/model/shape/TestBox.java | 1 - .../main/java/jme3test/niftygui/TestNiftyGui.java | 2 +- .../java/jme3test/niftygui/TestNiftyToMesh.java | 2 +- .../src/main/java/jme3test/post/TestBloom.java | 3 ++- .../src/main/java/jme3test/post/TestCrossHatch.java | 3 ++- .../main/java/jme3test/post/TestPosterization.java | 3 ++- .../main/java/jme3test/post/TestRenderToMemory.java | 2 +- .../java/jme3test/post/TestRenderToTexture.java | 4 ++-- .../src/main/java/jme3test/water/TestPostWater.java | 2 +- 43 files changed, 68 insertions(+), 52 deletions(-) diff --git a/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java b/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java index bfc106b17..4ff0c5df7 100644 --- a/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java +++ b/jme3-android/src/main/java/jme3test/android/SimpleTexturedTest.java @@ -46,7 +46,7 @@ public class SimpleTexturedTest extends SimpleApplication { shapeSphere = new Sphere(16, 16, .5f); - shapeBox = new Box(Vector3f.ZERO, 0.3f, 0.3f, 0.3f); + shapeBox = new Box(0.3f, 0.3f, 0.3f); // ModelConverter.optimize(geom); diff --git a/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java b/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java index 9eef4b8d3..2a6325747 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java @@ -121,7 +121,8 @@ public class MotionPath implements Savable { Material m = assetManager.loadMaterial("Common/Materials/RedColor.j3m"); for (Iterator it = spline.getControlPoints().iterator(); it.hasNext();) { Vector3f cp = it.next(); - Geometry geo = new Geometry("box", new Box(cp, 0.3f, 0.3f, 0.3f)); + Geometry geo = new Geometry("box", new Box(0.3f, 0.3f, 0.3f)); + geo.setLocalTranslation(cp); geo.setMaterial(m); debugNode.attachChild(geo); diff --git a/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java b/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java index ffe65a888..baeb41a31 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java @@ -139,7 +139,8 @@ public class TestCameraMotionPath extends SimpleApplication { rootNode.attachChild(teapot); - Geometry soil = new Geometry("soil", new Box(new Vector3f(0, -1.0f, 0), 50, 1, 50)); + Geometry soil = new Geometry("soil", new Box(50, 1, 50)); + soil.setLocalTranslation(0, -1, 0); soil.setMaterial(matSoil); rootNode.attachChild(soil); DirectionalLight light = new DirectionalLight(); diff --git a/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java b/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java index f0200bc91..a066426e4 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java @@ -222,7 +222,8 @@ public class TestCinematic extends SimpleApplication { matSoil.setColor("Diffuse", ColorRGBA.Green); matSoil.setColor("Specular", ColorRGBA.Black); - Geometry soil = new Geometry("soil", new Box(new Vector3f(0, -6.0f, 0), 50, 1, 50)); + Geometry soil = new Geometry("soil", new Box(50, 1, 50)); + soil.setLocalTranslation(0, -6, 0); soil.setMaterial(matSoil); soil.setShadowMode(ShadowMode.Receive); rootNode.attachChild(soil); diff --git a/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java b/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java index 57584f7c5..51268b6bc 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java @@ -136,7 +136,8 @@ public class TestMotionPath extends SimpleApplication { rootNode.attachChild(teapot); - Geometry soil = new Geometry("soil", new Box(new Vector3f(0, -1.0f, 0), 50, 1, 50)); + Geometry soil = new Geometry("soil", new Box(50, 1, 50)); + soil.setLocalTranslation(0, -1, 0); soil.setMaterial(matSoil); rootNode.attachChild(soil); diff --git a/jme3-examples/src/main/java/jme3test/app/TestAppStateLifeCycle.java b/jme3-examples/src/main/java/jme3test/app/TestAppStateLifeCycle.java index f22424252..ebca77683 100644 --- a/jme3-examples/src/main/java/jme3test/app/TestAppStateLifeCycle.java +++ b/jme3-examples/src/main/java/jme3test/app/TestAppStateLifeCycle.java @@ -57,7 +57,7 @@ public class TestAppStateLifeCycle extends SimpleApplication { @Override public void simpleInitApp() { - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); diff --git a/jme3-examples/src/main/java/jme3test/app/TestBareBonesApp.java b/jme3-examples/src/main/java/jme3test/app/TestBareBonesApp.java index 5d3298279..491f4817b 100644 --- a/jme3-examples/src/main/java/jme3test/app/TestBareBonesApp.java +++ b/jme3-examples/src/main/java/jme3test/app/TestBareBonesApp.java @@ -56,7 +56,7 @@ public class TestBareBonesApp extends LegacyApplication { System.out.println("Initialize"); // create a box - boxGeom = new Geometry("Box", new Box(Vector3f.ZERO, 2, 2, 2)); + boxGeom = new Geometry("Box", new Box(2, 2, 2)); // load some default material boxGeom.setMaterial(assetManager.loadMaterial("Interface/Logo/Logo.j3m")); diff --git a/jme3-examples/src/main/java/jme3test/app/TestReleaseDirectMemory.java b/jme3-examples/src/main/java/jme3test/app/TestReleaseDirectMemory.java index 280212b71..28947c400 100644 --- a/jme3-examples/src/main/java/jme3test/app/TestReleaseDirectMemory.java +++ b/jme3-examples/src/main/java/jme3test/app/TestReleaseDirectMemory.java @@ -50,7 +50,7 @@ public class TestReleaseDirectMemory extends SimpleApplication { @Override public void simpleInitApp() { - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); diff --git a/jme3-examples/src/main/java/jme3test/audio/TestAmbient.java b/jme3-examples/src/main/java/jme3test/audio/TestAmbient.java index cf90cc96a..2703d53da 100644 --- a/jme3-examples/src/main/java/jme3test/audio/TestAmbient.java +++ b/jme3-examples/src/main/java/jme3test/audio/TestAmbient.java @@ -69,7 +69,7 @@ public class TestAmbient extends SimpleApplication { nature.play(); // just a blue box to mark the spot - Box box1 = new Box(Vector3f.ZERO, .5f, .5f, .5f); + Box box1 = new Box(.5f, .5f, .5f); Geometry player = new Geometry("Player", box1); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); diff --git a/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java b/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java index 0f47d0c26..5c00e5008 100644 --- a/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java +++ b/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java @@ -90,7 +90,7 @@ public class TestAwtPanels extends SimpleApplication { public void simpleInitApp() { flyCam.setDragToRotate(true); - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); diff --git a/jme3-examples/src/main/java/jme3test/awt/TestSafeCanvas.java b/jme3-examples/src/main/java/jme3test/awt/TestSafeCanvas.java index 88451f5d7..6264f8246 100644 --- a/jme3-examples/src/main/java/jme3test/awt/TestSafeCanvas.java +++ b/jme3-examples/src/main/java/jme3test/awt/TestSafeCanvas.java @@ -59,7 +59,7 @@ public class TestSafeCanvas extends SimpleApplication { public void simpleInitApp() { flyCam.setDragToRotate(true); - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); diff --git a/jme3-examples/src/main/java/jme3test/batching/TestBatchNode.java b/jme3-examples/src/main/java/jme3test/batching/TestBatchNode.java index af0292864..db7e7a85e 100644 --- a/jme3-examples/src/main/java/jme3test/batching/TestBatchNode.java +++ b/jme3-examples/src/main/java/jme3test/batching/TestBatchNode.java @@ -82,7 +82,7 @@ public class TestBatchNode extends SimpleApplication { * A cube with a color "bleeding" through transparent texture. Uses * Texture from jme3-test-data library! */ - Box boxshape4 = new Box(Vector3f.ZERO, 1f, 1f, 1f); + Box boxshape4 = new Box(1f, 1f, 1f); cube = new Geometry("cube1", boxshape4); Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m"); cube.setMaterial(mat); @@ -93,7 +93,7 @@ public class TestBatchNode extends SimpleApplication { * A cube with a color "bleeding" through transparent texture. Uses * Texture from jme3-test-data library! */ - Box box = new Box(Vector3f.ZERO, 1f, 1f, 1f); + Box box = new Box(1f, 1f, 1f); cube2 = new Geometry("cube2", box); cube2.setMaterial(mat); diff --git a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java index 4559acfdc..3d88fb408 100644 --- a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java +++ b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java @@ -166,7 +166,7 @@ public class TestBatchNodeCluster extends SimpleApplication { public void randomGenerator() { for (int i = startAt; i < maxCubes - 1; i++) { randomize(); - Geometry box = new Geometry("Box" + i, new Box(Vector3f.ZERO, 1, 1, 1)); + Geometry box = new Geometry("Box" + i, new Box(1, 1, 1)); box.setLocalTranslation(new Vector3f(xPosition.get(xPosition.size() - 1), yPosition.get(yPosition.size() - 1), zPosition.get(zPosition.size() - 1))); diff --git a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java index 0147c4435..a13dc6168 100644 --- a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java +++ b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java @@ -193,7 +193,7 @@ public class TestBatchNodeTower extends SimpleApplication { } public void initFloor() { - Box floorBox = new Box(Vector3f.ZERO, 10f, 0.1f, 5f); + Box floorBox = new Box(10f, 0.1f, 5f); floorBox.scaleTextureCoordinates(new Vector2f(3, 6)); Geometry floor = new Geometry("floor", floorBox); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java b/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java index 8f9447ea1..1de5b0118 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java @@ -112,7 +112,7 @@ public class TestAttachDriver extends SimpleApplication implements ActionListene tex.setMinFilter(Texture.MinFilter.Trilinear); mat.setTexture("ColorMap", tex); - Box floor = new Box(Vector3f.ZERO, 100, 1f, 100); + Box floor = new Box(100, 1f, 100); Geometry floorGeom = new Geometry("Floor", floor); floorGeom.setMaterial(mat); floorGeom.setLocalTranslation(new Vector3f(0f, -3, 0f)); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java b/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java index bcadf623d..7b0df933d 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java @@ -126,7 +126,7 @@ public class TestBrickTower extends SimpleApplication { bullet.setTextureMode(TextureMode.Projected); bulletCollisionShape = new SphereCollisionShape(0.4f); - brick = new Box(Vector3f.ZERO, brickWidth, brickHeight, brickDepth); + brick = new Box(brickWidth, brickHeight, brickDepth); brick.scaleTextureCoordinates(new Vector2f(1f, .5f)); //bulletAppState.getPhysicsSpace().enableDebug(assetManager); initMaterial(); @@ -204,7 +204,7 @@ public class TestBrickTower extends SimpleApplication { } public void initFloor() { - Box floorBox = new Box(Vector3f.ZERO, 10f, 0.1f, 5f); + Box floorBox = new Box(10f, 0.1f, 5f); floorBox.scaleTextureCoordinates(new Vector2f(3, 6)); Geometry floor = new Geometry("floor", floorBox); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java b/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java index b190e8c6c..0173f1a44 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java @@ -90,7 +90,7 @@ public class TestBrickWall extends SimpleApplication { bullet = new Sphere(32, 32, 0.4f, true, false); bullet.setTextureMode(TextureMode.Projected); bulletCollisionShape = new SphereCollisionShape(0.4f); - brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth); + brick = new Box(bLength, bHeight, bWidth); brick.scaleTextureCoordinates(new Vector2f(1f, .5f)); initMaterial(); @@ -151,7 +151,7 @@ public class TestBrickWall extends SimpleApplication { } public void initFloor() { - Box floorBox = new Box(Vector3f.ZERO, 10f, 0.1f, 5f); + Box floorBox = new Box(10f, 0.1f, 5f); floorBox.scaleTextureCoordinates(new Vector2f(3, 6)); Geometry floor = new Geometry("floor", floorBox); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java b/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java index cda07bc85..58cb77c65 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java @@ -98,7 +98,7 @@ public class TestCcd extends SimpleApplication implements ActionListener { Node node2 = new Node(); node2.setName("mesh"); node2.setLocalTranslation(new Vector3f(2.5f, 0, 0f)); - node2.addControl(new RigidBodyControl(new MeshCollisionShape(new Box(Vector3f.ZERO, 4, 4, 0.1f)), 0)); + node2.addControl(new RigidBodyControl(new MeshCollisionShape(new Box(4, 4, 0.1f)), 0)); rootNode.attachChild(node2); getPhysicsSpace().add(node2); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestCollisionGroups.java b/jme3-examples/src/main/java/jme3test/bullet/TestCollisionGroups.java index 410c125d2..516345d47 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestCollisionGroups.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestCollisionGroups.java @@ -85,7 +85,7 @@ public class TestCollisionGroups extends SimpleApplication { getPhysicsSpace().add(node2); // the floor, does not move (mass=0) - Node node3 = PhysicsTestHelper.createPhysicsTestNode(assetManager, new MeshCollisionShape(new Box(Vector3f.ZERO, 100f, 0.2f, 100f)), 0); + Node node3 = PhysicsTestHelper.createPhysicsTestNode(assetManager, new MeshCollisionShape(new Box(100f, 0.2f, 100f)), 0); node3.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f, -6, 0f)); rootNode.attachChild(node3); getPhysicsSpace().add(node3); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestGhostObject.java b/jme3-examples/src/main/java/jme3test/bullet/TestGhostObject.java index 74a7c1e1e..2ea1af0ab 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestGhostObject.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestGhostObject.java @@ -65,7 +65,7 @@ public class TestGhostObject extends SimpleApplication { bulletAppState.setDebugEnabled(true); // Mesh to be shared across several boxes. - Box boxGeom = new Box(Vector3f.ZERO, 1f, 1f, 1f); + Box boxGeom = new Box(1f, 1f, 1f); // CollisionShape to be shared across several boxes. CollisionShape shape = new BoxCollisionShape(new Vector3f(1, 1, 1)); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestRagdollCharacter.java b/jme3-examples/src/main/java/jme3test/bullet/TestRagdollCharacter.java index 9785ed250..5b9e948c8 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestRagdollCharacter.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestRagdollCharacter.java @@ -139,7 +139,7 @@ public class TestRagdollCharacter extends SimpleApplication implements AnimEvent } public void initWall(float bLength, float bWidth, float bHeight) { - Box brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth); + Box brick = new Box(bLength, bHeight, bWidth); brick.scaleTextureCoordinates(new Vector2f(1f, .5f)); Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg"); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java b/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java index a66a6ecc1..c7e937c0b 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java @@ -171,7 +171,7 @@ public class TestWalkingChar extends SimpleApplication implements ActionListener float zOff = -40; float startpt = bLength / 4 - xOff; float height = 6.1f; - brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth); + brick = new Box(bLength, bHeight, bWidth); brick.scaleTextureCoordinates(new Vector2f(1f, .5f)); for (int j = 0; j < 15; j++) { for (int i = 0; i < 4; i++) { diff --git a/jme3-examples/src/main/java/jme3test/collision/TestMousePick.java b/jme3-examples/src/main/java/jme3test/collision/TestMousePick.java index f86f956b6..9f58b7fd8 100644 --- a/jme3-examples/src/main/java/jme3test/collision/TestMousePick.java +++ b/jme3-examples/src/main/java/jme3test/collision/TestMousePick.java @@ -107,8 +107,9 @@ public class TestMousePick extends SimpleApplication { /** A cube object for target practice */ protected Geometry makeCube(String name, float x, float y, float z) { - Box box = new Box(new Vector3f(x, y, z), 1, 1, 1); + Box box = new Box(1, 1, 1); Geometry cube = new Geometry(name, box); + cube.setLocalTranslation(x, y, z); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat1.setColor("Color", ColorRGBA.randomColor()); cube.setMaterial(mat1); @@ -117,8 +118,9 @@ public class TestMousePick extends SimpleApplication { /** A floor to show that the "shot" can go through several objects. */ protected Geometry makeFloor() { - Box box = new Box(new Vector3f(0, -4, -5), 15, .2f, 15); + Box box = new Box(15, .2f, 15); Geometry floor = new Geometry("the Floor", box); + floor.setLocalTranslation(0, -4, -5); Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat1.setColor("Color", ColorRGBA.Gray); floor.setMaterial(mat1); diff --git a/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java b/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java index 3d8f96d65..71504e51a 100644 --- a/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java +++ b/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java @@ -76,7 +76,7 @@ public class TestSoftParticles extends SimpleApplication { // -------- floor - Box b = new Box(Vector3f.ZERO, 10, 0.1f, 10); + Box b = new Box(10, 0.1f, 10); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Gray); @@ -84,7 +84,7 @@ public class TestSoftParticles extends SimpleApplication { geom.setMaterial(mat); rootNode.attachChild(geom); - Box b2 = new Box(Vector3f.ZERO, 1, 1, 1); + Box b2 = new Box(1, 1, 1); Geometry geom2 = new Geometry("Box", b2); Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat2.setColor("Color", ColorRGBA.DarkGray); diff --git a/jme3-examples/src/main/java/jme3test/games/CubeField.java b/jme3-examples/src/main/java/jme3test/games/CubeField.java index fdad49de6..c166b5823 100644 --- a/jme3-examples/src/main/java/jme3test/games/CubeField.java +++ b/jme3-examples/src/main/java/jme3test/games/CubeField.java @@ -197,9 +197,9 @@ public class CubeField extends SimpleApplication implements AnalogListener { private Geometry createFirstCube() { Vector3f loc = player.getLocalTranslation(); loc.addLocal(4, 0, 0); - Box b = new Box(loc, 1, 1, 1); - + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); + geom.setLocalTranslation(loc); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Blue); geom.setMaterial(mat); @@ -216,10 +216,15 @@ public class CubeField extends SimpleApplication implements AnalogListener { playerMesh.setMaterial(playerMaterial); playerMesh.setName("player"); - Box floor = new Box(Vector3f.ZERO.add(playerMesh.getLocalTranslation().getX(), - playerMesh.getLocalTranslation().getY() - 1, 0), 100, 0, 100); + Box floor = new Box(100, 0, 100); + Geometry floorMesh = new Geometry("Box", floor); + Vector3f translation = Vector3f.ZERO.add(playerMesh.getLocalTranslation().getX(), + playerMesh.getLocalTranslation().getY() - 1, 0); + + floorMesh.setLocalTranslation(translation); + floorMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); floorMaterial.setColor("Color", ColorRGBA.LightGray); floorMesh.setMaterial(floorMaterial); diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloAssets.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloAssets.java index 9a3085016..4fb4738ac 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloAssets.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloAssets.java @@ -60,7 +60,7 @@ public class HelloAssets extends SimpleApplication { rootNode.attachChild(teapot); /** Create a wall (Box with material and texture from test-data) */ - Box box = new Box(Vector3f.ZERO, 2.5f,2.5f,1.0f); + Box box = new Box(2.5f, 2.5f, 1.0f); Spatial wall = new Geometry("Box", box ); Material mat_brick = new Material( assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat_brick.setTexture("ColorMap", assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg")); diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java index 4cf09fe6e..c01bfb31c 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java @@ -57,7 +57,7 @@ public class HelloInput extends SimpleApplication { @Override public void simpleInitApp() { - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); player = new Geometry("Player", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Blue); diff --git a/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java b/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java index 14f220374..7e5d30a6d 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java +++ b/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java @@ -127,9 +127,10 @@ public class TestDirectionalLightShadow extends SimpleApplication implements Act t.setLocalTranslation(FastMath.nextRandomFloat() * 200f, FastMath.nextRandomFloat() * 30f + 20, 30f * (i + 2f)); } - Box b = new Box(new Vector3f(0, 10, 550), 1000, 2, 1000); + Box b = new Box(1000, 2, 1000); b.scaleTextureCoordinates(new Vector2f(10, 10)); ground = new Geometry("soil", b); + ground.setLocalTranslation(0, 10, 550); matGroundU = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); matGroundU.setColor("Color", ColorRGBA.Green); diff --git a/jme3-examples/src/main/java/jme3test/light/TestPssmShadow.java b/jme3-examples/src/main/java/jme3test/light/TestPssmShadow.java index 55d5a3f87..9f851d39c 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestPssmShadow.java +++ b/jme3-examples/src/main/java/jme3test/light/TestPssmShadow.java @@ -113,9 +113,10 @@ public class TestPssmShadow extends SimpleApplication implements ActionListener t.setLocalTranslation(FastMath.nextRandomFloat() * 200f, FastMath.nextRandomFloat() * 30f + 20, 30f * (i + 2f)); } - Box b = new Box(new Vector3f(0, 10, 550), 1000, 2, 1000); + Box b = new Box(1000, 2, 1000); b.scaleTextureCoordinates(new Vector2f(10, 10)); ground = new Geometry("soil", b); + ground.setLocalTranslation(0, 10, 550); matGroundU = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); matGroundU.setColor("Color", ColorRGBA.Green); diff --git a/jme3-examples/src/main/java/jme3test/light/TestShadow.java b/jme3-examples/src/main/java/jme3test/light/TestShadow.java index db0c3768f..d3c7122fb 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestShadow.java +++ b/jme3-examples/src/main/java/jme3test/light/TestShadow.java @@ -76,7 +76,7 @@ public class TestShadow extends SimpleApplication { Material mat = assetManager.loadMaterial("Common/Materials/WhiteColor.j3m"); rootNode.setShadowMode(ShadowMode.Off); - Box floor = new Box(Vector3f.ZERO, 3, 0.1f, 3); + Box floor = new Box(3, 0.1f, 3); Geometry floorGeom = new Geometry("Floor", floor); floorGeom.setMaterial(mat); floorGeom.setLocalTranslation(0,-0.2f,0); diff --git a/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java b/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java index e9ca341b8..f267b1d41 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java +++ b/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java @@ -83,7 +83,7 @@ public class TestShadowsPerf extends SimpleApplication { mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m"); - Box b = new Box(Vector3f.ZERO, 800, 1, 700); + Box b = new Box(800, 1, 700); b.scaleTextureCoordinates(new Vector2f(50, 50)); Geometry ground = new Geometry("ground", b); ground.setMaterial(mat); diff --git a/jme3-examples/src/main/java/jme3test/light/TestSpotLight.java b/jme3-examples/src/main/java/jme3test/light/TestSpotLight.java index 7a6f35c37..0cd4512cd 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestSpotLight.java +++ b/jme3-examples/src/main/java/jme3test/light/TestSpotLight.java @@ -100,7 +100,7 @@ public class TestSpotLight extends SimpleApplication { // mat.setBoolean("VertexLighting", true); - Box floor = new Box(Vector3f.ZERO, 50, 1f, 50); + Box floor = new Box(50, 1f, 50); TangentBinormalGenerator.generate(floor); floor.scaleTextureCoordinates(new Vector2f(5, 5)); Geometry floorGeom = new Geometry("Floor", floor); diff --git a/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java b/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java index 8df514fd3..52a5dc8c5 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java +++ b/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java @@ -148,7 +148,7 @@ public class TestSpotLightShadows extends SimpleApplication { // mat.setBoolean("VertexLighting", true); - Box floor = new Box(Vector3f.ZERO, 50, 1f, 50); + Box floor = new Box(50, 1f, 50); TangentBinormalGenerator.generate(floor); floor.scaleTextureCoordinates(new Vector2f(5, 5)); Geometry floorGeom = new Geometry("Floor", floor); diff --git a/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java b/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java index ba7acb1f7..8fa8a66f1 100644 --- a/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java +++ b/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java @@ -64,8 +64,9 @@ public class TestBillboard extends SimpleApplication { g3.setMaterial(mat2); g3.setLocalTranslation(.5f, .5f, .01f); - Box b = new Box(new Vector3f(0, 0, 3), .25f, .5f, .25f); + Box b = new Box(.25f, .5f, .25f); Geometry g2 = new Geometry("Box", b); + g2.setLocalTranslation(0, 0, 3); g2.setMaterial(mat); Node bb = new Node("billboard"); diff --git a/jme3-examples/src/main/java/jme3test/model/shape/TestBox.java b/jme3-examples/src/main/java/jme3test/model/shape/TestBox.java index 19d26b5ac..0e5e86aef 100644 --- a/jme3-examples/src/main/java/jme3test/model/shape/TestBox.java +++ b/jme3-examples/src/main/java/jme3test/model/shape/TestBox.java @@ -34,7 +34,6 @@ package jme3test.model.shape; import com.jme3.app.SimpleApplication; import com.jme3.material.Material; -import com.jme3.math.Vector3f; import com.jme3.scene.Geometry; import com.jme3.scene.shape.Box; diff --git a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyGui.java b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyGui.java index fe9171c92..3d2e67b5f 100644 --- a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyGui.java +++ b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyGui.java @@ -54,7 +54,7 @@ public class TestNiftyGui extends SimpleApplication implements ScreenController @Override public void simpleInitApp() { - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); diff --git a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java index ef82f263d..ce3832c73 100644 --- a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java +++ b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java @@ -79,7 +79,7 @@ public class TestNiftyToMesh extends SimpleApplication{ niftyView.setClearFlags(true, true, true); niftyView.setOutputFrameBuffer(fb); - Box b = new Box(Vector3f.ZERO, 1, 1, 1); + Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", tex); diff --git a/jme3-examples/src/main/java/jme3test/post/TestBloom.java b/jme3-examples/src/main/java/jme3test/post/TestBloom.java index b73d234d7..1a394bf36 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestBloom.java +++ b/jme3-examples/src/main/java/jme3test/post/TestBloom.java @@ -102,7 +102,8 @@ public class TestBloom extends SimpleApplication { - Geometry soil=new Geometry("soil", new Box(new Vector3f(0, -13, 550), 800, 10, 700)); + Geometry soil = new Geometry("soil", new Box(800, 10, 700)); + soil.setLocalTranslation(0, -13, 550); soil.setMaterial(matSoil); soil.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(soil); diff --git a/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java b/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java index 2164ec229..ff3ef081c 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java +++ b/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java @@ -102,7 +102,8 @@ public class TestCrossHatch extends SimpleApplication { - Geometry soil=new Geometry("soil", new Box(new Vector3f(0, -13, 550), 800, 10, 700)); + Geometry soil = new Geometry("soil", new Box(800, 10, 700)); + soil.setLocalTranslation(0, -13, 550); soil.setMaterial(matSoil); soil.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(soil); diff --git a/jme3-examples/src/main/java/jme3test/post/TestPosterization.java b/jme3-examples/src/main/java/jme3test/post/TestPosterization.java index 4200ad463..ff8cf7ee8 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestPosterization.java +++ b/jme3-examples/src/main/java/jme3test/post/TestPosterization.java @@ -102,7 +102,8 @@ public class TestPosterization extends SimpleApplication { - Geometry soil=new Geometry("soil", new Box(new Vector3f(0, -13, 550), 800, 10, 700)); + Geometry soil = new Geometry("soil", new Box(800, 10, 700)); + soil.setLocalTranslation(0, -13, 550); soil.setMaterial(matSoil); soil.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(soil); diff --git a/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java b/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java index 5ea1336cd..17b22d167 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java +++ b/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java @@ -202,7 +202,7 @@ public class TestRenderToMemory extends SimpleApplication implements SceneProces offView.setOutputFrameBuffer(offBuffer); // setup framebuffer's scene - Box boxMesh = new Box(Vector3f.ZERO, 1,1,1); + Box boxMesh = new Box(1, 1, 1); Material material = assetManager.loadMaterial("Interface/Logo/Logo.j3m"); offBox = new Geometry("box", boxMesh); offBox.setMaterial(material); diff --git a/jme3-examples/src/main/java/jme3test/post/TestRenderToTexture.java b/jme3-examples/src/main/java/jme3test/post/TestRenderToTexture.java index ba872831a..037c959d3 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestRenderToTexture.java +++ b/jme3-examples/src/main/java/jme3test/post/TestRenderToTexture.java @@ -93,7 +93,7 @@ public class TestRenderToTexture extends SimpleApplication implements ActionList offView.setOutputFrameBuffer(offBuffer); // setup framebuffer's scene - Box boxMesh = new Box(Vector3f.ZERO, 1,1,1); + Box boxMesh = new Box(1, 1, 1); Material material = assetManager.loadMaterial("Interface/Logo/Logo.j3m"); offBox = new Geometry("box", boxMesh); offBox.setMaterial(material); @@ -110,7 +110,7 @@ public class TestRenderToTexture extends SimpleApplication implements ActionList cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y); //setup main scene - Geometry quad = new Geometry("box", new Box(Vector3f.ZERO, 1,1,1)); + Geometry quad = new Geometry("box", new Box(1, 1, 1)); Texture offTex = setupOffscreenView(); diff --git a/jme3-examples/src/main/java/jme3test/water/TestPostWater.java b/jme3-examples/src/main/java/jme3test/water/TestPostWater.java index a03aeb393..a4d557f78 100644 --- a/jme3-examples/src/main/java/jme3test/water/TestPostWater.java +++ b/jme3-examples/src/main/java/jme3test/water/TestPostWater.java @@ -194,7 +194,7 @@ public class TestPostWater extends SimpleApplication { private void createBox() { //creating a transluscent box - box = new Geometry("box", new Box(new Vector3f(0, 0, 0), 50, 50, 50)); + box = new Geometry("box", new Box(50, 50, 50)); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", new ColorRGBA(1.0f, 0, 0, 0.3f)); mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);