public Mesh createMesh(Vector3f scale, Vector2f tcScale, Vector2f tcOffset, float offsetAmount, int totalSize, boolean center) { return this.createMesh(scale, tcScale, tcOffset, offsetAmount, totalSize, center, 1, false, false, false, false); }
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; }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule ic = im.getCapsule(this); size = ic.readInt("size", 16); totalSize = ic.readInt("totalSize", 16); quadrant = ic.readShort("quadrant", (short)0); stepScale = (Vector3f) ic.readSavable("stepScale", Vector3f.UNIT_XYZ); offset = (Vector2f) ic.readSavable("offset", Vector3f.UNIT_XYZ); offsetAmount = ic.readFloat("offsetAmount", 0); //lodCalculator = (LodCalculator) ic.readSavable("lodCalculator", new DistanceLodCalculator()); //lodCalculator.setTerrainPatch(this); //lodCalculatorFactory = (LodCalculatorFactory) ic.readSavable("lodCalculatorFactory", null); lodEntropy = ic.readFloatArray("lodEntropy", null); geomap = (LODGeomap) ic.readSavable("geomap", null); Mesh regen = geomap.createMesh(stepScale, new Vector2f(1,1), offset, offsetAmount, totalSize, false); setMesh(regen); //TangentBinormalGenerator.generate(this); // note that this will be removed ensurePositiveVolumeBBox(); }
public Mesh createMesh(Vector3f scale, Vector2f tcScale, Vector2f tcOffset, float offsetAmount, int totalSize, boolean center) { return this.createMesh(scale, tcScale, tcOffset, offsetAmount, totalSize, center, 1, false, false, false, false); }
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; }
@Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule ic = im.getCapsule(this); size = ic.readInt("size", 16); totalSize = ic.readInt("totalSize", 16); quadrant = ic.readShort("quadrant", (short)0); stepScale = (Vector3f) ic.readSavable("stepScale", Vector3f.UNIT_XYZ); offset = (Vector2f) ic.readSavable("offset", Vector3f.UNIT_XYZ); offsetAmount = ic.readFloat("offsetAmount", 0); //lodCalculator = (LodCalculator) ic.readSavable("lodCalculator", new DistanceLodCalculator()); //lodCalculator.setTerrainPatch(this); //lodCalculatorFactory = (LodCalculatorFactory) ic.readSavable("lodCalculatorFactory", null); lodEntropy = ic.readFloatArray("lodEntropy", null); geomap = (LODGeomap) ic.readSavable("geomap", null); Mesh regen = geomap.createMesh(stepScale, new Vector2f(1,1), offset, offsetAmount, totalSize, false); setMesh(regen); //TangentBinormalGenerator.generate(this); // note that this will be removed ensurePositiveVolumeBBox(); }