acdream/src/AcDream.Core/Physics
Erik 833d167ebc fix(scenery): #49 9×9 loop, per-spawn building check, triangle slope
Three fixes to match retail CLandBlock::get_land_scenes (0x00530460):

1. Loop bound: iterate 9×9 vertices (side_vertex_count=9), not 8×8
   cells. Edge vertices (x=8 or y=8) produce valid spawns when the
   per-object displacement shifts the position back into [0, 192).
   Confirmed by named retail decomp do-while condition, WorldBuilder
   vertLength=9, ACViewer Terrain.Count=81, AC2D wTopo[9][9].

2. Building suppression: check at the DISPLACED position's cell
   (CSortCell::has_building per spawn), not at the loop vertex index.
   Matches WorldBuilder buildingsGrid[gx2, gy2] pattern.

3. Slope filter: replace finite-difference gradient approximation
   with triangle-aware normal sampling via new static method
   TerrainSurface.SampleNormalZFromHeightmap. Picks the correct
   triangle via IsSplitSWtoNE, matching retail find_terrain_poly →
   polygon->plane.N.z and WorldBuilder's GetNormal().

Tests: 5 new tests for SampleNormalZFromHeightmap (flat=1.0, sloped<1,
cross-validates with SampleSurface instance method) and DisplaceObject
edge-vertex validity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 21:15:11 +02:00
..
AnimationCommandRouter.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
AnimationHookRouter.cs feat(anim): Phase E.1 hook router + GameWindow wiring 2026-04-18 16:30:23 +02:00
AnimationSequencer.cs diag(motion): #39 — per-tick [CURRNODE] for sequencer node identity 2026-05-06 08:17:56 +02:00
BSPQuery.cs feat(physics): #32 L.5 30Hz physics tick + retail debugger toolchain (#35) + Phase 3 retail-faithful kill_velocity 2026-04-30 22:41:12 +02:00
CellSurface.cs feat(core): Phase B.3 — CellSurface (indoor floor polygon projection) 2026-04-12 09:51:22 +02:00
CollisionExemption.cs feat(physics): retail PvP exemption + viewer/creature/missile gates (Commit C) 2026-04-29 13:21:36 +02:00
CollisionPrimitives.cs feat(physics): port 9 collision primitives from acclient.exe (chunk_00530000.c) 2026-04-12 23:53:47 +02:00
EntityCollisionFlags.cs feat(physics): live-entity collision plumbing (Commit A) 2026-04-29 13:12:56 +02:00
IAnimationHookSink.cs feat(anim): Phase E.1 hook router + GameWindow wiring 2026-04-18 16:30:23 +02:00
InterpolationManager.cs feat(motion): L.3 M1 — fresh InterpolationManager port + retail spec 2026-05-05 14:56:42 +02:00
MotionCommandResolver.cs feat(anim): Phase L.1c select combat maneuvers 2026-04-28 11:44:17 +02:00
MotionInterpreter.cs fix(motion): retail-faithful remote tick — clear body.Velocity, drive via seqVel 2026-05-03 16:23:57 +02:00
PhysicsBody.cs docs(physics): L.3c attempt — friction threshold investigation, deferred 2026-04-30 09:46:42 +02:00
PhysicsDataCache.cs test(physics): conformance fixtures for BSP step-up + roof-landing (Phase L.2.0) 2026-04-29 15:44:16 +02:00
PhysicsEngine.cs fix(motion): project anim root motion onto terrain plane (slope staircase) 2026-05-05 21:37:42 +02:00
PlayerWeenie.cs feat(physics): PlayerWeenie with retail Run/Jump formulas 2026-04-13 23:15:25 +02:00
PortalPlane.cs fix(core): Phase B.3 — add centroid + radius bounds to PortalPlane crossing test 2026-04-12 19:08:46 +02:00
PositionManager.cs fix(motion): project anim root motion onto terrain plane (slope staircase) 2026-05-05 21:37:42 +02:00
RemoteMoveToDriver.cs fix(anim): Phase L.1c clamp approach velocity to prevent overshoot 2026-04-29 10:14:35 +02:00
ResolveResult.cs feat(physics): L.3a — wall-bounce velocity reflection on airborne hits 2026-04-30 09:41:04 +02:00
ServerControlledLocomotion.cs fix(anim): Phase L.1c match MoveTo run speed 2026-04-28 20:58:22 +02:00
ShadowObjectRegistry.cs feat(physics): live-entity collision plumbing (Commit A) 2026-04-29 13:12:56 +02:00
TerrainSurface.cs fix(scenery): #49 9×9 loop, per-spawn building check, triangle slope 2026-05-07 21:15:11 +02:00
TransitionTypes.cs fix(physics): #42 skip self in FindObjCollisions — airborne XY drift 2026-05-05 19:01:07 +02:00