Enhance pointer lock handling and material resolution in runtime scene build

This commit is contained in:
2026-03-31 03:04:44 +02:00
parent b672ba9b10
commit ce846a3464
2 changed files with 25 additions and 8 deletions

View File

@@ -219,9 +219,12 @@ export class FirstPersonNavigationController implements NavigationController {
return;
}
const pointerLockResult = this.context.domElement.requestPointerLock();
const pointerLockCapableElement = this.context.domElement as HTMLCanvasElement & {
requestPointerLock(): void | Promise<void>;
};
const pointerLockResult = pointerLockCapableElement.requestPointerLock();
if (pointerLockResult !== undefined && "catch" in pointerLockResult) {
if (pointerLockResult instanceof Promise) {
pointerLockResult.catch(() => {
this.context?.setRuntimeMessage(
"Pointer lock request was denied. Click again or use Orbit Visitor for non-locked navigation."