Refactor pointer capture logic and remove third-person pointer lock target clearing

This commit is contained in:
2026-04-27 18:21:18 +02:00
parent a864a79c15
commit eb7b27e05b
3 changed files with 4 additions and 68 deletions

View File

@@ -969,22 +969,8 @@ export class RuntimeHost {
this.runtimeMessageHandler?.(message);
},
setPlayerControllerTelemetry: (telemetry) => {
const pointerLockReleasedFromThirdPerson =
this.currentPlayerControllerTelemetry?.pointerLocked === true &&
telemetry !== null &&
telemetry.pointerLocked === false &&
this.activeController === this.thirdPersonController &&
this.activeRuntimeTargetReference !== null &&
this.resolveRuntimePlayerInputBindings().keyboard.clearTarget ===
"Escape";
this.currentPlayerControllerTelemetry = telemetry;
this.currentPlayerAudioHooks = telemetry?.hooks.audio ?? null;
if (pointerLockReleasedFromThirdPerson) {
this.clearActiveRuntimeTarget();
}
this.playerControllerTelemetryHandler?.(telemetry);
}
};