Implement resetSceneState in FirstPersonNavigationController

This commit is contained in:
2026-04-11 04:14:48 +02:00
parent 7081d54c82
commit b8d6e30f84

View File

@@ -96,6 +96,24 @@ export class FirstPersonNavigationController implements NavigationController {
this.context = null;
}
resetSceneState(): void {
this.pressedKeys.clear();
this.feetPosition = {
x: 0,
y: 0,
z: 0
};
this.yawRadians = 0;
this.pitchRadians = 0;
this.verticalVelocity = 0;
this.grounded = false;
this.locomotionState = "flying";
this.inWaterVolume = false;
this.inFogVolume = false;
this.pointerLocked = false;
this.initializedFromSpawn = false;
}
update(dt: number): void {
if (this.context === null) {
return;