Add previous planar displacement tracking in ThirdPersonNavigationController

This commit is contained in:
2026-04-11 21:44:10 +02:00
parent a37553225b
commit 852cef56ac

View File

@@ -124,6 +124,11 @@ export class ThirdPersonNavigationController implements NavigationController {
private previousTelemetry: PlayerControllerTelemetry | null = null;
private latestJumpStarted = false;
private latestHeadBump = false;
private previousPlanarDisplacement = {
x: 0,
y: 0,
z: 0
};
private jumpBufferRemainingMs = 0;
private coyoteTimeRemainingMs = 0;
private jumpHoldRemainingMs = 0;
@@ -194,6 +199,11 @@ export class ThirdPersonNavigationController implements NavigationController {
this.jumpPressed = false;
this.latestJumpStarted = false;
this.latestHeadBump = false;
this.previousPlanarDisplacement = {
x: 0,
y: 0,
z: 0
};
this.jumpBufferRemainingMs = 0;
this.coyoteTimeRemainingMs = 0;
this.jumpHoldRemainingMs = 0;
@@ -233,6 +243,11 @@ export class ThirdPersonNavigationController implements NavigationController {
this.previousTelemetry = null;
this.latestJumpStarted = false;
this.latestHeadBump = false;
this.previousPlanarDisplacement = {
x: 0,
y: 0,
z: 0
};
this.jumpBufferRemainingMs = 0;
this.coyoteTimeRemainingMs = 0;
this.jumpHoldRemainingMs = 0;
@@ -271,6 +286,7 @@ export class ThirdPersonNavigationController implements NavigationController {
standingShape: this.standingPlayerShape,
verticalVelocity: this.verticalVelocity,
previousLocomotionState: this.locomotionState,
previousPlanarDisplacement: this.previousPlanarDisplacement,
jumpBufferRemainingMs: this.jumpBufferRemainingMs,
coyoteTimeRemainingMs: this.coyoteTimeRemainingMs,
jumpHoldRemainingMs: this.jumpHoldRemainingMs,
@@ -314,6 +330,7 @@ export class ThirdPersonNavigationController implements NavigationController {
this.latestJumpStarted = locomotionStep.jumpStarted;
this.latestHeadBump = locomotionStep.headBump;
this.locomotionState = locomotionStep.locomotionState;
this.previousPlanarDisplacement = locomotionStep.planarDisplacement;
this.grounded = locomotionStep.locomotionState.grounded;
this.inWaterVolume = locomotionStep.inWaterVolume;
this.inFogVolume = locomotionStep.inFogVolume;
@@ -356,6 +373,11 @@ export class ThirdPersonNavigationController implements NavigationController {
this.previousTelemetry = null;
this.latestJumpStarted = false;
this.latestHeadBump = false;
this.previousPlanarDisplacement = {
x: 0,
y: 0,
z: 0
};
this.jumpBufferRemainingMs = 0;
this.coyoteTimeRemainingMs = 0;
this.jumpHoldRemainingMs = 0;