MaterialTerrainBlock block1 = new MaterialTerrainBlock(getName()
+ "Block1", split, getStepScale(), heightBlock1, origin1, clod,
getTotalSize(), tempOffset, getOffsetAmount(), materialMap);
block1.setQuadrant((short) 1);
this.attachChild(block1);
block1.setModelBound(new BoundingBox());
block1.updateModelBound();
// 2 lower left
int[] heightBlock2 = createHeightSubBlock(heightMap, 0, split - 1,
split);
Vector3f origin2 = new Vector3f(-halfSize * getStepScale().x, 0, 0);
tempOffset.x = getOffset().x;
tempOffset.y = getOffset().y;
tempOffset.x += origin1.x / 2;
tempOffset.y += quarterSize * getStepScale().z;
MaterialTerrainBlock block2 = new MaterialTerrainBlock(getName()
+ "Block2", split, getStepScale(), heightBlock2, origin2, clod,
getTotalSize(), tempOffset, getOffsetAmount(), materialMap);
block2.setQuadrant((short) 2);
this.attachChild(block2);
block2.setModelBound(new BoundingBox());
block2.updateModelBound();
// 3 upper right
int[] heightBlock3 = createHeightSubBlock(heightMap, split - 1, 0,
split);
Vector3f origin3 = new Vector3f(0, 0, -halfSize * getStepScale().z);
tempOffset.x = getOffset().x;
tempOffset.y = getOffset().y;
tempOffset.x += quarterSize * getStepScale().x;
tempOffset.y += origin3.z / 2;
MaterialTerrainBlock block3 = new MaterialTerrainBlock(getName()
+ "Block3", split, getStepScale(), heightBlock3, origin3, clod,
getTotalSize(), tempOffset, getOffsetAmount(), materialMap);
block3.setQuadrant((short) 3);
this.attachChild(block3);
block3.setModelBound(new BoundingBox());
block3.updateModelBound();
// 4 lower right
int[] heightBlock4 = createHeightSubBlock(heightMap, split - 1,
split - 1, split);
Vector3f origin4 = new Vector3f(0, 0, 0);
tempOffset.x = getOffset().x;
tempOffset.y = getOffset().y;
tempOffset.x += quarterSize * getStepScale().x;
tempOffset.y += quarterSize * getStepScale().z;
MaterialTerrainBlock block4 = new MaterialTerrainBlock(getName()
+ "Block4", split, getStepScale(), heightBlock4, origin4, clod,
getTotalSize(), tempOffset, getOffsetAmount(), materialMap);
block4.setQuadrant((short) 4);
this.attachChild(block4);
block4.setModelBound(new BoundingBox());
block4.updateModelBound();
}