GravityField is now the band term U(eps, inner, outer) (C4 smoothstep fade, closed form and a series for tau > 1). WellTree is built once per Zone from the orbit tree: node terms, reach, support, the pruned Force/Potential walk and PullAround (rails). Zone.GetHeight/GetForce/PeriodAround delegate to it; WellReference, _wellOn, _strengths, Strength() and DrawAhead.Well are gone; GravityLowering and the shader template take the flat term list; HeightExaggeration halves to 2.0491803. Does not pass yet: Gravity.cginc is not regenerated and PotentialOwnerTests/OrbitsFromFieldTests still spell the old law. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.3 KiB
C#
23 lines
1.3 KiB
C#
using System;
|
|
using System.IO;
|
|
using Xunit;
|
|
|
|
// potential-owns-gravity (aetheria-gravity, cut grid-lowering): Assets/Shaders/Gravity.cginc is the output of
|
|
// GravityShader.Source(), which reads GravityField's constants and writes the one lowering of the potential, the
|
|
// band term's closed form and series, each term's reference and gravityHeight's sum. The committed file must equal it, character for
|
|
// character (line ends aside): any added statement, respelling, flipped sign, swapped argument or macro fails here.
|
|
// To change the shader, change GravityShader and run once with AETHERIA_REGENERATE_GRAVITY_CGINC=1.
|
|
public sealed class GravityShaderTests
|
|
{
|
|
[Fact]
|
|
public void TheCommittedShaderIsTheGeneratedOne()
|
|
{
|
|
var path = Path.Combine(RunStartTests.FindRepoRoot(), GravityShader.Path);
|
|
if (Environment.GetEnvironmentVariable("AETHERIA_REGENERATE_GRAVITY_CGINC") == "1")
|
|
File.WriteAllText(path, GravityShader.Source());
|
|
var generated = GravityShader.Source();
|
|
// The law was generated, not an empty template agreeing with an empty file.
|
|
Assert.Contains("static const float GravityS[8] = { 0, 0, 0, 0, 35, -84, 70, -20 };", generated);
|
|
Assert.Equal(generated, File.ReadAllText(path).Replace("\r\n", "\n"));
|
|
}
|
|
}
|