From e0c1ce76cab4117d980a4b259edd9072e6db58da Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 25 Apr 2026 16:54:25 +0200 Subject: [PATCH] Add unit test verifying vertical camera aim adjustment with target assist --- ...third-person-navigation-controller.test.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/unit/third-person-navigation-controller.test.ts b/tests/unit/third-person-navigation-controller.test.ts index ed9248c3..1ee4fdd4 100644 --- a/tests/unit/third-person-navigation-controller.test.ts +++ b/tests/unit/third-person-navigation-controller.test.ts @@ -213,6 +213,34 @@ describe("ThirdPersonNavigationController", () => { controller.deactivate(targetContext); }); + it("uses third-person target assist to adjust vertical camera aim", () => { + const { context } = createRuntimeControllerContext(); + const controller = new ThirdPersonNavigationController(); + const targetContext = { + ...context, + resolveThirdPersonTargetAssist: () => ({ + targetPosition: { + x: 0, + y: 4, + z: 5 + }, + strength: 1 + }) + }; + const cameraDirection = new Vector3(); + + controller.activate(targetContext); + targetContext.camera.getWorldDirection(cameraDirection); + const initialForwardY = cameraDirection.y; + + controller.update(1); + targetContext.camera.getWorldDirection(cameraDirection); + + expect(cameraDirection.y).toBeGreaterThan(initialForwardY); + + controller.deactivate(targetContext); + }); + it("uses the authored movement template speed for third-person motion telemetry", () => { const playerStart = createPlayerStartEntity({