Refactor player start settings: remove mouse camera inversion and update first-person pointer lock logic

This commit is contained in:
2026-04-27 18:14:41 +02:00
parent d62259aaa3
commit 927482a15c
9 changed files with 15 additions and 226 deletions

View File

@@ -510,25 +510,23 @@ export class FirstPersonNavigationController implements NavigationController {
};
private handleMouseMove = (event: MouseEvent) => {
const context = this.context;
if (
!this.pointerLocked ||
context?.isInputSuspended() === true ||
context?.isCameraDrivenExternally() === true ||
context === null
this.context?.isInputSuspended() === true ||
this.context?.isCameraDrivenExternally() === true
) {
return;
}
const horizontalMouseLookSign =
context.getRuntimeScene().playerStart?.invertMouseCameraHorizontal === true
this.context.getRuntimeScene().playerStart?.invertMouseCameraHorizontal ===
true
? -1
: 1;
const horizontalMovement = event.movementX * horizontalMouseLookSign;
const targetLookResult =
context.handleRuntimeTargetLookInput?.({
this.context?.handleRuntimeTargetLookInput?.({
horizontal: horizontalMovement,
vertical: -event.movementY
}) ?? null;