Update road profile generation for banks and ditches, and adjust profile capping logic to exclude soft shoulders.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user