Implement handling for third-person pointer lock release
This commit is contained in:
@@ -166,6 +166,7 @@ export interface RuntimeControllerContext {
|
|||||||
input: RuntimeTargetLookInput
|
input: RuntimeTargetLookInput
|
||||||
): RuntimeTargetLookInputResult;
|
): RuntimeTargetLookInputResult;
|
||||||
handleRuntimeTargetLookBoundaryReached?(): boolean;
|
handleRuntimeTargetLookBoundaryReached?(): boolean;
|
||||||
|
handleThirdPersonPointerLockReleased?(): boolean;
|
||||||
isCameraDrivenExternally(): boolean;
|
isCameraDrivenExternally(): boolean;
|
||||||
getCameraYawRadians(): number;
|
getCameraYawRadians(): number;
|
||||||
isInputSuspended(): boolean;
|
isInputSuspended(): boolean;
|
||||||
|
|||||||
@@ -952,6 +952,28 @@ export class RuntimeHost {
|
|||||||
this.clearActiveRuntimeTarget();
|
this.clearActiveRuntimeTarget();
|
||||||
return false;
|
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: () =>
|
isCameraDrivenExternally: () =>
|
||||||
this.resolveActiveRuntimeCameraRig() !== null ||
|
this.resolveActiveRuntimeCameraRig() !== null ||
|
||||||
this.resolveDialogueAttentionNpc() !== null,
|
this.resolveDialogueAttentionNpc() !== null,
|
||||||
|
|||||||
Reference in New Issue
Block a user