Implement target lock release upon prolonged occlusion
This commit is contained in:
@@ -5945,7 +5945,7 @@ export class RuntimeHost {
|
||||
return false;
|
||||
}
|
||||
|
||||
private updateActiveRuntimeTargetLockState() {
|
||||
private updateActiveRuntimeTargetLockState(dt = 0) {
|
||||
if (
|
||||
this.activeRuntimeTargetReference === null ||
|
||||
this.currentPlayerControllerTelemetry === null ||
|
||||
@@ -5961,6 +5961,20 @@ export class RuntimeHost {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isRuntimeTargetCameraVisible(activeTarget)) {
|
||||
this.activeRuntimeTargetOcclusionSeconds = 0;
|
||||
} else {
|
||||
this.activeRuntimeTargetOcclusionSeconds += Math.max(0, dt);
|
||||
|
||||
if (
|
||||
this.activeRuntimeTargetOcclusionSeconds >=
|
||||
TARGETING_ACTIVE_OCCLUSION_GRACE_SECONDS
|
||||
) {
|
||||
this.setActiveRuntimeTargetReference(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
distanceBetweenPoints(
|
||||
this.currentPlayerControllerTelemetry.eyePosition,
|
||||
|
||||
Reference in New Issue
Block a user