fix(app): multi-point Z sampling + never-cull player landblock
1. Slope clipping: replaced single foot-forward Z sample with 4-point sampling (forward, back, left, right at 0.7 units). Takes the max Z across all samples so both uphill and downhill slopes keep feet above the terrain mesh surface. Removed the +0.1 Z bias entirely. 2. Player culling: replaced per-entity scan (alwaysVisibleEntityId) with per-landblock skip (neverCullLandblockId). The player's current landblock is computed from _playerController.Position and passed to the renderer. Simpler, faster, and more reliable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6f05c298cf
commit
a3b389603d
4 changed files with 42 additions and 40 deletions
|
|
@ -137,7 +137,7 @@ public class PlayerMovementControllerTests
|
|||
|
||||
Assert.False(controller.IsAirborne, "Should have landed");
|
||||
// +0.15 Z bias keeps feet above terrain surface (prevents z-fighting).
|
||||
Assert.Equal(50.1f, controller.Position.Z, precision: 1);
|
||||
Assert.Equal(50f, controller.Position.Z, precision: 1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -177,6 +177,6 @@ public class PlayerMovementControllerTests
|
|||
controller.Update(0.05f, new MovementInput(Forward: true));
|
||||
|
||||
Assert.False(controller.IsAirborne, "Player should have landed");
|
||||
Assert.Equal(20.1f, controller.Position.Z, precision: 1);
|
||||
Assert.Equal(20f, controller.Position.Z, precision: 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue