Vixen
02b45cc4
csharp
public readonly record struct GeometryKey

Which geometry an entity draws, as something a cache can be keyed by.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Two key spaces in one struct, because an entity draws an asset or a primitive and the cache should not care which. A MeshRenderable names a mesh by AssetReference; a PrimitiveShape names one of eight shapes the engine builds. Both resolve to a MeshData and both want one resident slice shared by every entity drawing them, so both need to be one dictionary key. Encoding a primitive as a synthetic asset id would work and would put eight made-up guids in every diagnostic that printed one.

Fields and properties (3)

  • public AssetReference Asset

    Which asset, or Null when this names a primitive.

  • public PrimitiveKind Primitive

    Which primitive, meaningful only when IsPrimitive.

  • public bool IsPrimitive

    Whether this names a built-in shape rather than an asset.

Methods (3)

  • public static GeometryKey Of(AssetReference asset)

    A key naming a mesh asset.

  • public static GeometryKey Of(PrimitiveKind primitive)

    A key naming a built-in shape.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (5)

  • GeometryResidencyVixen.Rendering
  • MeshExtractionSystemVixen.Rendering
  • MeshExtractionTestsVixen.Rendering.Tests
  • RenderHandleVixen.Rendering
  • WorldRendererTestsVixen.Engine.Renderer.Tests