From 26e86baf9845e7a48c9f39afb1622a80f3722509 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 11 Apr 2026 12:19:46 +0200 Subject: [PATCH] Update FirstPersonNavigationController context and resolveFirstPersonMotion type --- .../first-person-navigation-controller.test.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/unit/first-person-navigation-controller.test.ts b/tests/unit/first-person-navigation-controller.test.ts index d6fb0be3..7f2434f8 100644 --- a/tests/unit/first-person-navigation-controller.test.ts +++ b/tests/unit/first-person-navigation-controller.test.ts @@ -4,6 +4,10 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import type { Vec3 } from "../../src/core/vector"; import { createEmptySceneDocument } from "../../src/document/scene-document"; import { createPlayerStartEntity } from "../../src/entities/entity-instances"; +import type { + FirstPersonPlayerShape, + ResolvedPlayerMotion +} from "../../src/runtime-three/player-collision"; import { buildRuntimeSceneFromDocument } from "../../src/runtime-three/runtime-scene-build"; import { FirstPersonNavigationController } from "../../src/runtime-three/first-person-navigation-controller"; @@ -35,7 +39,7 @@ function createRuntimeControllerContext( resolveFirstPersonMotion: ( feetPosition: Vec3, motion: Vec3 - ) => { feetPosition: Vec3; grounded: boolean } | null = () => null + ) => ResolvedPlayerMotion | null = () => null ) { const runtimeScene = buildRuntimeSceneFromDocument( { @@ -59,7 +63,7 @@ function createRuntimeControllerContext( resolveFirstPersonMotion: ( feetPosition: Vec3, motion: Vec3, - _shape + _shape: FirstPersonPlayerShape ) => resolveFirstPersonMotion(feetPosition, motion), resolvePlayerVolumeState: () => ({ inWater: false, @@ -146,7 +150,12 @@ describe("FirstPersonNavigationController", () => { y: feetPosition.y + motion.y, z: feetPosition.z + motion.z }, - grounded: false + grounded: false, + collidedAxes: { + x: false, + y: false, + z: false + } }) ); const controller = new FirstPersonNavigationController();