protected void reIndexGeometry(HashMap<String,UpdatedTerrainPatch> updated, boolean useVariableLod) { UpdatedTerrainPatch utp = updated.get(getName()); if (utp != null && utp.isReIndexNeeded() ) { int pow = (int) Math.pow(2, utp.getNewLod()); boolean left = utp.getLeftLod() > utp.getNewLod(); boolean top = utp.getTopLod() > utp.getNewLod(); boolean right = utp.getRightLod() > utp.getNewLod(); boolean bottom = utp.getBottomLod() > utp.getNewLod(); IndexBuffer idxB; if (useVariableLod) idxB = geomap.writeIndexArrayLodVariable(pow, (int) Math.pow(2, utp.getRightLod()), (int) Math.pow(2, utp.getTopLod()), (int) Math.pow(2, utp.getLeftLod()), (int) Math.pow(2, utp.getBottomLod()), totalSize); else idxB = geomap.writeIndexArrayLodDiff(pow, right, top, left, bottom, totalSize); Buffer b; if (idxB.getBuffer() instanceof IntBuffer) b = (IntBuffer)idxB.getBuffer(); else b = (ShortBuffer)idxB.getBuffer(); utp.setNewIndexBuffer(b); } }
utpR.setNewLod(right.lod); utp.setRightLod(utpR.getNewLod()); utpR.setLeftLod(utp.getNewLod()); utpD.setNewLod(down.lod); utp.setBottomLod(utpD.getNewLod()); utpD.setTopLod(utp.getNewLod()); utpL.setNewLod(left.lod); utp.setLeftLod(utpL.getNewLod()); utpL.setRightLod(utp.getNewLod()); utpT.setNewLod(top.lod); utp.setTopLod(utpT.getNewLod()); utpT.setBottomLod(utp.getNewLod());
utpR.setNewLod(right.lod); utpR.setLeftLod(utp.getNewLod()); utpR.setFixEdges(true); utpD.setNewLod(down.lod); utpD.setTopLod(utp.getNewLod()); utpD.setFixEdges(true); utpT.setNewLod(top.lod); utpT.setBottomLod(utp.getNewLod()); utpT.setFixEdges(true); utpL.setNewLod(left.lod); utpL.setRightLod(utp.getNewLod()); utpL.setFixEdges(true);
protected void reIndexGeometry(HashMap<String,UpdatedTerrainPatch> updated, boolean useVariableLod) { UpdatedTerrainPatch utp = updated.get(getName()); if (utp != null && utp.isReIndexNeeded() ) { int pow = (int) Math.pow(2, utp.getNewLod()); boolean left = utp.getLeftLod() > utp.getNewLod(); boolean top = utp.getTopLod() > utp.getNewLod(); boolean right = utp.getRightLod() > utp.getNewLod(); boolean bottom = utp.getBottomLod() > utp.getNewLod(); IndexBuffer idxB; if (useVariableLod) idxB = geomap.writeIndexArrayLodVariable(pow, (int) Math.pow(2, utp.getRightLod()), (int) Math.pow(2, utp.getTopLod()), (int) Math.pow(2, utp.getLeftLod()), (int) Math.pow(2, utp.getBottomLod()), totalSize); else idxB = geomap.writeIndexArrayLodDiff(pow, right, top, left, bottom, totalSize); Buffer b; if (idxB.getBuffer() instanceof IntBuffer) b = (IntBuffer)idxB.getBuffer(); else b = (ShortBuffer)idxB.getBuffer(); utp.setNewIndexBuffer(b); } }
utpR.setNewLod(right.lod); utp.setRightLod(utpR.getNewLod()); utpR.setLeftLod(utp.getNewLod()); utpD.setNewLod(down.lod); utp.setBottomLod(utpD.getNewLod()); utpD.setTopLod(utp.getNewLod()); utpL.setNewLod(left.lod); utp.setLeftLod(utpL.getNewLod()); utpL.setRightLod(utp.getNewLod()); utpT.setNewLod(top.lod); utp.setTopLod(utpT.getNewLod()); utpT.setBottomLod(utp.getNewLod());
utpR.setNewLod(right.lod); utpR.setLeftLod(utp.getNewLod()); utpR.setFixEdges(true); utpD.setNewLod(down.lod); utpD.setTopLod(utp.getNewLod()); utpD.setFixEdges(true); utpT.setNewLod(top.lod); utpT.setBottomLod(utp.getNewLod()); utpT.setFixEdges(true); utpL.setNewLod(left.lod); utpL.setRightLod(utp.getNewLod()); utpL.setFixEdges(true);