auto-git:

[change] src/entities/entity-instances.ts
This commit is contained in:
2026-04-23 08:49:39 +02:00
parent aca2813c76
commit f8627f7c31

View File

@@ -951,16 +951,37 @@ export function resolveCameraRigDocumentPosition(
);
if (baseTarget === null) {
return options.fallbackToPathStart === true &&
resolvedPath.points.length > 0
? cloneVec3(resolvedPath.points[0]!.position)
: null;
if (options.fallbackToPathStart !== true) {
return null;
}
return rig.railPlacementMode === "mapTargetBetweenPoints"
? sampleResolvedScenePathPosition(
resolvedPath,
rig.railStartProgress
)
: resolvedPath.points.length > 0
? cloneVec3(resolvedPath.points[0]!.position)
: null;
}
return resolveNearestPointOnResolvedScenePath(
resolvedPath,
baseTarget
).position;
if (rig.railPlacementMode === "mapTargetBetweenPoints") {
const mappedProgress = mapWorldPointToScenePathProgressBetweenPoints({
point: baseTarget,
trackStartPoint: rig.trackStartPoint,
trackEndPoint: rig.trackEndPoint,
railStartProgress: rig.railStartProgress,
railEndProgress: rig.railEndProgress
});
return sampleResolvedScenePathPosition(
resolvedPath,
mappedProgress.railProgress
);
}
return resolveNearestPointOnResolvedScenePath(resolvedPath, baseTarget)
.position;
}
}
}