rootPoint.set(0, this.getHeightmapHeight(s,i), 0); leftPoint.set(-1, this.getHeightmapHeight(s-1,i), 0); rightPoint.set(1, right.getHeightmapHeight(1,i), 0); bottomPoint.set(0, this.getHeightmapHeight(s,i+1), 1); setInBuffer(right.getMesh(), 0, normal, tangent, binormal); } else { topPoint.set(0, top.getHeightmapHeight(s,s-1), -1); topPoint.set(0, this.getHeightmapHeight(s,s-1), -1); setInBuffer(right.getMesh(), (s+1)*(s), normal, tangent, binormal); } else { bottomPoint.set(0, bottom.getHeightmapHeight(s,1), 1); averageNormalsTangents(topPoint, rootPoint, leftPoint, bottomPoint, rightPoint, normal, tangent, binormal); setInBuffer(this.getMesh(), (s+1)*(s+1)-1, normal, tangent, binormal); topPoint.set(0, this.getHeightmapHeight(s,i-1), -1); bottomPoint.set(0, this.getHeightmapHeight(s,i+1), 1); averageNormalsTangents(topPoint, rootPoint, leftPoint, bottomPoint, rightPoint, normal, tangent, binormal); setInBuffer(this.getMesh(), (s+1)*(i+1)-1, normal, tangent, binormal); rootPoint.set(0, this.getHeightmapHeight(0,i), 0); leftPoint.set(-1, left.getHeightmapHeight(s-1,i), 0); rightPoint.set(1, this.getHeightmapHeight(1,i), 0); bottomPoint.set(0, this.getHeightmapHeight(0,i+1), 1);
return ((TerrainQuad) spat).getHeightmapHeight(col, row); } else if (spat instanceof TerrainPatch) { return ((TerrainPatch) spat).getHeightmapHeight(col, row);
rootPoint.set(0, this.getHeightmapHeight(s,i), 0); leftPoint.set(-1, this.getHeightmapHeight(s-1,i), 0); rightPoint.set(1, right.getHeightmapHeight(1,i), 0); bottomPoint.set(0, this.getHeightmapHeight(s,i+1), 1); setInBuffer(right.getMesh(), 0, normal, tangent, binormal); } else { topPoint.set(0, top.getHeightmapHeight(s,s-1), -1); topPoint.set(0, this.getHeightmapHeight(s,s-1), -1); setInBuffer(right.getMesh(), (s+1)*(s), normal, tangent, binormal); } else { bottomPoint.set(0, bottom.getHeightmapHeight(s,1), 1); averageNormalsTangents(topPoint, rootPoint, leftPoint, bottomPoint, rightPoint, normal, tangent, binormal); setInBuffer(this.getMesh(), (s+1)*(s+1)-1, normal, tangent, binormal); topPoint.set(0, this.getHeightmapHeight(s,i-1), -1); bottomPoint.set(0, this.getHeightmapHeight(s,i+1), 1); averageNormalsTangents(topPoint, rootPoint, leftPoint, bottomPoint, rightPoint, normal, tangent, binormal); setInBuffer(this.getMesh(), (s+1)*(i+1)-1, normal, tangent, binormal); rootPoint.set(0, this.getHeightmapHeight(0,i), 0); leftPoint.set(-1, left.getHeightmapHeight(s-1,i), 0); rightPoint.set(1, this.getHeightmapHeight(1,i), 0); bottomPoint.set(0, this.getHeightmapHeight(0,i+1), 1);
return ((TerrainQuad) spat).getHeightmapHeight(col, row); } else if (spat instanceof TerrainPatch) { return ((TerrainPatch) spat).getHeightmapHeight(col, row);