Vixen
02b45cc4
csharp
public readonly record struct TerrainSplineProfile

How a spline shapes the ground either side of it.

Read the guide page for this →

Remarks

[docs/plan/31 § T8]'s road profile. A flat carriageway of HalfWidth metres either side, then a cosine shoulder that blends into whatever the ground was doing.

⚠ Left and right are independent, and that is not symmetry for its own sake. A road cut into a hillside has a cutting on the uphill side and an embankment on the downhill one, and they are different widths. A single falloff makes every road look like it was laid on a plain.

⚠ A cosine and not a linear ramp. A linear shoulder meets the untouched ground at a crease, which catches the light along the whole length of the road — a cosine's derivative is zero at both ends, so the shoulder leaves and arrives flat.

Fields and properties (7)

  • public float HalfWidth

    How far the flat carriageway reaches either side of the curve, in metres.

  • public float FalloffLeft

    How far the shoulder reaches past that on the left, in metres.

  • public float FalloffRight

    And on the right.

  • public float Strength

    How much of the way to the curve's own height the ground is moved, 0…1.

  • public float Depth

    How far below the curve the carriageway sits, in metres.

  • public static TerrainSplineProfile Road

    A road: three metres of carriageway and four of shoulder either side.

  • public float Reach

    The furthest the profile reaches from the curve, in metres.

Methods (2)

  • public float WeightAt(float offset)

    How much the profile moves the ground at a signed distance from the curve.

  • public string? Validate()

    Why this profile cannot be applied, or if it can.

Used by (4)

  • TerrainSplineVixen.Terrain
  • TerrainSplineTestsVixen.Terrain.Tests
  • TerrainPanelTestsVixen.Editor.App.Tests
  • TerrainSplineSettingsVixen.Editor.Terrain