Update road profile generation for banks and ditches, and adjust profile capping logic to exclude soft shoulders.

This commit is contained in:
2026-05-13 05:18:41 +02:00
parent d31f4ded8b
commit f6ffff8396

View File

@@ -251,13 +251,18 @@ function buildEdgeProfile(options: {
case "bank": case "bank":
return [ return [
{ offset: innerOffset, heightOffset: 0 }, { offset: innerOffset, heightOffset: 0 },
{ offset: outerOffset, heightOffset: edgeHeight } { offset: outerOffset, heightOffset: edgeHeight },
{ offset: outerOffset, heightOffset: 0 }
]; ];
case "ditch": case "ditch": {
const middleOffset = (innerOffset + outerOffset) * 0.5;
return [ return [
{ offset: innerOffset, heightOffset: 0 }, { offset: innerOffset, heightOffset: 0 },
{ offset: outerOffset, heightOffset: -edgeHeight } { offset: middleOffset, heightOffset: -edgeHeight },
{ offset: outerOffset, heightOffset: 0 }
]; ];
}
case "softShoulder": case "softShoulder":
return [ return [
{ offset: innerOffset, heightOffset: 0 }, { offset: innerOffset, heightOffset: 0 },
@@ -449,7 +454,7 @@ export function buildSplineRoadEdgeMeshData(options: {
} }
} }
if (edge.kind === "curb") { if (edge.kind !== "softShoulder") {
addEdgeProfileCaps({ addEdgeProfileCaps({
indices, indices,
profileVertexCount: profile.length, profileVertexCount: profile.length,