acdream/tests/AcDream.Core.Tests/Physics
Erik ff6d3d0c94 fix(anim): Phase L.1c clamp approach velocity to prevent overshoot
User-observed residual after f794832: creature stops to attack but
still runs slightly through the player before stopping.

Cause: at 4 m/s body velocity (RunAnimSpeed × ~1.0 speedMod) and a
60 fps tick (~16 ms), the body advances ~6.4 cm per tick. When dist
falls just below the 0.6 m DistanceToObject arrival threshold, the
arrival predicate fires and zeroes velocity — but the body has
already advanced one full tick INTO the threshold zone. That last
tick is the "running through" the user sees, especially when
combined with a player visual radius of ~0.5 m.

Fix: cap horizontal velocity in the steering branch so the body lands
EXACTLY at the arrival threshold instead of overshooting it. Pure
function in RemoteMoveToDriver (ClampApproachVelocity) so it's
testable; called from GameWindow.cs after apply_current_movement
sets RunForward velocity from the active cycle.

The clamp is a strict scale-down of the X/Y components; Z is left
to gravity / terrain handling. No-op for the flee branch — fleeing
has no overshoot risk by definition.

Tests: 1416 → 1420. Four new clamp scenarios: exact-landing (FP
tolerance), would-overshoot scale-down, already-at-threshold zeroing,
flee no-op.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:14:35 +02:00
..
AnimationCommandRouterTests.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
AnimationHookRouterTests.cs feat(anim): Phase E.1 hook router + GameWindow wiring 2026-04-18 16:30:23 +02:00
AnimationSequencerTests.cs fix(anim): Phase L.1c route creature actions and despawns 2026-04-28 19:21:02 +02:00
BSPQueryTests.cs feat(physics): PhysicsDataCache + BSP sphere query 2026-04-13 23:28:39 +02:00
CellSurfaceTests.cs feat(core): Phase B.3 — CellSurface (indoor floor polygon projection) 2026-04-12 09:51:22 +02:00
CollisionPrimitivesTests.cs feat(physics): port 9 collision primitives from acclient.exe (chunk_00530000.c) 2026-04-12 23:53:47 +02:00
MotionCommandResolverTests.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
MotionInterpreterTests.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
PhysicsBodyTests.cs feat(core): port decompiled AC client physics — CollisionPrimitives + PhysicsBody 2026-04-12 23:54:51 +02:00
PhysicsEngineTests.cs feat(core): Phase B.3 — CellPortal-based indoor/outdoor transitions in PhysicsEngine 2026-04-12 18:22:55 +02:00
PlayerWeenieTests.cs feat(physics): PlayerWeenie with retail Run/Jump formulas 2026-04-13 23:15:25 +02:00
PortalPlaneTests.cs feat(core): Phase B.3 — PortalPlane (plane math + crossing detection) 2026-04-12 18:17:48 +02:00
RemoteMoveToDriverTests.cs fix(anim): Phase L.1c clamp approach velocity to prevent overshoot 2026-04-29 10:14:35 +02:00
ServerControlledLocomotionTests.cs fix(anim): Phase L.1c match MoveTo run speed 2026-04-28 20:58:22 +02:00
ShadowObjectRegistryTests.cs feat(physics): port full CTransition collision response from pseudocode 2026-04-14 11:17:45 +02:00
TerrainSurfaceTests.cs feat(core): Phase B.3 — TerrainSurface (outdoor heightmap Z + cell ID) 2026-04-12 09:51:54 +02:00
TransitionTests.cs feat(physics): Transition.FindTransitionalPosition core algorithm 2026-04-13 23:52:45 +02:00