Integrate junction edge seams into ViewportHost rendering logic

This commit is contained in:
2026-05-13 18:49:23 +02:00
parent ccdd06da0e
commit 2bf7c8fcf6

View File

@@ -210,7 +210,8 @@ import {
} from "../geometry/spline-road-mesh"; } from "../geometry/spline-road-mesh";
import { import {
buildSplineCorridorJunctionEdgeMeshGeometry, buildSplineCorridorJunctionEdgeMeshGeometry,
buildSplineCorridorJunctionMeshGeometry buildSplineCorridorJunctionMeshGeometry,
resolveSplineCorridorJunctionRoadEdgeSeams
} from "../geometry/spline-corridor-junction-mesh"; } from "../geometry/spline-corridor-junction-mesh";
import { import {
detectSplineCorridorJunctionCandidates, detectSplineCorridorJunctionCandidates,
@@ -7706,6 +7707,9 @@ export class ViewportHost {
terrains: readonly Terrain[], terrains: readonly Terrain[],
clipIntervalsByPath: ReturnType< clipIntervalsByPath: ReturnType<
typeof resolveSplineCorridorJunctionClipIntervals typeof resolveSplineCorridorJunctionClipIntervals
>,
roadEdgeSeamsByPath: ReturnType<
typeof resolveSplineCorridorJunctionRoadEdgeSeams
> >
): RoadSurfaceRenderObjects | null { ): RoadSurfaceRenderObjects | null {
if (!path.enabled || !path.visible || !path.road.enabled) { if (!path.enabled || !path.visible || !path.road.enabled) {
@@ -7734,7 +7738,8 @@ export class ViewportHost {
path, path,
side, side,
terrains, terrains,
clipIntervals: clipIntervalsByPath.get(path.id) clipIntervals: clipIntervalsByPath.get(path.id),
junctionEdgeSeams: roadEdgeSeamsByPath.get(path.id)
}); });
if (edgeGeometry === null) { if (edgeGeometry === null) {
@@ -7816,12 +7821,18 @@ export class ViewportHost {
junctions, junctions,
terrains terrains
}); });
const roadEdgeSeamsByPath = resolveSplineCorridorJunctionRoadEdgeSeams({
paths,
junctions,
terrains
});
for (const path of paths) { for (const path of paths) {
const renderObjects = this.createRoadSurfaceRenderObjects( const renderObjects = this.createRoadSurfaceRenderObjects(
path, path,
terrains, terrains,
clipIntervalsByPath clipIntervalsByPath,
roadEdgeSeamsByPath
); );
if (renderObjects === null) { if (renderObjects === null) {