test: don't use deprecated box constructor
This commit is contained in:
parent
f4e948d7bd
commit
112a77fd5d
@ -46,7 +46,7 @@ public class SimpleTexturedTest extends SimpleApplication {
|
|||||||
|
|
||||||
|
|
||||||
shapeSphere = new Sphere(16, 16, .5f);
|
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);
|
// ModelConverter.optimize(geom);
|
||||||
|
@ -121,7 +121,8 @@ public class MotionPath implements Savable {
|
|||||||
Material m = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
|
Material m = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
|
||||||
for (Iterator<Vector3f> it = spline.getControlPoints().iterator(); it.hasNext();) {
|
for (Iterator<Vector3f> it = spline.getControlPoints().iterator(); it.hasNext();) {
|
||||||
Vector3f cp = it.next();
|
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);
|
geo.setMaterial(m);
|
||||||
debugNode.attachChild(geo);
|
debugNode.attachChild(geo);
|
||||||
|
|
||||||
|
@ -139,7 +139,8 @@ public class TestCameraMotionPath extends SimpleApplication {
|
|||||||
|
|
||||||
|
|
||||||
rootNode.attachChild(teapot);
|
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);
|
soil.setMaterial(matSoil);
|
||||||
rootNode.attachChild(soil);
|
rootNode.attachChild(soil);
|
||||||
DirectionalLight light = new DirectionalLight();
|
DirectionalLight light = new DirectionalLight();
|
||||||
|
@ -222,7 +222,8 @@ public class TestCinematic extends SimpleApplication {
|
|||||||
matSoil.setColor("Diffuse", ColorRGBA.Green);
|
matSoil.setColor("Diffuse", ColorRGBA.Green);
|
||||||
matSoil.setColor("Specular", ColorRGBA.Black);
|
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.setMaterial(matSoil);
|
||||||
soil.setShadowMode(ShadowMode.Receive);
|
soil.setShadowMode(ShadowMode.Receive);
|
||||||
rootNode.attachChild(soil);
|
rootNode.attachChild(soil);
|
||||||
|
@ -136,7 +136,8 @@ public class TestMotionPath extends SimpleApplication {
|
|||||||
|
|
||||||
|
|
||||||
rootNode.attachChild(teapot);
|
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);
|
soil.setMaterial(matSoil);
|
||||||
|
|
||||||
rootNode.attachChild(soil);
|
rootNode.attachChild(soil);
|
||||||
|
@ -57,7 +57,7 @@ public class TestAppStateLifeCycle extends SimpleApplication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
||||||
|
@ -56,7 +56,7 @@ public class TestBareBonesApp extends LegacyApplication {
|
|||||||
System.out.println("Initialize");
|
System.out.println("Initialize");
|
||||||
|
|
||||||
// create a box
|
// 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
|
// load some default material
|
||||||
boxGeom.setMaterial(assetManager.loadMaterial("Interface/Logo/Logo.j3m"));
|
boxGeom.setMaterial(assetManager.loadMaterial("Interface/Logo/Logo.j3m"));
|
||||||
|
@ -50,7 +50,7 @@ public class TestReleaseDirectMemory extends SimpleApplication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
||||||
|
@ -69,7 +69,7 @@ public class TestAmbient extends SimpleApplication {
|
|||||||
nature.play();
|
nature.play();
|
||||||
|
|
||||||
// just a blue box to mark the spot
|
// 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);
|
Geometry player = new Geometry("Player", box1);
|
||||||
Material mat1 = new Material(assetManager,
|
Material mat1 = new Material(assetManager,
|
||||||
"Common/MatDefs/Misc/Unshaded.j3md");
|
"Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
|
@ -90,7 +90,7 @@ public class TestAwtPanels extends SimpleApplication {
|
|||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
flyCam.setDragToRotate(true);
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
||||||
|
@ -59,7 +59,7 @@ public class TestSafeCanvas extends SimpleApplication {
|
|||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
flyCam.setDragToRotate(true);
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
||||||
|
@ -82,7 +82,7 @@ public class TestBatchNode extends SimpleApplication {
|
|||||||
* A cube with a color "bleeding" through transparent texture. Uses
|
* A cube with a color "bleeding" through transparent texture. Uses
|
||||||
* Texture from jme3-test-data library!
|
* 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);
|
cube = new Geometry("cube1", boxshape4);
|
||||||
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
|
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
|
||||||
cube.setMaterial(mat);
|
cube.setMaterial(mat);
|
||||||
@ -93,7 +93,7 @@ public class TestBatchNode extends SimpleApplication {
|
|||||||
* A cube with a color "bleeding" through transparent texture. Uses
|
* A cube with a color "bleeding" through transparent texture. Uses
|
||||||
* Texture from jme3-test-data library!
|
* 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 = new Geometry("cube2", box);
|
||||||
cube2.setMaterial(mat);
|
cube2.setMaterial(mat);
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ public class TestBatchNodeCluster extends SimpleApplication {
|
|||||||
public void randomGenerator() {
|
public void randomGenerator() {
|
||||||
for (int i = startAt; i < maxCubes - 1; i++) {
|
for (int i = startAt; i < maxCubes - 1; i++) {
|
||||||
randomize();
|
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),
|
box.setLocalTranslation(new Vector3f(xPosition.get(xPosition.size() - 1),
|
||||||
yPosition.get(yPosition.size() - 1),
|
yPosition.get(yPosition.size() - 1),
|
||||||
zPosition.get(zPosition.size() - 1)));
|
zPosition.get(zPosition.size() - 1)));
|
||||||
|
@ -193,7 +193,7 @@ public class TestBatchNodeTower extends SimpleApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initFloor() {
|
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));
|
floorBox.scaleTextureCoordinates(new Vector2f(3, 6));
|
||||||
|
|
||||||
Geometry floor = new Geometry("floor", floorBox);
|
Geometry floor = new Geometry("floor", floorBox);
|
||||||
|
@ -112,7 +112,7 @@ public class TestAttachDriver extends SimpleApplication implements ActionListene
|
|||||||
tex.setMinFilter(Texture.MinFilter.Trilinear);
|
tex.setMinFilter(Texture.MinFilter.Trilinear);
|
||||||
mat.setTexture("ColorMap", tex);
|
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);
|
Geometry floorGeom = new Geometry("Floor", floor);
|
||||||
floorGeom.setMaterial(mat);
|
floorGeom.setMaterial(mat);
|
||||||
floorGeom.setLocalTranslation(new Vector3f(0f, -3, 0f));
|
floorGeom.setLocalTranslation(new Vector3f(0f, -3, 0f));
|
||||||
|
@ -126,7 +126,7 @@ public class TestBrickTower extends SimpleApplication {
|
|||||||
bullet.setTextureMode(TextureMode.Projected);
|
bullet.setTextureMode(TextureMode.Projected);
|
||||||
bulletCollisionShape = new SphereCollisionShape(0.4f);
|
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));
|
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
|
||||||
//bulletAppState.getPhysicsSpace().enableDebug(assetManager);
|
//bulletAppState.getPhysicsSpace().enableDebug(assetManager);
|
||||||
initMaterial();
|
initMaterial();
|
||||||
@ -204,7 +204,7 @@ public class TestBrickTower extends SimpleApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initFloor() {
|
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));
|
floorBox.scaleTextureCoordinates(new Vector2f(3, 6));
|
||||||
|
|
||||||
Geometry floor = new Geometry("floor", floorBox);
|
Geometry floor = new Geometry("floor", floorBox);
|
||||||
|
@ -90,7 +90,7 @@ public class TestBrickWall extends SimpleApplication {
|
|||||||
bullet = new Sphere(32, 32, 0.4f, true, false);
|
bullet = new Sphere(32, 32, 0.4f, true, false);
|
||||||
bullet.setTextureMode(TextureMode.Projected);
|
bullet.setTextureMode(TextureMode.Projected);
|
||||||
bulletCollisionShape = new SphereCollisionShape(0.4f);
|
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));
|
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
|
||||||
|
|
||||||
initMaterial();
|
initMaterial();
|
||||||
@ -151,7 +151,7 @@ public class TestBrickWall extends SimpleApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initFloor() {
|
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));
|
floorBox.scaleTextureCoordinates(new Vector2f(3, 6));
|
||||||
|
|
||||||
Geometry floor = new Geometry("floor", floorBox);
|
Geometry floor = new Geometry("floor", floorBox);
|
||||||
|
@ -98,7 +98,7 @@ public class TestCcd extends SimpleApplication implements ActionListener {
|
|||||||
Node node2 = new Node();
|
Node node2 = new Node();
|
||||||
node2.setName("mesh");
|
node2.setName("mesh");
|
||||||
node2.setLocalTranslation(new Vector3f(2.5f, 0, 0f));
|
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);
|
rootNode.attachChild(node2);
|
||||||
getPhysicsSpace().add(node2);
|
getPhysicsSpace().add(node2);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public class TestCollisionGroups extends SimpleApplication {
|
|||||||
getPhysicsSpace().add(node2);
|
getPhysicsSpace().add(node2);
|
||||||
|
|
||||||
// the floor, does not move (mass=0)
|
// 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));
|
node3.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f, -6, 0f));
|
||||||
rootNode.attachChild(node3);
|
rootNode.attachChild(node3);
|
||||||
getPhysicsSpace().add(node3);
|
getPhysicsSpace().add(node3);
|
||||||
|
@ -65,7 +65,7 @@ public class TestGhostObject extends SimpleApplication {
|
|||||||
bulletAppState.setDebugEnabled(true);
|
bulletAppState.setDebugEnabled(true);
|
||||||
|
|
||||||
// Mesh to be shared across several boxes.
|
// 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 to be shared across several boxes.
|
||||||
CollisionShape shape = new BoxCollisionShape(new Vector3f(1, 1, 1));
|
CollisionShape shape = new BoxCollisionShape(new Vector3f(1, 1, 1));
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public class TestRagdollCharacter extends SimpleApplication implements AnimEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initWall(float bLength, float bWidth, float bHeight) {
|
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));
|
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
|
||||||
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
|
TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
|
||||||
|
@ -171,7 +171,7 @@ public class TestWalkingChar extends SimpleApplication implements ActionListener
|
|||||||
float zOff = -40;
|
float zOff = -40;
|
||||||
float startpt = bLength / 4 - xOff;
|
float startpt = bLength / 4 - xOff;
|
||||||
float height = 6.1f;
|
float height = 6.1f;
|
||||||
brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth);
|
brick = new Box(bLength, bHeight, bWidth);
|
||||||
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
|
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
|
||||||
for (int j = 0; j < 15; j++) {
|
for (int j = 0; j < 15; j++) {
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
@ -107,8 +107,9 @@ public class TestMousePick extends SimpleApplication {
|
|||||||
|
|
||||||
/** A cube object for target practice */
|
/** A cube object for target practice */
|
||||||
protected Geometry makeCube(String name, float x, float y, float z) {
|
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);
|
Geometry cube = new Geometry(name, box);
|
||||||
|
cube.setLocalTranslation(x, y, z);
|
||||||
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat1.setColor("Color", ColorRGBA.randomColor());
|
mat1.setColor("Color", ColorRGBA.randomColor());
|
||||||
cube.setMaterial(mat1);
|
cube.setMaterial(mat1);
|
||||||
@ -117,8 +118,9 @@ public class TestMousePick extends SimpleApplication {
|
|||||||
|
|
||||||
/** A floor to show that the "shot" can go through several objects. */
|
/** A floor to show that the "shot" can go through several objects. */
|
||||||
protected Geometry makeFloor() {
|
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);
|
Geometry floor = new Geometry("the Floor", box);
|
||||||
|
floor.setLocalTranslation(0, -4, -5);
|
||||||
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat1.setColor("Color", ColorRGBA.Gray);
|
mat1.setColor("Color", ColorRGBA.Gray);
|
||||||
floor.setMaterial(mat1);
|
floor.setMaterial(mat1);
|
||||||
|
@ -76,7 +76,7 @@ public class TestSoftParticles extends SimpleApplication {
|
|||||||
|
|
||||||
|
|
||||||
// -------- floor
|
// -------- 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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setColor("Color", ColorRGBA.Gray);
|
mat.setColor("Color", ColorRGBA.Gray);
|
||||||
@ -84,7 +84,7 @@ public class TestSoftParticles extends SimpleApplication {
|
|||||||
geom.setMaterial(mat);
|
geom.setMaterial(mat);
|
||||||
rootNode.attachChild(geom);
|
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);
|
Geometry geom2 = new Geometry("Box", b2);
|
||||||
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat2.setColor("Color", ColorRGBA.DarkGray);
|
mat2.setColor("Color", ColorRGBA.DarkGray);
|
||||||
|
@ -197,9 +197,9 @@ public class CubeField extends SimpleApplication implements AnalogListener {
|
|||||||
private Geometry createFirstCube() {
|
private Geometry createFirstCube() {
|
||||||
Vector3f loc = player.getLocalTranslation();
|
Vector3f loc = player.getLocalTranslation();
|
||||||
loc.addLocal(4, 0, 0);
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
|
geom.setLocalTranslation(loc);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setColor("Color", ColorRGBA.Blue);
|
mat.setColor("Color", ColorRGBA.Blue);
|
||||||
geom.setMaterial(mat);
|
geom.setMaterial(mat);
|
||||||
@ -216,10 +216,15 @@ public class CubeField extends SimpleApplication implements AnalogListener {
|
|||||||
playerMesh.setMaterial(playerMaterial);
|
playerMesh.setMaterial(playerMaterial);
|
||||||
playerMesh.setName("player");
|
playerMesh.setName("player");
|
||||||
|
|
||||||
Box floor = new Box(Vector3f.ZERO.add(playerMesh.getLocalTranslation().getX(),
|
Box floor = new Box(100, 0, 100);
|
||||||
playerMesh.getLocalTranslation().getY() - 1, 0), 100, 0, 100);
|
|
||||||
Geometry floorMesh = new Geometry("Box", floor);
|
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 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
floorMaterial.setColor("Color", ColorRGBA.LightGray);
|
floorMaterial.setColor("Color", ColorRGBA.LightGray);
|
||||||
floorMesh.setMaterial(floorMaterial);
|
floorMesh.setMaterial(floorMaterial);
|
||||||
|
@ -60,7 +60,7 @@ public class HelloAssets extends SimpleApplication {
|
|||||||
rootNode.attachChild(teapot);
|
rootNode.attachChild(teapot);
|
||||||
|
|
||||||
/** Create a wall (Box with material and texture from test-data) */
|
/** 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 );
|
Spatial wall = new Geometry("Box", box );
|
||||||
Material mat_brick = new Material( assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat_brick = new Material( assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat_brick.setTexture("ColorMap", assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg"));
|
mat_brick.setTexture("ColorMap", assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg"));
|
||||||
|
@ -57,7 +57,7 @@ public class HelloInput extends SimpleApplication {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
Box b = new Box(Vector3f.ZERO, 1, 1, 1);
|
Box b = new Box(1, 1, 1);
|
||||||
player = new Geometry("Player", b);
|
player = new Geometry("Player", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setColor("Color", ColorRGBA.Blue);
|
mat.setColor("Color", ColorRGBA.Blue);
|
||||||
|
@ -127,9 +127,10 @@ public class TestDirectionalLightShadow extends SimpleApplication implements Act
|
|||||||
t.setLocalTranslation(FastMath.nextRandomFloat() * 200f, FastMath.nextRandomFloat() * 30f + 20, 30f * (i + 2f));
|
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));
|
b.scaleTextureCoordinates(new Vector2f(10, 10));
|
||||||
ground = new Geometry("soil", b);
|
ground = new Geometry("soil", b);
|
||||||
|
ground.setLocalTranslation(0, 10, 550);
|
||||||
matGroundU = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
matGroundU = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
matGroundU.setColor("Color", ColorRGBA.Green);
|
matGroundU.setColor("Color", ColorRGBA.Green);
|
||||||
|
|
||||||
|
@ -113,9 +113,10 @@ public class TestPssmShadow extends SimpleApplication implements ActionListener
|
|||||||
t.setLocalTranslation(FastMath.nextRandomFloat() * 200f, FastMath.nextRandomFloat() * 30f + 20, 30f * (i + 2f));
|
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));
|
b.scaleTextureCoordinates(new Vector2f(10, 10));
|
||||||
ground = new Geometry("soil", b);
|
ground = new Geometry("soil", b);
|
||||||
|
ground.setLocalTranslation(0, 10, 550);
|
||||||
matGroundU = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
matGroundU = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
matGroundU.setColor("Color", ColorRGBA.Green);
|
matGroundU.setColor("Color", ColorRGBA.Green);
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class TestShadow extends SimpleApplication {
|
|||||||
|
|
||||||
Material mat = assetManager.loadMaterial("Common/Materials/WhiteColor.j3m");
|
Material mat = assetManager.loadMaterial("Common/Materials/WhiteColor.j3m");
|
||||||
rootNode.setShadowMode(ShadowMode.Off);
|
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);
|
Geometry floorGeom = new Geometry("Floor", floor);
|
||||||
floorGeom.setMaterial(mat);
|
floorGeom.setMaterial(mat);
|
||||||
floorGeom.setLocalTranslation(0,-0.2f,0);
|
floorGeom.setLocalTranslation(0,-0.2f,0);
|
||||||
|
@ -83,7 +83,7 @@ public class TestShadowsPerf extends SimpleApplication {
|
|||||||
|
|
||||||
mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
|
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));
|
b.scaleTextureCoordinates(new Vector2f(50, 50));
|
||||||
Geometry ground = new Geometry("ground", b);
|
Geometry ground = new Geometry("ground", b);
|
||||||
ground.setMaterial(mat);
|
ground.setMaterial(mat);
|
||||||
|
@ -100,7 +100,7 @@ public class TestSpotLight extends SimpleApplication {
|
|||||||
// mat.setBoolean("VertexLighting", true);
|
// mat.setBoolean("VertexLighting", true);
|
||||||
|
|
||||||
|
|
||||||
Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
|
Box floor = new Box(50, 1f, 50);
|
||||||
TangentBinormalGenerator.generate(floor);
|
TangentBinormalGenerator.generate(floor);
|
||||||
floor.scaleTextureCoordinates(new Vector2f(5, 5));
|
floor.scaleTextureCoordinates(new Vector2f(5, 5));
|
||||||
Geometry floorGeom = new Geometry("Floor", floor);
|
Geometry floorGeom = new Geometry("Floor", floor);
|
||||||
|
@ -148,7 +148,7 @@ public class TestSpotLightShadows extends SimpleApplication {
|
|||||||
// mat.setBoolean("VertexLighting", true);
|
// mat.setBoolean("VertexLighting", true);
|
||||||
|
|
||||||
|
|
||||||
Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
|
Box floor = new Box(50, 1f, 50);
|
||||||
TangentBinormalGenerator.generate(floor);
|
TangentBinormalGenerator.generate(floor);
|
||||||
floor.scaleTextureCoordinates(new Vector2f(5, 5));
|
floor.scaleTextureCoordinates(new Vector2f(5, 5));
|
||||||
Geometry floorGeom = new Geometry("Floor", floor);
|
Geometry floorGeom = new Geometry("Floor", floor);
|
||||||
|
@ -64,8 +64,9 @@ public class TestBillboard extends SimpleApplication {
|
|||||||
g3.setMaterial(mat2);
|
g3.setMaterial(mat2);
|
||||||
g3.setLocalTranslation(.5f, .5f, .01f);
|
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);
|
Geometry g2 = new Geometry("Box", b);
|
||||||
|
g2.setLocalTranslation(0, 0, 3);
|
||||||
g2.setMaterial(mat);
|
g2.setMaterial(mat);
|
||||||
|
|
||||||
Node bb = new Node("billboard");
|
Node bb = new Node("billboard");
|
||||||
|
@ -34,7 +34,6 @@ package jme3test.model.shape;
|
|||||||
|
|
||||||
import com.jme3.app.SimpleApplication;
|
import com.jme3.app.SimpleApplication;
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
import com.jme3.math.Vector3f;
|
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.scene.shape.Box;
|
import com.jme3.scene.shape.Box;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class TestNiftyGui extends SimpleApplication implements ScreenController
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
|
||||||
|
@ -79,7 +79,7 @@ public class TestNiftyToMesh extends SimpleApplication{
|
|||||||
niftyView.setClearFlags(true, true, true);
|
niftyView.setClearFlags(true, true, true);
|
||||||
niftyView.setOutputFrameBuffer(fb);
|
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);
|
Geometry geom = new Geometry("Box", b);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setTexture("ColorMap", tex);
|
mat.setTexture("ColorMap", tex);
|
||||||
|
@ -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.setMaterial(matSoil);
|
||||||
soil.setShadowMode(ShadowMode.CastAndReceive);
|
soil.setShadowMode(ShadowMode.CastAndReceive);
|
||||||
rootNode.attachChild(soil);
|
rootNode.attachChild(soil);
|
||||||
|
@ -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.setMaterial(matSoil);
|
||||||
soil.setShadowMode(ShadowMode.CastAndReceive);
|
soil.setShadowMode(ShadowMode.CastAndReceive);
|
||||||
rootNode.attachChild(soil);
|
rootNode.attachChild(soil);
|
||||||
|
@ -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.setMaterial(matSoil);
|
||||||
soil.setShadowMode(ShadowMode.CastAndReceive);
|
soil.setShadowMode(ShadowMode.CastAndReceive);
|
||||||
rootNode.attachChild(soil);
|
rootNode.attachChild(soil);
|
||||||
|
@ -202,7 +202,7 @@ public class TestRenderToMemory extends SimpleApplication implements SceneProces
|
|||||||
offView.setOutputFrameBuffer(offBuffer);
|
offView.setOutputFrameBuffer(offBuffer);
|
||||||
|
|
||||||
// setup framebuffer's scene
|
// 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");
|
Material material = assetManager.loadMaterial("Interface/Logo/Logo.j3m");
|
||||||
offBox = new Geometry("box", boxMesh);
|
offBox = new Geometry("box", boxMesh);
|
||||||
offBox.setMaterial(material);
|
offBox.setMaterial(material);
|
||||||
|
@ -93,7 +93,7 @@ public class TestRenderToTexture extends SimpleApplication implements ActionList
|
|||||||
offView.setOutputFrameBuffer(offBuffer);
|
offView.setOutputFrameBuffer(offBuffer);
|
||||||
|
|
||||||
// setup framebuffer's scene
|
// 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");
|
Material material = assetManager.loadMaterial("Interface/Logo/Logo.j3m");
|
||||||
offBox = new Geometry("box", boxMesh);
|
offBox = new Geometry("box", boxMesh);
|
||||||
offBox.setMaterial(material);
|
offBox.setMaterial(material);
|
||||||
@ -110,7 +110,7 @@ public class TestRenderToTexture extends SimpleApplication implements ActionList
|
|||||||
cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
|
cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
|
||||||
|
|
||||||
//setup main scene
|
//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();
|
Texture offTex = setupOffscreenView();
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ public class TestPostWater extends SimpleApplication {
|
|||||||
|
|
||||||
private void createBox() {
|
private void createBox() {
|
||||||
//creating a transluscent box
|
//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");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
mat.setColor("Color", new ColorRGBA(1.0f, 0, 0, 0.3f));
|
mat.setColor("Color", new ColorRGBA(1.0f, 0, 0, 0.3f));
|
||||||
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user