@ -152,16 +166,17 @@ public class TerrainQuad extends Node implements Terrain {
LodCalculatorFactorylodCalculatorFactory)
LodCalculatorFactorylodCalculatorFactory)
{
{
super(name);
super(name);
if(heightMap==null)
heightMap=generateDefaultHeightMap(size);
if(!FastMath.isPowerOfTwo(size-1)){
if(!FastMath.isPowerOfTwo(size-1)){
thrownewRuntimeException("size given: "+size+" Terrain quad sizes may only be (2^N + 1)");
thrownewRuntimeException("size given: "+size+" Terrain quad sizes may only be (2^N + 1)");
}
}
if(FastMath.sqrt(heightMap.length)>size){
if(FastMath.sqrt(heightMap.length)>size){
Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"Heightmap size is larger than the terrain size. Make sure your heightmap image is the same size as the terrain!");
Logger.getLogger(this.getClass().getName()).log(Level.WARNING,"Heightmap size is larger than the terrain size. Make sure your heightmap image is the same size as the terrain!");
}
}
if(heightMap==null)
heightMap=generateDefaultHeightMap(size);
this.offset=offset;
this.offset=offset;
this.offsetAmount=offsetAmount;
this.offsetAmount=offsetAmount;
this.totalSize=totalSize;
this.totalSize=totalSize;
@ -958,21 +973,29 @@ public class TerrainQuad extends Node implements Terrain {