From 347953d41d69dc622ac5a6f28b5d5f7a8ad86d6b Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 23 Apr 2026 09:07:22 +0200 Subject: [PATCH] auto-git: [change] tests/domain/build-runtime-scene.test.ts --- tests/domain/build-runtime-scene.test.ts | 106 +++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/tests/domain/build-runtime-scene.test.ts b/tests/domain/build-runtime-scene.test.ts index d799fb32..cc056073 100644 --- a/tests/domain/build-runtime-scene.test.ts +++ b/tests/domain/build-runtime-scene.test.ts @@ -188,6 +188,7 @@ describe("buildRuntimeSceneFromDocument", () => { priority: 9, defaultActive: true, pathId: path.id, + railPlacementMode: "nearestToTarget", target: { kind: "entity", entityId: interactable.id @@ -209,6 +210,111 @@ describe("buildRuntimeSceneFromDocument", () => { ]); }); + it("builds mapped rail camera rigs into runtime entities", () => { + const interactable = createInteractableEntity({ + id: "entity-interactable-mapped-rail-anchor", + position: { + x: 2, + y: 1, + z: 2 + }, + prompt: "Anchor" + }); + const path = createScenePath({ + id: "path-camera-rail-mapped", + points: [ + { + id: "point-a", + position: { + x: 0, + y: 3, + z: 0 + } + }, + { + id: "point-b", + position: { + x: 10, + y: 3, + z: 0 + } + } + ] + }); + const cameraRig = createCameraRigEntity({ + id: "entity-camera-rig-rail-mapped", + rigType: "rail", + pathId: path.id, + railPlacementMode: "mapTargetBetweenPoints", + trackStartPoint: { + x: 0, + y: 1, + z: 2 + }, + trackEndPoint: { + x: 10, + y: 1, + z: 2 + }, + railStartProgress: 0.2, + railEndProgress: 0.8, + target: createCameraRigEntityTargetRef(interactable.id), + transitionMode: "blend", + transitionDurationSeconds: 0.5 + }); + + const runtimeScene = buildRuntimeSceneFromDocument({ + ...createEmptySceneDocument({ name: "Mapped Rail Camera Rig Runtime Scene" }), + paths: { + [path.id]: path + }, + entities: { + [interactable.id]: interactable, + [cameraRig.id]: cameraRig + } + }); + + expect(runtimeScene.entities.cameraRigs).toEqual([ + { + entityId: cameraRig.id, + rigType: "rail", + priority: 0, + defaultActive: true, + pathId: path.id, + railPlacementMode: "mapTargetBetweenPoints", + trackStartPoint: { + x: 0, + y: 1, + z: 2 + }, + trackEndPoint: { + x: 10, + y: 1, + z: 2 + }, + railStartProgress: 0.2, + railEndProgress: 0.8, + target: { + kind: "entity", + entityId: interactable.id + }, + targetOffset: { + x: 0, + y: 1.6, + z: 0 + }, + transitionMode: "blend", + transitionDurationSeconds: 0.5, + lookAround: { + enabled: true, + yawLimitDegrees: 12, + pitchLimitDegrees: 8, + recenterSpeed: 3.5 + } + } + ]); + }); + it("builds runtime brush data, colliders, and an authored player spawn from the document", () => { const brush = createBoxBrush({ id: "brush-room-floor",