updated method name
This commit is contained in:
parent
68cdc81597
commit
949761f064
3 changed files with 4 additions and 9 deletions
|
|
@ -34,10 +34,6 @@ public class CookeryClient extends SimpleApplication {
|
||||||
// Setup Terrain
|
// Setup Terrain
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|
||||||
//Geometry terrain = new Geometry("Terrain", new TerrainMesh(1, 1, Block.BLOCK_SIZE, Block.BLOCK_SIZE));
|
|
||||||
//terrain.setMaterial(MaterialUtil.createMaterial(assetManager, ColorRGBA.Green));
|
|
||||||
//rootNode.attachChild();
|
|
||||||
|
|
||||||
BlockGenerator blockGenerator = new GrassLandBlockGenerator();
|
BlockGenerator blockGenerator = new GrassLandBlockGenerator();
|
||||||
World world = new World(blockGenerator);
|
World world = new World(blockGenerator);
|
||||||
|
|
||||||
|
|
@ -45,7 +41,7 @@ public class CookeryClient extends SimpleApplication {
|
||||||
new BlockHeightMap(world),
|
new BlockHeightMap(world),
|
||||||
MaterialUtil.createMaterial(assetManager, ColorRGBA.Green));
|
MaterialUtil.createMaterial(assetManager, ColorRGBA.Green));
|
||||||
|
|
||||||
rootNode.attachChild(terrain.getNode());
|
rootNode.attachChild(terrain.getGfxNode());
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// Setup Player
|
// Setup Player
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class TerrainManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Node getNode() {
|
public Node getGfxNode() {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package se.cookery.gfx.terrain;
|
||||||
|
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Node;
|
import com.jme3.scene.Node;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
@ -22,7 +21,7 @@ class TerrainManagerTest {
|
||||||
@Test
|
@Test
|
||||||
void initialization() {
|
void initialization() {
|
||||||
TerrainManager manager = new TerrainManager(1, 1, new TerrainHeightMapImpl(), null);
|
TerrainManager manager = new TerrainManager(1, 1, new TerrainHeightMapImpl(), null);
|
||||||
Node node = manager.getNode();
|
Node node = manager.getGfxNode();
|
||||||
|
|
||||||
assertEquals(TerrainManager.BUFFER_SIZE*TerrainManager.BUFFER_SIZE, node.getChildren().size());
|
assertEquals(TerrainManager.BUFFER_SIZE*TerrainManager.BUFFER_SIZE, node.getChildren().size());
|
||||||
|
|
||||||
|
|
@ -36,7 +35,7 @@ class TerrainManagerTest {
|
||||||
@Test
|
@Test
|
||||||
void setTerrainCenter() {
|
void setTerrainCenter() {
|
||||||
TerrainManager manager = new TerrainManager(1, 1, new TerrainHeightMapImpl(), null);
|
TerrainManager manager = new TerrainManager(1, 1, new TerrainHeightMapImpl(), null);
|
||||||
Node node = manager.getNode();
|
Node node = manager.getGfxNode();
|
||||||
|
|
||||||
assertEquals(new Vector3f(-1, 0, -1), node.getChild("TerrainMesh 0x0").getLocalTranslation());
|
assertEquals(new Vector3f(-1, 0, -1), node.getChild("TerrainMesh 0x0").getLocalTranslation());
|
||||||
assertEquals(new Vector3f( 0, 0, -1), node.getChild("TerrainMesh 1x0").getLocalTranslation());
|
assertEquals(new Vector3f( 0, 0, -1), node.getChild("TerrainMesh 1x0").getLocalTranslation());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue