Vixen
02b45cc4
csharp
public readonly record struct MeshInstanceView

The camera a frame's instances are drawn from.

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

Remarks

⚠ The camera is here because the selection outline needs it per vertex. An inverted hull is the object's own geometry pushed outwards across the view by a width measured in pixels, which is a different world distance at every vertex and in every projection. The host used to have every vertex in hand and could do that arithmetic itself; a path that uploads geometry once cannot, so what crosses the boundary is the four numbers the arithmetic is made of.

Fields and properties (6)

  • public Matrix4x4 ViewProjection

    The world-to-clip matrix.

  • public Vector3 Position

    Where the camera is.

  • public Vector3 Forward

    Which way it looks. Expected to be unit length.

  • public float NearPlane

    Its near plane, which floors the depth the pixel scale is taken at.

  • public bool Orthographic

    Whether the projection is orthographic.

  • public float PixelScale

    How many world units a render pixel is: the whole answer for an orthographic view, and the factor a perspective one is linear in depth by. See WorldPerPixel.

Methods (2)

  • public MeshInstanceView(Matrix4x4 ViewProjection, Vector3 Position, Vector3 Forward, float NearPlane, bool Orthographic, float PixelScale)

    The camera a frame's instances are drawn from.

  • public float WorldPerPixel(Vector3 at)

    How many world units a render pixel is at a point.

Used by (4)

  • FixtureVixen.Rendering.Tests
  • MeshInstanceRendererVixen.Rendering
  • ScenePresenterVixen.Editor.App
  • ViewportStateTestsVixen.Editor.SceneView.Tests