auto-git:
[change] src/spline-corridor/spline-repeaters.ts
This commit is contained in:
@@ -16,6 +16,10 @@ import {
|
|||||||
BUNDLED_SPLINE_CORRIDOR_ASSET_REGISTRY,
|
BUNDLED_SPLINE_CORRIDOR_ASSET_REGISTRY,
|
||||||
type BundledSplineCorridorAsset
|
type BundledSplineCorridorAsset
|
||||||
} from "./bundled-spline-corridor-assets";
|
} from "./bundled-spline-corridor-assets";
|
||||||
|
import {
|
||||||
|
isDistanceInSplineCorridorClipIntervals,
|
||||||
|
type SplineCorridorPathClipInterval
|
||||||
|
} from "./spline-corridor-clips";
|
||||||
|
|
||||||
export interface SplineRepeaterPathPointLike {
|
export interface SplineRepeaterPathPointLike {
|
||||||
id?: string;
|
id?: string;
|
||||||
@@ -149,6 +153,7 @@ function resolvePlacementOffset(repeater: ScenePathRepeater): number {
|
|||||||
export function deriveSplineRepeaterInstances(options: {
|
export function deriveSplineRepeaterInstances(options: {
|
||||||
path: SplineRepeaterPathLike;
|
path: SplineRepeaterPathLike;
|
||||||
terrains?: readonly Terrain[];
|
terrains?: readonly Terrain[];
|
||||||
|
clipIntervals?: readonly SplineCorridorPathClipInterval[];
|
||||||
}): SplineRepeaterInstance[] {
|
}): SplineRepeaterInstance[] {
|
||||||
const { path } = options;
|
const { path } = options;
|
||||||
const terrains = options.terrains ?? [];
|
const terrains = options.terrains ?? [];
|
||||||
@@ -208,6 +213,15 @@ export function deriveSplineRepeaterInstances(options: {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
isDistanceInSplineCorridorClipIntervals(
|
||||||
|
distance,
|
||||||
|
options.clipIntervals
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const progress = distance / resolvedPath.totalLength;
|
const progress = distance / resolvedPath.totalLength;
|
||||||
const center = sampleResolvedScenePathPosition(resolvedPath, progress);
|
const center = sampleResolvedScenePathPosition(resolvedPath, progress);
|
||||||
const tangent = normalizeHorizontal(
|
const tangent = normalizeHorizontal(
|
||||||
|
|||||||
Reference in New Issue
Block a user