geomap = new LODGeomap(size, heightMap); Mesh m = geomap.createMesh(stepScale, new Vector2f(1,1), offset, offsetAmount, totalSize, false); setMesh(m);
/** * Called internally by com.jme3.util.clone.Cloner. Do not call directly. */ @Override public void cloneFields( Cloner cloner, Object original ) { super.cloneFields(cloner, 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(); }
@Override public TerrainPatch clone() { TerrainPatch clone = new TerrainPatch(); clone.name = name.toString(); clone.size = size; clone.totalSize = totalSize; clone.quadrant = quadrant; clone.stepScale = stepScale.clone(); clone.offset = offset.clone(); clone.offsetAmount = offsetAmount; //clone.lodCalculator = lodCalculator.clone(); //clone.lodCalculator.setTerrainPatch(clone); //clone.setLodCalculator(lodCalculatorFactory.clone()); clone.geomap = new LODGeomap(size, geomap.getHeightArray()); clone.setLocalTranslation(getLocalTranslation().clone()); Mesh m = clone.geomap.createMesh(clone.stepScale, Vector2f.UNIT_XY, clone.offset, clone.offsetAmount, clone.totalSize, false); clone.setMesh(m); clone.setMaterial(material.clone()); return clone; }
geomap = new LODGeomap(size, heightMap); Mesh m = geomap.createMesh(stepScale, new Vector2f(1,1), offset, offsetAmount, totalSize, false); setMesh(m);
@Override public TerrainPatch clone() { TerrainPatch clone = new TerrainPatch(); clone.name = name.toString(); clone.size = size; clone.totalSize = totalSize; clone.quadrant = quadrant; clone.stepScale = stepScale.clone(); clone.offset = offset.clone(); clone.offsetAmount = offsetAmount; //clone.lodCalculator = lodCalculator.clone(); //clone.lodCalculator.setTerrainPatch(clone); //clone.setLodCalculator(lodCalculatorFactory.clone()); clone.geomap = new LODGeomap(size, geomap.getHeightArray()); clone.setLocalTranslation(getLocalTranslation().clone()); Mesh m = clone.geomap.createMesh(clone.stepScale, Vector2f.UNIT_XY, clone.offset, clone.offsetAmount, clone.totalSize, false); clone.setMesh(m); clone.setMaterial(material.clone()); return clone; }