|
|
|
@ -123,6 +123,10 @@ public class TerrainQuad extends Node implements Terrain { |
|
|
|
|
*/ |
|
|
|
|
public TerrainQuad(String name, int patchSize, int totalSize, float[] heightMap) { |
|
|
|
|
this(name, patchSize, totalSize, Vector3f.UNIT_XYZ, heightMap); |
|
|
|
|
|
|
|
|
|
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), size*2, Float.MAX_VALUE, size*2); |
|
|
|
|
fixNormalEdges(affectedAreaBBox); |
|
|
|
|
addControl(new NormalRecalcControl(this)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -153,9 +157,9 @@ public class TerrainQuad extends Node implements Terrain { |
|
|
|
|
@Deprecated |
|
|
|
|
public TerrainQuad(String name, int patchSize, int size, Vector3f scale, float[] heightMap) { |
|
|
|
|
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); |
|
|
|
|
fixNormalEdges(affectedAreaBBox); |
|
|
|
|
addControl(new NormalRecalcControl(this)); |
|
|
|
|
//affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), size*2, Float.MAX_VALUE, size*2);
|
|
|
|
|
//fixNormalEdges(affectedAreaBBox);
|
|
|
|
|
//addControl(new NormalRecalcControl(this));
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -172,9 +176,9 @@ public class TerrainQuad extends Node implements Terrain { |
|
|
|
|
@Deprecated |
|
|
|
|
public TerrainQuad(String name, int patchSize, int totalSize, int quadSize, Vector3f scale, float[] heightMap) { |
|
|
|
|
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); |
|
|
|
|
fixNormalEdges(affectedAreaBBox); |
|
|
|
|
addControl(new NormalRecalcControl(this)); |
|
|
|
|
//affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), totalSize*2, Float.MAX_VALUE, totalSize*2);
|
|
|
|
|
//fixNormalEdges(affectedAreaBBox);
|
|
|
|
|
//addControl(new NormalRecalcControl(this));
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected TerrainQuad(String name, int patchSize, int quadSize, |
|
|
|
@ -851,7 +855,7 @@ public class TerrainQuad extends Node implements Terrain { |
|
|
|
|
if (affectedAreaBBox != null) |
|
|
|
|
return true; |
|
|
|
|
if (!lastScale.equals(getWorldScale())) { |
|
|
|
|
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), size, Float.MAX_VALUE, size); |
|
|
|
|
affectedAreaBBox = new BoundingBox(getWorldTranslation(), Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); |
|
|
|
|
lastScale = getWorldScale(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -862,7 +866,7 @@ public class TerrainQuad extends Node implements Terrain { |
|
|
|
|
* This will cause all normals for this terrain quad to be recalculated |
|
|
|
|
*/ |
|
|
|
|
protected void setNeedToRecalculateNormals() { |
|
|
|
|
affectedAreaBBox = new BoundingBox(new Vector3f(0,0,0), size*2, Float.MAX_VALUE, size*2); |
|
|
|
|
affectedAreaBBox = new BoundingBox(getWorldTranslation(), Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public float getHeightmapHeight(Vector2f xz) { |
|
|
|
|