@Override public void setMaterial(Material mat) { this.material = mat; super.setMaterial(mat); }
public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; if (!wireframe) { terrain.setMaterial(matWire); } else { terrain.setMaterial(matTerrain); } } else if (name.equals("Raise")) { raiseTerrain = pressed; } else if (name.equals("Lower")) { lowerTerrain = pressed; } } };
public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; if (!wireframe) { terrain.setMaterial(matWire); } else { terrain.setMaterial(matRock); } } else if (name.equals("triPlanar") && !pressed) { triPlanar = !triPlanar; if (triPlanar) { matRock.setBoolean("useTriPlanarMapping", true); // planar textures don't use the mesh's texture coordinates but real world coordinates, // so we need to convert these texture coordinate scales into real world scales so it looks // the same when we switch to/from tr-planar mode matRock.setFloat("Tex1Scale", 1f / (float) (512f / grassScale)); matRock.setFloat("Tex2Scale", 1f / (float) (512f / dirtScale)); matRock.setFloat("Tex3Scale", 1f / (float) (512f / rockScale)); } else { matRock.setBoolean("useTriPlanarMapping", false); matRock.setFloat("Tex1Scale", grassScale); matRock.setFloat("Tex2Scale", dirtScale); matRock.setFloat("Tex3Scale", rockScale); } } } };
public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; if (!wireframe) { terrain.setMaterial(matWire); } else { terrain.setMaterial(matRock); } } else if (name.equals("triPlanar") && !pressed) { triPlanar = !triPlanar; if (triPlanar) { matRock.setBoolean("useTriPlanarMapping", true); // planar textures don't use the mesh's texture coordinates but real world coordinates, // so we need to convert these texture coordinate scales into real world scales so it looks // the same when we switch to/from tri-planar mode matRock.setFloat("Tex1Scale", 1f / (float) (512f / grassScale)); matRock.setFloat("Tex2Scale", 1f / (float) (512f / dirtScale)); matRock.setFloat("Tex3Scale", 1f / (float) (512f / rockScale)); } else { matRock.setBoolean("useTriPlanarMapping", false); matRock.setFloat("Tex1Scale", grassScale); matRock.setFloat("Tex2Scale", dirtScale); matRock.setFloat("Tex3Scale", rockScale); } } } };
wireframe = !wireframe; if (!wireframe) { terrain.setMaterial(matWire); } else { terrain.setMaterial(matTerrain);
wireframe = !wireframe; if (wireframe) { terrain.setMaterial(matWire); } else { terrain.setMaterial(matRock);
terrain1.setMaterial(matTerrain); terrain1.setLocalTranslation(-256, -100, -256); terrain1.setLocalScale(1f, 1f, 1f); terrain2.setMaterial(matTerrain); terrain2.setLocalTranslation(-256, -100, 256); terrain2.setLocalScale(1f, 1f, 1f); terrain3.setMaterial(matTerrain); terrain3.setLocalTranslation(256, -100, -256); terrain3.setLocalScale(1f, 1f, 1f); terrain4.setMaterial(matTerrain); terrain4.setLocalTranslation(256, -100, 256); terrain4.setLocalScale(1f, 1f, 1f);
q = gridTileLoader.getTerrainQuadAt(quadCell); if(q.getMaterial()==null) q.setMaterial(material.clone()); log.log(Level.FINE, "Loaded TerrainQuad {0} from TerrainQuadGrid", q.getName());
List<Camera> cameras = new ArrayList<Camera>(); cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0));
List<Camera> cameras = new ArrayList<Camera>(); cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0));
List<Camera> cameras = new ArrayList<Camera>(); cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0));
List<Camera> cameras = new ArrayList<Camera>(); cameras.add(getCamera()); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0));
TerrainLodControl control = new TerrainLodControl(terrain, cameras); terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2));
TerrainLodControl control = new TerrainLodControl(terrain, cameras); terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2)); terrain.setLocked(false); // unlock it so we can edit the height
control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier terrain.addControl(control); terrain.setMaterial(matTerrain); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(2.5f, 0.5f, 2.5f);
control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier terrainQuad.addControl(control); terrainQuad.setMaterial(matTerrain); terrainQuad.setLocalTranslation(0, -100, 0); terrainQuad.setLocalScale(4f, 0.25f, 4f);
control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2)); terrain.setLocked(false); // unlock it so we can edit the height
control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(2f, 0.5f, 2f);
control.setLodCalculator( new DistanceLodCalculator(33, 2.7f) ); // patch size, and a multiplier terrain.addControl(control); terrain.setMaterial(matRock); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(8f, 0.5f, 8f);
terrain.setMaterial(mat_terrain); terrain.setLocalTranslation(0, -100, 0); terrain.setLocalScale(2f, 1f, 2f);