Vixen
02b45cc4
csharp
public readonly record struct FoliageSurface

What the ground is at a candidate position.

Read the guide page for this →

Remarks

⚠ A record rather than an interface call per field, because a probe is a raycast. Asking separately for the height, then the normal, then the weight would be three casts down the same ray, and the middle one is the expensive part.

Fields and properties (6)

  • public Vector3 Position

    Where the surface is, in world space.

  • public Vector3 Normal

    Which way it faces.

  • public float Weight

    How much of the type's filtered layer is painted there, 0…1, or 1 where nothing filters.

  • public bool Hit

    Whether there was a surface at all.

  • public static FoliageSurface Missed

    Nothing under the ray.

  • public float Slope

    The slope, in radians from flat.

Methods (1)

  • public FoliageSurface(Vector3 Position, Vector3 Normal, float Weight, bool Hit)

    What the ground is at a candidate position.

Used by (13)

  • FlatVixen.Rendering.Terrain.Tests
  • FlatVixen.Rendering.Terrain.Tests
  • FoliageGrowthVixen.Foliage
  • FoliageScatterVixen.Foliage
  • FoliageScatterTestsVixen.Foliage.Tests
  • GrassScatterVixen.Foliage
  • GroundVixen.Foliage.Tests
  • IFoliageSurfaceVixen.Foliage
  • MeadowVixen.Rendering.Terrain.Tests
  • TerrainSurfaceVixen.Rendering.Terrain
  • TerrainSurfaceTestsVixen.Rendering.Terrain.Tests
  • FoliageEditVixen.Editor.Terrain
  • MeadowVixen.Editor.Terrain.Tests