Lines Matching refs:terrain
32 package jme3test.terrain;
54 import com.jme3.terrain.geomipmap.TerrainGrid;
55 import com.jme3.terrain.geomipmap.TerrainLodControl;
56 import com.jme3.terrain.geomipmap.TerrainQuad;
57 import com.jme3.terrain.geomipmap.grid.FractalTileLoader;
58 import com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator;
59 import com.jme3.terrain.heightmap.AbstractHeightMap;
60 import com.jme3.terrain.heightmap.ImageBasedHeightMap;
61 import com.jme3.terrain.noise.ShaderUtils;
62 import com.jme3.terrain.noise.basis.FilteredBasis;
63 import com.jme3.terrain.noise.filter.IterativeFilter;
64 import com.jme3.terrain.noise.filter.OptimizedErode;
65 import com.jme3.terrain.noise.filter.PerturbFilter;
66 import com.jme3.terrain.noise.filter.SmoothFilter;
67 import com.jme3.terrain.noise.fractal.FractalSum;
68 import com.jme3.terrain.noise.modulator.NoiseModulator;
80 private TerrainQuad terrain;
119 if (terrain != null && intersection != null) {
120 float h = terrain.getHeight(new Vector2f(intersection.x, intersection.z));
121 Vector3f tl = terrain.getWorldTranslation();
125 Vector3f normal = terrain.getNormal(new Vector2f(intersection.x, intersection.z));
161 hintText.setText("Hit 1 to raise terrain, hit 2 to lower terrain");
172 hintText.setText("Press left mouse button to raise terrain, press right mouse button to lower terrain. " + x + "," + y + "," + z+targetText);
200 terrain.setMaterial(matWire);
202 terrain.setMaterial(matTerrain);
215 int radiusStepsX = (int) (radius / terrain.getLocalScale().x);
216 int radiusStepsZ = (int) (radius / terrain.getLocalScale().z);
218 float xStepAmount = terrain.getLocalScale().x;
219 float zStepAmount = terrain.getLocalScale().z;
239 terrain.adjustHeight(locs, heights);
241 terrain.updateModelBound();
268 int numCollisions = terrain.collideWith(ray, results);
277 // First, we load up our textures and the heightmap texture for the terrain
279 // TERRAIN TEXTURE material
280 matTerrain = new Material(assetManager, "Common/MatDefs/Terrain/TerrainLighting.j3md");
286 matTerrain.setTexture("AlphaMap", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));
289 Texture grass = assetManager.loadTexture("Textures/Terrain/splat/grass.jpg");
295 Texture dirt = assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg");
301 Texture rock = assetManager.loadTexture("Textures/Terrain/splat/road.jpg");
306 // HEIGHTMAP image (for the terrain heightmap)
307 Texture heightMapImage = assetManager.loadTexture("Textures/Terrain/splat/mountains512.png");
318 // CREATE THE TERRAIN
319 terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
320 TerrainLodControl control = new TerrainLodControl(terrain, getCamera());
322 terrain.addControl(control);
323 terrain.setMaterial(matTerrain);
324 terrain.setLocalTranslation(0, -100, 0);
325 terrain.setLocalScale(2.5f, 0.5f, 2.5f);
326 rootNode.attachChild(terrain);
331 // TERRAIN TEXTURE material
332 matTerrain = new Material(this.assetManager, "Common/MatDefs/Terrain/HeightBasedTerrain.j3md");
343 // terrainSize: the total size of the terrain (used for scaling the texture)
345 Texture grass = assetManager.loadTexture("Textures/Terrain/splat/grass.jpg");
351 Texture dirt = assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg");
357 Texture rock = assetManager.loadTexture("Textures/Terrain/Rock2/rock.jpg");
405 this.terrain = new TerrainGrid("terrain", 65, 257, new FractalTileLoader(ground, 256f));
408 terrain.setMaterial(matTerrain);
409 terrain.setLocalTranslation(0, 0, 0);
410 terrain.setLocalScale(2f, 1f, 2f);
412 rootNode.attachChild(this.terrain);
414 TerrainLodControl control = new TerrainLodControl(this.terrain, getCamera());
415 this.terrain.addControl(control);