Cut 1: 1536m desert relief, terrain/cover LOS detection, tier positioning, 3P shoulder cam
This commit is contained in:
parent
3bd66c3b64
commit
3221ca1d0c
19 changed files with 1558 additions and 316 deletions
|
|
@ -59,7 +59,7 @@ public partial class Smoke : Node
|
|||
Check(Engine.PhysicsTicksPerSecond == 60, $"Expected 60 physics ticks/sec, got {Engine.PhysicsTicksPerSecond}");
|
||||
Check((string)ProjectSettings.GetSetting("physics/3d/physics_engine") == "Dummy", "Godot 3D physics_engine is not Dummy");
|
||||
Check(!_main.GetWorld3D().Space.IsValid, "Godot should have no active 3D physics space");
|
||||
Check(_main.Terrain.BakedTileCount == 16, $"Expected 16 baked terrain tiles, got {_main.Terrain.BakedTileCount}");
|
||||
Check(_main.Terrain.BakedTileCount == 64, $"Expected 64 baked terrain tiles, got {_main.Terrain.BakedTileCount}");
|
||||
|
||||
var player = _main.Session.State.Player;
|
||||
float startX = player.X;
|
||||
|
|
@ -97,11 +97,11 @@ public partial class Smoke : Node
|
|||
|
||||
bool isHeadless = DisplayServer.GetName() == "headless";
|
||||
int rebakesBefore = _main.Terrain.DirtyRebakes;
|
||||
float cpuBefore = _main.Session.State.Terrain.SampleHeight(-48f, -48f);
|
||||
float cpuBefore = _main.Session.State.Terrain.SampleHeight(-96f, -96f);
|
||||
float gpuBefore = 0f;
|
||||
if (!isHeadless)
|
||||
{
|
||||
bool hasGpuBefore = _main.Terrain.TrySampleBakedHeight(-48f, -48f, out gpuBefore);
|
||||
bool hasGpuBefore = _main.Terrain.TrySampleBakedHeight(-96f, -96f, out gpuBefore);
|
||||
Check(hasGpuBefore, "Expected GPU HeightViewport readback to succeed before crater");
|
||||
if (hasGpuBefore)
|
||||
{
|
||||
|
|
@ -110,12 +110,12 @@ public partial class Smoke : Node
|
|||
}
|
||||
}
|
||||
|
||||
_main.Session.State.Terrain.StampCrater(-48f, -48f, radius: 5f, depth: 1.4f);
|
||||
_main.Session.State.Terrain.StampCrater(-96f, -96f, radius: 5f, depth: 1.4f);
|
||||
_main.Terrain.Sync(_main.Session.State.Terrain);
|
||||
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
|
||||
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
|
||||
|
||||
float cpuAfter = _main.Session.State.Terrain.SampleHeight(-48f, -48f);
|
||||
float cpuAfter = _main.Session.State.Terrain.SampleHeight(-96f, -96f);
|
||||
Check(cpuAfter < cpuBefore - 0.8f,
|
||||
$"Expected CPU terrain height to drop after crater stamp (before {cpuBefore:F2}m, after {cpuAfter:F2}m)");
|
||||
Check(_main.Terrain.DirtyRebakes == rebakesBefore + 1,
|
||||
|
|
@ -123,7 +123,7 @@ public partial class Smoke : Node
|
|||
|
||||
if (!isHeadless)
|
||||
{
|
||||
bool hasGpuAfter = _main.Terrain.TrySampleBakedHeight(-48f, -48f, out float gpuAfter);
|
||||
bool hasGpuAfter = _main.Terrain.TrySampleBakedHeight(-96f, -96f, out float gpuAfter);
|
||||
Check(hasGpuAfter, "Expected GPU HeightViewport readback to succeed after crater");
|
||||
if (hasGpuAfter)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue