acdream/tests/AcDream.Core.Tests/Physics
Erik 91b29d1a89 fix(physics): route indoor walkable-plane synthesis through retail BSP walker
TryFindIndoorWalkablePlane (Phase 2 commit eb0f772) used a linear
first-match XY scan of cellPhysics.Resolved with no Z-proximity test.
For any cell with two walkable polys overlapping in XY at different Z
(cellars, 2nd floors, balconies, stairs spanning floors), it returned
whichever polygon came first in dictionary order — typically the upper
floor when descending, causing the player to be reported below the
synthesized plane → ValidateWalkable fails → falling-stuck. Symptoms
reported by user 2026-05-19: cannot descend into cellar; cannot walk
on 2nd floor; "invisible obstacles at certain spots" (suspected
cascade from wrong-Z ContactPlane misrouting the resolver state).

Fix: route through BSPQuery.FindWalkableSphere (added previous commit),
which wraps the existing retail-faithful FindWalkableInternal
(BSPNODE::find_walkable + BSPLEAF::find_walkable port). Adds a
sphereRadius parameter to TryFindIndoorWalkablePlane so the foot
sphere is built with the actual entity radius rather than a guess.
WalkableAllowance is save/restored via try/finally so the slope
threshold used by walkable_hits_sphere doesn't leak back to the
resolver. Method becomes an instance method (was static) to access
this.SpherePath.

Deletes the now-dead PointInPolygonXY helper.

Updates IndoorWalkablePlaneTests.cs: all TryFindIndoorWalkablePlane
test fixtures now include a PhysicsBSPTree leaf node (required by
the new routing path), calls pass sphereRadius, and the PointInPolygonXY
tests are removed (method deleted). Adds TransitionTypesTests.cs with
an integration test covering two-overlapping-floors selection AND
WalkableAllowance preservation.

Closes (pending visual verification): ISSUES #83.
Spec: docs/superpowers/specs/2026-05-19-indoor-walkable-plane-bsp-port-design.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 21:47:49 +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(animation): close #61 + smooth stop from backward/sidestep-left/turn-left 2026-05-18 15:16:20 +02:00
BSPQueryTests.cs fix(physics): tighten FindWalkableSphere test assertions + header 2026-05-19 21:41:13 +02:00
BSPStepUpFixtures.cs feat(physics): Phase L.2.1+L.2.2 — BSP step-up and rooftop landing 2026-04-29 16:16:39 +02:00
BSPStepUpTests.cs fix(physics): L.4 — steep airborne hits slide-tangent (interim, deviates from retail) 2026-04-30 13:22:07 +02:00
CellPhysicsPortalWiringTests.cs feat(physics): Phase 2 — wire CellBSP + Portals into CellPhysics 2026-05-19 16:52:20 +02:00
CellSurfaceTests.cs feat(core): Phase B.3 — CellSurface (indoor floor polygon projection) 2026-04-12 09:51:22 +02:00
CellTransitAddAllOutsideCellsTests.cs feat(physics): Phase 2 — port CellTransit + wire into ResolveCellId 2026-05-19 17:14:04 +02:00
CellTransitCheckBuildingTransitTests.cs refactor(physics): Phase 2 — code-review polish on BuildingPhysics commit 2026-05-19 18:01:44 +02:00
CellTransitFindCellListTests.cs feat(physics): Phase 2 — BuildingPhysics + CheckBuildingTransit 2026-05-19 17:34:38 +02:00
CellTransitFindTransitCellsSphereTests.cs feat(physics): Phase 2 — port CellTransit + wire into ResolveCellId 2026-05-19 17:14:04 +02:00
CollisionExemptionTests.cs fix(phys L.2g slice 1b): widen CollisionExemption to ETHEREAL alone 2026-05-13 18:27:06 +02:00
CollisionPrimitivesTests.cs feat(physics): port 9 collision primitives from acclient.exe (chunk_00530000.c) 2026-04-12 23:53:47 +02:00
EntityCollisionFlagsTests.cs feat(physics): live-entity collision plumbing (Commit A) 2026-04-29 13:12:56 +02:00
IndoorWalkablePlaneTests.cs fix(physics): route indoor walkable-plane synthesis through retail BSP walker 2026-05-19 21:47:49 +02:00
InterpolationManagerTests.cs feat(motion): L.3 M1 — fresh InterpolationManager port + retail spec 2026-05-05 14:56:42 +02:00
MotionCommandResolverTests.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
MotionInterpreterTests.cs test(physics): MyRunRate fallback test for GetMaxSpeed (L.3.1 Task 2 polish) 2026-05-02 19:20:39 +02:00
PhysicsBodyTests.cs feat(core): port decompiled AC client physics — CollisionPrimitives + PhysicsBody 2026-04-12 23:54:51 +02:00
PhysicsDiagnosticsTests.cs feat(phys L.2d slice 1): BSP-hit diagnostic probe + plan-of-record correction 2026-05-12 19:14:34 +02:00
PhysicsEngineTests.cs fix(physics): Cluster A #84 + #85 — indoor cell tracking 2026-05-19 15:20:36 +02:00
PlayerWeenieTests.cs feat(physics): PlayerWeenie with retail Run/Jump formulas 2026-04-13 23:15:25 +02:00
PortalInfoTests.cs feat(physics): Phase 2 — wire CellBSP + Portals into CellPhysics 2026-05-19 16:52:20 +02:00
PortalPlaneTests.cs feat(core): Phase B.3 — PortalPlane (plane math + crossing detection) 2026-04-12 18:17:48 +02:00
PositionManagerTests.cs fix(motion): project anim root motion onto terrain plane (slope staircase) 2026-05-05 21:37:42 +02:00
RemoteMoveToDriverTests.cs fix(retail): rotation rate, useability gate, retail toast strings 2026-05-16 12:17:54 +02:00
ResolveCellIdTests.cs feat(physics): Phase 2 — BuildingPhysics + CheckBuildingTransit 2026-05-19 17:34:38 +02:00
ServerControlledLocomotionTests.cs fix(anim): Phase L.1c match MoveTo run speed 2026-04-28 20:58:22 +02:00
ShadowObjectRegistryTests.cs feat(phys L.2g slice 1): ShadowObjectRegistry.UpdatePhysicsState 2026-05-12 22:22:32 +02:00
TerrainSurfaceTests.cs fix(scenery): #49 9×9 loop, per-spawn building check, triangle slope 2026-05-07 21:15:11 +02:00
TransitionTests.cs feat(physics): Transition.FindTransitionalPosition core algorithm 2026-04-13 23:52:45 +02:00
TransitionTypesTests.cs fix(physics): route indoor walkable-plane synthesis through retail BSP walker 2026-05-19 21:47:49 +02:00