Restrict ground occluder to recessed slabs
This commit is contained in:
@@ -55,7 +55,16 @@ export const SiteRenderer = ({ node }: { node: SiteNode }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const next = nodeList
|
const next = nodeList
|
||||||
.filter((n): n is SlabNode => n.type === 'slab' && n.visible && n.polygon.length >= 3)
|
.filter(
|
||||||
|
(n): n is SlabNode =>
|
||||||
|
n.type === 'slab' &&
|
||||||
|
n.visible &&
|
||||||
|
n.polygon.length >= 3 &&
|
||||||
|
// Only recessed slabs should punch through the site ground.
|
||||||
|
// Positive slabs are real floor geometry and should not create a
|
||||||
|
// ghost footprint in the background ground fill.
|
||||||
|
(n.elevation ?? 0.05) < 0,
|
||||||
|
)
|
||||||
.filter((n) => {
|
.filter((n) => {
|
||||||
if (!Number.isFinite(lowestLevelIndex)) return true
|
if (!Number.isFinite(lowestLevelIndex)) return true
|
||||||
const parentLevel = n.parentId ? levelIndexById.get(n.parentId as string) : undefined
|
const parentLevel = n.parentId ? levelIndexById.get(n.parentId as string) : undefined
|
||||||
|
|||||||
@@ -38,7 +38,15 @@ export const GroundOccluder = () => {
|
|||||||
const polygons: [number, number][][] = []
|
const polygons: [number, number][][] = []
|
||||||
|
|
||||||
Object.values(nodes).forEach((node) => {
|
Object.values(nodes).forEach((node) => {
|
||||||
if (!(node.type === 'slab' && node.visible && node.polygon.length >= 3)) {
|
if (
|
||||||
|
!(
|
||||||
|
node.type === 'slab' &&
|
||||||
|
node.visible &&
|
||||||
|
node.polygon.length >= 3 &&
|
||||||
|
// Only recessed slabs should punch through the ground plane.
|
||||||
|
(node.elevation ?? 0.05) < 0
|
||||||
|
)
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user