fix(physics): port retail slope landing stop
This commit is contained in:
parent
1d8371dbe5
commit
5a0f9868a6
13 changed files with 870 additions and 103 deletions
|
|
@ -1841,6 +1841,11 @@ public sealed class PlayerMovementController
|
|||
for (int qi = 0; qi < quantumBatch.Count; qi++)
|
||||
{
|
||||
float tickDt = quantumBatch.GetQuantum(qi);
|
||||
bool captureQuantum = PlayerPhysicsQuantumCapture.IsEnabled;
|
||||
uint captureCellBefore = CellId;
|
||||
PlayerPhysicsBodyTraceSnapshot captureQuantumStart = captureQuantum
|
||||
? PlayerPhysicsQuantumCapture.Snapshot(_body)
|
||||
: default;
|
||||
|
||||
// CPhysicsObj::UpdatePositionInternal (0x00512C30): visible objects
|
||||
// advance their PartArray first. The complete Frame survives; only its
|
||||
|
|
@ -1931,7 +1936,13 @@ public sealed class PlayerMovementController
|
|||
}
|
||||
|
||||
_body.calc_acceleration();
|
||||
PlayerPhysicsBodyTraceSnapshot capturePreIntegration = captureQuantum
|
||||
? PlayerPhysicsQuantumCapture.Snapshot(_body)
|
||||
: default;
|
||||
_body.UpdatePhysicsInternal(tickDt);
|
||||
PlayerPhysicsBodyTraceSnapshot capturePostIntegration = captureQuantum
|
||||
? PlayerPhysicsQuantumCapture.Snapshot(_body)
|
||||
: default;
|
||||
|
||||
// Retail process_hooks is the final UpdatePositionInternal step:
|
||||
// after physics, before the transition and manager tail.
|
||||
|
|
@ -2121,6 +2132,30 @@ public sealed class PlayerMovementController
|
|||
_motion.CheckForCompletedMotions,
|
||||
PositionManager);
|
||||
|
||||
if (captureQuantum)
|
||||
{
|
||||
PlayerPhysicsQuantumCapture.Log(
|
||||
tickDt,
|
||||
captureCellBefore,
|
||||
CellId,
|
||||
input,
|
||||
capturePreIntegration.Position - captureQuantumStart.Position,
|
||||
candidateMoved,
|
||||
captureQuantumStart,
|
||||
capturePreIntegration,
|
||||
capturePostIntegration,
|
||||
new PlayerPhysicsResolveTraceSnapshot(
|
||||
resolveResult.Position,
|
||||
resolveResult.CellId,
|
||||
resolveResult.Ok,
|
||||
resolveResult.IsOnGround,
|
||||
resolveResult.InContact,
|
||||
resolveResult.OnWalkable,
|
||||
resolveResult.CollisionNormalValid,
|
||||
resolveResult.CollisionNormal),
|
||||
PlayerPhysicsQuantumCapture.Snapshot(_body));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ── 4. Determine outbound motion commands ─────────────────────────────
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue