Tessellate exactly the support surface that engine height queries read.
The footprint is taken as the convex pieces whose union is the region itself,
so an L-shaped plate keeps its notch and a slab with an atrium void is drawn
with the void open. Drawing the hull instead would put floor under a camera
looking down the atrium while surfaceContains said there was none, which is
the same disagreement between the drawn ground and the queried ground that
this function exists to prevent.
Level and planar patches fan each piece. Heightfields split each piece at
every lattice coordinate inside its plan bounds, clip each lattice cell
against the piece, and evaluate every resulting vertex through
surfaceHeightAt. Every vertex therefore sits exactly on the bilinear
rule that feet and placement queries obey; inside a cell the drawn surface is
the fan's planar interpolation of those vertices, which departs from the
bilinear patch where a cell is twisted.
Positions are world metres with Y up, triangles face +Y, and vertices with
identical plan coordinates are shared, so their normals are the normalized
sum of the incident face normals.
Tessellate exactly the support surface that engine height queries read.
The footprint is taken as the convex pieces whose union is the region itself, so an L-shaped plate keeps its notch and a slab with an atrium void is drawn with the void open. Drawing the hull instead would put floor under a camera looking down the atrium while
surfaceContainssaid there was none, which is the same disagreement between the drawn ground and the queried ground that this function exists to prevent.Level and planar patches fan each piece. Heightfields split each piece at every lattice coordinate inside its plan bounds, clip each lattice cell against the piece, and evaluate every resulting vertex through surfaceHeightAt. Every vertex therefore sits exactly on the bilinear rule that feet and placement queries obey; inside a cell the drawn surface is the fan's planar interpolation of those vertices, which departs from the bilinear patch where a cell is twisted.
Positions are world metres with Y up, triangles face +Y, and vertices with identical plan coordinates are shared, so their normals are the normalized sum of the incident face normals.