cleaned up some terrain code and deprecated a few constructors
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9674 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
16b1afabec
commit
05f5473505
@ -135,6 +135,7 @@ public class TerrainQuad extends Node implements Terrain {
|
|||||||
* @param heightMap The height map to generate the terrain from (a flat
|
* @param heightMap The height map to generate the terrain from (a flat
|
||||||
* height map will be generated if this is null)
|
* height map will be generated if this is null)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public TerrainQuad(String name, int patchSize, int quadSize, int totalSize, float[] heightMap) {
|
public TerrainQuad(String name, int patchSize, int quadSize, int totalSize, float[] heightMap) {
|
||||||
this(name, patchSize, totalSize, quadSize, Vector3f.UNIT_XYZ, heightMap);
|
this(name, patchSize, totalSize, quadSize, Vector3f.UNIT_XYZ, heightMap);
|
||||||
}
|
}
|
||||||
@ -149,6 +150,7 @@ public class TerrainQuad extends Node implements Terrain {
|
|||||||
* @param heightMap The height map to generate the terrain from (a flat
|
* @param heightMap The height map to generate the terrain from (a flat
|
||||||
* height map will be generated if this is null)
|
* height map will be generated if this is null)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public TerrainQuad(String name, int patchSize, int size, Vector3f scale, float[] heightMap) {
|
public TerrainQuad(String name, int patchSize, int size, Vector3f scale, float[] heightMap) {
|
||||||
this(name, patchSize, size, scale, heightMap, size, new Vector2f(), 0);
|
this(name, patchSize, size, scale, heightMap, size, new Vector2f(), 0);
|
||||||
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), size*2, Float.MAX_VALUE, size*2);
|
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), size*2, Float.MAX_VALUE, size*2);
|
||||||
@ -167,6 +169,7 @@ public class TerrainQuad extends Node implements Terrain {
|
|||||||
* @param heightMap The height map to generate the terrain from (a flat
|
* @param heightMap The height map to generate the terrain from (a flat
|
||||||
* height map will be generated if this is null)
|
* height map will be generated if this is null)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public TerrainQuad(String name, int patchSize, int totalSize, int quadSize, Vector3f scale, float[] heightMap) {
|
public TerrainQuad(String name, int patchSize, int totalSize, int quadSize, Vector3f scale, float[] heightMap) {
|
||||||
this(name, patchSize, quadSize, scale, heightMap, totalSize, new Vector2f(), 0);
|
this(name, patchSize, quadSize, scale, heightMap, totalSize, new Vector2f(), 0);
|
||||||
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), totalSize*2, Float.MAX_VALUE, totalSize*2);
|
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), totalSize*2, Float.MAX_VALUE, totalSize*2);
|
||||||
|
@ -45,7 +45,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class PerspectiveLodCalculator implements LodCalculator {
|
public class PerspectiveLodCalculator implements LodCalculator {
|
||||||
|
|
||||||
private TerrainPatch patch;
|
|
||||||
private Camera cam;
|
private Camera cam;
|
||||||
private float[] entropyDistances;
|
private float[] entropyDistances;
|
||||||
private float pixelError;
|
private float pixelError;
|
||||||
@ -74,11 +73,7 @@ public class PerspectiveLodCalculator implements LodCalculator {
|
|||||||
return A / T;
|
return A / T;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean calculateLod(List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
|
public boolean calculateLod(TerrainPatch patch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
|
||||||
return calculateLod(patch, locations, updates);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean calculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
|
|
||||||
if (entropyDistances == null){
|
if (entropyDistances == null){
|
||||||
// compute entropy distances
|
// compute entropy distances
|
||||||
float[] lodEntropies = patch.getLodEntropies();
|
float[] lodEntropies = patch.getLodEntropies();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user