Implement handling for third-person pointer lock release
This commit is contained in:
@@ -166,6 +166,7 @@ export interface RuntimeControllerContext {
|
||||
input: RuntimeTargetLookInput
|
||||
): RuntimeTargetLookInputResult;
|
||||
handleRuntimeTargetLookBoundaryReached?(): boolean;
|
||||
handleThirdPersonPointerLockReleased?(): boolean;
|
||||
isCameraDrivenExternally(): boolean;
|
||||
getCameraYawRadians(): number;
|
||||
isInputSuspended(): boolean;
|
||||
|
||||
@@ -952,6 +952,28 @@ export class RuntimeHost {
|
||||
this.clearActiveRuntimeTarget();
|
||||
return false;
|
||||
},
|
||||
handleThirdPersonPointerLockReleased: () => {
|
||||
if (
|
||||
this.activeController !== this.thirdPersonController ||
|
||||
this.activeRuntimeTargetReference === null
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const clearTargetKeyboardBinding =
|
||||
this.resolveRuntimePlayerInputBindings().keyboard.clearTarget;
|
||||
|
||||
if (
|
||||
isPlayerStartMouseBindingCode(clearTargetKeyboardBinding) ||
|
||||
clearTargetKeyboardBinding !== "Escape"
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.clearActiveRuntimeTarget();
|
||||
this.previousClearTargetInputActive = true;
|
||||
return true;
|
||||
},
|
||||
isCameraDrivenExternally: () =>
|
||||
this.resolveActiveRuntimeCameraRig() !== null ||
|
||||
this.resolveDialogueAttentionNpc() !== null,
|
||||
|
||||
Reference in New Issue
Block a user