Move boundary sample skipping logic to lowered edge vertex collection
This commit is contained in:
@@ -56,19 +56,11 @@ function collectTopEdgeKeys(options: {
|
|||||||
options.level.positions[positionOffset + varyingOffset]! /
|
options.level.positions[positionOffset + varyingOffset]! /
|
||||||
options.terrain.cellSize;
|
options.terrain.cellSize;
|
||||||
const roundedVaryingSample = Math.round(varyingSample);
|
const roundedVaryingSample = Math.round(varyingSample);
|
||||||
const maxVaryingSample =
|
|
||||||
options.axis === "x"
|
|
||||||
? options.terrain.sampleCountZ - 1
|
|
||||||
: options.terrain.sampleCountX - 1;
|
|
||||||
|
|
||||||
if (Math.abs(varyingSample - roundedVaryingSample) > epsilon) {
|
if (Math.abs(varyingSample - roundedVaryingSample) > epsilon) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roundedVaryingSample === 0 || roundedVaryingSample === maxVaryingSample) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const sampleX =
|
const sampleX =
|
||||||
options.axis === "x"
|
options.axis === "x"
|
||||||
? options.sampleCoordinate
|
? options.sampleCoordinate
|
||||||
@@ -122,11 +114,19 @@ function collectLoweredEdgeVertexCount(options: {
|
|||||||
options.level.positions[positionOffset + varyingOffset]! /
|
options.level.positions[positionOffset + varyingOffset]! /
|
||||||
options.terrain.cellSize;
|
options.terrain.cellSize;
|
||||||
const roundedVaryingSample = Math.round(varyingSample);
|
const roundedVaryingSample = Math.round(varyingSample);
|
||||||
|
const maxVaryingSample =
|
||||||
|
options.axis === "x"
|
||||||
|
? options.terrain.sampleCountZ - 1
|
||||||
|
: options.terrain.sampleCountX - 1;
|
||||||
|
|
||||||
if (Math.abs(varyingSample - roundedVaryingSample) > epsilon) {
|
if (Math.abs(varyingSample - roundedVaryingSample) > epsilon) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (roundedVaryingSample === 0 || roundedVaryingSample === maxVaryingSample) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const sampleX =
|
const sampleX =
|
||||||
options.axis === "x"
|
options.axis === "x"
|
||||||
? options.sampleCoordinate
|
? options.sampleCoordinate
|
||||||
|
|||||||
Reference in New Issue
Block a user