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
|
|
@ -483,6 +483,54 @@ public class BSPStepUpTests
|
|||
"wall (failed step-up should preserve LastKnownContactPlane).");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Campaign P #269: retail validate_transition calls kill_velocity before
|
||||
/// restoring a last-known contact plane on a non-OK collision recovery.
|
||||
/// This is the post-landing stop mechanism when the 5% reflect points away
|
||||
/// from a slope but the next tangential sweep collides with it again.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void D1b_LastKnownPlaneCollisionRecovery_KillsVelocity()
|
||||
{
|
||||
var (root, resolved) = BSPStepUpFixtures.TallWall();
|
||||
var transition = BSPStepUpFixtures.MakeGroundedTransition(
|
||||
from: new Vector3(0.1f, 0f, 0f),
|
||||
to: new Vector3(0.6f, 0f, 0f),
|
||||
stepUpHeight: 0.04f);
|
||||
var engine = MakeTestEngine(root, resolved, terrainZ: 0f);
|
||||
|
||||
transition.FindTransitionalPosition(engine);
|
||||
|
||||
Assert.True(
|
||||
transition.ObjectInfo.VelocityKilled,
|
||||
"Retail OBJECTINFO::kill_velocity must run before restoring the " +
|
||||
"remembered floor after a collision/slide retry.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The same remembered plane must not kill velocity or re-ground a clean
|
||||
/// accepted move away from it. Retail consumes LastKnownContactPlane only
|
||||
/// inside validate_transition's non-OK recovery branch.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void D1c_LastKnownPlaneCleanAdvance_DoesNotKillOrReground()
|
||||
{
|
||||
var (root, resolved) = BSPStepUpFixtures.TallWall();
|
||||
var transition = BSPStepUpFixtures.MakeAirborneTransition(
|
||||
from: new Vector3(-2f, 0f, 2f),
|
||||
to: new Vector3(-2f, 0f, 2.25f));
|
||||
transition.CollisionInfo.LastKnownContactPlane = new Plane(Vector3.UnitZ, -1.52f);
|
||||
transition.CollisionInfo.LastKnownContactPlaneValid = true;
|
||||
var engine = MakeTestEngine(root, resolved, terrainZ: -50f);
|
||||
|
||||
transition.FindTransitionalPosition(engine);
|
||||
|
||||
Assert.False(transition.ObjectInfo.VelocityKilled);
|
||||
Assert.False(transition.CollisionInfo.ContactPlaneValid);
|
||||
Assert.False(transition.CollisionInfo.LastKnownContactPlaneValid);
|
||||
Assert.False(transition.ObjectInfo.OnWalkable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// L.2.3b regression: Path 5 dispatch must be guarded against re-entry while
|
||||
/// a step-up is already in progress. Test runs <c>FindTransitionalPosition</c>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue