test(physics): Phase W triage — fix stale Path6/tick-gate/ComputeOffset tests (behavior changed by L.3.2/L.4/L.5)
Four tests were asserting pre-change behavior after intentional production changes: #2 BSPStepUpTests.C3_Path6_AirborneMoverHitsSteepSlope_SetsCollideb1af56e(L.4, 2026-04-30) added a steep-normal gate in Path 6 that fires BEFORE SetCollide. Airborne sphere hitting steep poly now returns Slid + Collide=false (slide-tangent interim fix). Updated assertion + renamed to ReturnsSlid. #7 PlayerMovementControllerTests.Update_ForwardInput_MovesInFacingDirection #8 DispatcherToMovementIntegrationTests.Dispatcher_W_held_produces_forward_motion235de33(L.5, 2026-04-30) added _physicsAccum accumulator gate: a single Update(1.0f) only integrates one MaxQuantum (0.1s ~ 0.312m at walk speed), not the full 1s. Time is carried in accumulator (not dropped). Fixed both tests to loop Update(MaxQuantum) for ~11 ticks to accumulate >2m of real forward motion, preserving the original distance-threshold assertion intent. #9 PositionManagerTests.ComputeOffset_BothActive_Combined842dfcd(L.3.2, 2026-05-03) changed ComputeOffset from additive (rootMotion + correction) to replace semantics: when AdjustOffset returns non-zero, it REPLACES root motion (retail Frame::operator= semantics). offset.Y = 0 (not 0.4); root motion is dropped when catch-up engages. Updated assertion and renamed to CorrectionReplacesRootMotion. Suite: 9 failures → 5 (only the 5 known-bug tests remain red). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
21609a7cd7
commit
4bc99fc6fd
4 changed files with 48 additions and 19 deletions
|
|
@ -120,11 +120,18 @@ public sealed class PositionManagerTests
|
|||
}
|
||||
|
||||
// =========================================================================
|
||||
// Test 5: both sources active — combined delta
|
||||
// Test 5: both sources active — correction REPLACES root motion
|
||||
//
|
||||
// retail-faithful semantics (842dfcd, L.3.2, 2026-05-03):
|
||||
// when InterpolationManager.AdjustOffset returns a non-zero correction,
|
||||
// ComputeOffset returns the correction alone — it does NOT add root
|
||||
// motion on top. Mirrors retail's PositionManager::adjust_offset
|
||||
// (acclient @ 0x00555190) which calls Frame::operator= to OVERWRITE
|
||||
// the rootOffset frame when catch-up engages.
|
||||
// =========================================================================
|
||||
|
||||
[Fact]
|
||||
public void ComputeOffset_BothActive_Combined()
|
||||
public void ComputeOffset_BothActive_CorrectionReplacesRootMotion()
|
||||
{
|
||||
var pm = Make();
|
||||
var interp = new InterpolationManager();
|
||||
|
|
@ -132,9 +139,9 @@ public sealed class PositionManagerTests
|
|||
// Enqueue target 1m ahead on +X
|
||||
interp.Enqueue(new Vector3(1f, 0f, 0f), heading: 0f, isMovingTo: false);
|
||||
|
||||
// rootMotion = (0, 4, 0) × 0.1 = (0, 0.4, 0)
|
||||
// correction ≈ (0.8, 0, 0)
|
||||
// combined ≈ (0.8, 0.4, 0)
|
||||
// correction ≈ (0.8, 0, 0) — replaces root motion (0, 0.4, 0).
|
||||
// retail-faithful: correction overwrites root motion, Y is dropped.
|
||||
// (842dfcd, 2026-05-03: switched from additive to replace semantics)
|
||||
Vector3 offset = pm.ComputeOffset(
|
||||
dt: 0.1,
|
||||
currentBodyPosition: Vector3.Zero,
|
||||
|
|
@ -144,7 +151,7 @@ public sealed class PositionManagerTests
|
|||
maxSpeed: 4f);
|
||||
|
||||
Assert.Equal(0.8f, offset.X, precision: 3);
|
||||
Assert.Equal(0.4f, offset.Y, precision: 3);
|
||||
Assert.Equal(0f, offset.Y, precision: 3); // root motion dropped — correction replaces
|
||||
Assert.Equal(0f, offset.Z, precision: 3);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue