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) { if (baseTarget === null) {
return options.fallbackToPathStart === true && if (options.fallbackToPathStart !== true) {
resolvedPath.points.length > 0 return null;
? cloneVec3(resolvedPath.points[0]!.position) }
: null;
return rig.railPlacementMode === "mapTargetBetweenPoints"
? sampleResolvedScenePathPosition(
resolvedPath,
rig.railStartProgress
)
: resolvedPath.points.length > 0
? cloneVec3(resolvedPath.points[0]!.position)
: null;
} }
return resolveNearestPointOnResolvedScenePath( if (rig.railPlacementMode === "mapTargetBetweenPoints") {
resolvedPath, const mappedProgress = mapWorldPointToScenePathProgressBetweenPoints({
baseTarget point: baseTarget,
).position; trackStartPoint: rig.trackStartPoint,
trackEndPoint: rig.trackEndPoint,
railStartProgress: rig.railStartProgress,
railEndProgress: rig.railEndProgress
});
return sampleResolvedScenePathPosition(
resolvedPath,
mappedProgress.railProgress
);
}
return resolveNearestPointOnResolvedScenePath(resolvedPath, baseTarget)
.position;
} }
} }
} }