GetHeight sums body wells only. Removes RadialWaves, GasGiant wave fields, GasGiantData keys 14-17, PlanetSettings Zone*/Wave* fields, the minimap gravity range, the Boundary brush and Gravity Waves objects from the scene and both prefabs. The five bowl fixtures become one WellFixture well at the origin with unchanged expected numbers. Not yet built or tested: this commit has not been through the Yggdrasil job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
1.2 KiB
C#
21 lines
1.2 KiB
C#
using CultMath;
|
|
using GameCult.Caching;
|
|
|
|
// The one fixture that gives a test zone a slope: a single body on a parentless orbit at the origin, with
|
|
// the curves a body needs. Gravity height is the sum of body wells, so a test that wants ground to slide on
|
|
// digs it here and nowhere else. `radius` is the zone radius the well is sized to (its well reaches 2 x radius,
|
|
// as the former bowl did); the well is deepest at the centre and zero at and beyond half its radius.
|
|
internal static class WellFixture
|
|
{
|
|
public static void Dig(CultCache cache, ZonePack pack, PlanetSettings settings, float radius, float depth, float exponent)
|
|
{
|
|
settings.BodyRadius = new ExponentialCurve();
|
|
settings.OrbitPeriod = new ExponentialCurve();
|
|
settings.GravityRadius = new ExponentialCurve { Constant = 2f * radius };
|
|
settings.GravityDepth = new ExponentialCurve { Constant = depth };
|
|
var orbit = cache.Upsert(new OrbitData { FixedPosition = float2.zero }).Key;
|
|
var body = cache.Upsert(new PlanetData { Orbit = new CultRecordRef<OrbitData>(orbit), GravityDepthExponent = exponent }).Key;
|
|
pack.Orbits.Add(new CultRecordRef<OrbitData>(orbit));
|
|
pack.Planets.Add(new CultRecordRef<BodyData>(body));
|
|
}
|
|
}
|