Enhance validation and runtime support for spline corridor junctions
This commit is contained in:
@@ -3421,6 +3421,19 @@ function validateSplineCorridorJunction(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isRecord(junction.edge)) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-spline-corridor-junction-edge",
|
||||||
|
"Spline corridor junction edge settings must be an object.",
|
||||||
|
`${path}.edge`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
validateScenePathRoadEdge(junction.edge, `${path}.edge`, document, diagnostics);
|
||||||
|
}
|
||||||
|
|
||||||
if (!Array.isArray(junction.connections) || junction.connections.length < 2) {
|
if (!Array.isArray(junction.connections) || junction.connections.length < 2) {
|
||||||
diagnostics.push(
|
diagnostics.push(
|
||||||
createDiagnostic(
|
createDiagnostic(
|
||||||
|
|||||||
@@ -546,8 +546,9 @@ export interface RuntimePath {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface RuntimeSplineCorridorJunction
|
export interface RuntimeSplineCorridorJunction
|
||||||
extends SplineCorridorJunction {
|
extends Omit<SplineCorridorJunction, "edge"> {
|
||||||
material: MaterialDef | null;
|
material: MaterialDef | null;
|
||||||
|
edge: RuntimePathRoadEdgeSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RuntimeFoliageDefinition {
|
export interface RuntimeFoliageDefinition {
|
||||||
@@ -2063,7 +2064,11 @@ export function buildRuntimeSceneFromDocument(
|
|||||||
...junction,
|
...junction,
|
||||||
connections: junction.connections.map((connection) => ({ ...connection })),
|
connections: junction.connections.map((connection) => ({ ...connection })),
|
||||||
center: cloneVec3(junction.center),
|
center: cloneVec3(junction.center),
|
||||||
material: resolveRuntimeMaterial(document, junction.materialId)
|
material: resolveRuntimeMaterial(document, junction.materialId),
|
||||||
|
edge: {
|
||||||
|
...junction.edge,
|
||||||
|
material: resolveRuntimeMaterial(document, junction.edge.materialId)
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
const splineCorridorClipIntervalsByPath =
|
const splineCorridorClipIntervalsByPath =
|
||||||
resolveSplineCorridorJunctionClipIntervals({
|
resolveSplineCorridorJunctionClipIntervals({
|
||||||
|
|||||||
Reference in New Issue
Block a user