|
|
@ -50,6 +50,7 @@ import com.jme3.scene.mesh.IndexBuffer; |
|
|
|
import com.jme3.terrain.geomipmap.TerrainQuad.LocationHeight; |
|
|
|
import com.jme3.terrain.geomipmap.TerrainQuad.LocationHeight; |
|
|
|
import com.jme3.terrain.geomipmap.lodcalc.util.EntropyComputeUtil; |
|
|
|
import com.jme3.terrain.geomipmap.lodcalc.util.EntropyComputeUtil; |
|
|
|
import com.jme3.util.BufferUtils; |
|
|
|
import com.jme3.util.BufferUtils; |
|
|
|
|
|
|
|
import com.jme3.util.clone.Cloner; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.nio.Buffer; |
|
|
|
import java.nio.Buffer; |
|
|
|
import java.nio.FloatBuffer; |
|
|
|
import java.nio.FloatBuffer; |
|
|
@ -955,6 +956,33 @@ public class TerrainPatch extends Geometry { |
|
|
|
return clone; |
|
|
|
return clone; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Called internally by com.jme3.util.clone.Cloner. Do not call directly. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void cloneFields( Cloner cloner, Object original ) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.stepScale = cloner.clone(stepScale); |
|
|
|
|
|
|
|
this.offset = cloner.clone(offset); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.leftNeighbour = null; |
|
|
|
|
|
|
|
this.topNeighbour = null; |
|
|
|
|
|
|
|
this.rightNeighbour = null; |
|
|
|
|
|
|
|
this.bottomNeighbour = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Don't feel like making geomap cloneable tonight
|
|
|
|
|
|
|
|
// so I'll copy the old logic.
|
|
|
|
|
|
|
|
this.geomap = new LODGeomap(size, geomap.getHeightArray()); |
|
|
|
|
|
|
|
Mesh m = geomap.createMesh(stepScale, Vector2f.UNIT_XY, offset, offsetAmount, totalSize, false); |
|
|
|
|
|
|
|
this.setMesh(m); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// In this case, we always clone material even if the cloner is setup
|
|
|
|
|
|
|
|
// not to clone it. Terrain uses mutable textures and stuff so it's important
|
|
|
|
|
|
|
|
// to clone it. (At least that's my understanding and is evidenced by the old
|
|
|
|
|
|
|
|
// clone code specifically cloning material.) -pspeed
|
|
|
|
|
|
|
|
this.material = material.clone(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void ensurePositiveVolumeBBox() { |
|
|
|
protected void ensurePositiveVolumeBBox() { |
|
|
|
if (getModelBound() instanceof BoundingBox) { |
|
|
|
if (getModelBound() instanceof BoundingBox) { |
|
|
|
if (((BoundingBox)getModelBound()).getYExtent() < 0.001f) { |
|
|
|
if (((BoundingBox)getModelBound()).getYExtent() < 0.001f) { |
|
|
|