Vixen
02b45cc4
csharp
public sealed class GizmoDraw

Where a gizmo puts its lines.

Read the guide page for this →

Remarks

A writer over the viewport's depth-tested line list. Everything here ends up in the same buffer and the same draw call as the grid, the markers and the light shapes — a gizmo is not a rendering path, it is more vertices in the one that exists.

⚠ Segments and not shapes, because the renderer has no shapes. A ring is a fan of short lines and a sphere is three rings; there is no circle primitive underneath and pretending otherwise would mean a gizmo author discovering the tessellation themselves. The helpers here are the ones SceneLines already wrote for the light shapes, made public — a contributed gizmo and a built-in one draw with the same vocabulary or the built-ins are a privileged tier.

Fields and properties (2)

  • public const int Segments

    How many segments a full turn of a ring is drawn with.

  • public int Count

    How many vertices have been written.

Methods (6)

  • public GizmoDraw(List<LineVertex> lines)

    Writes into a list of line vertices.

  • public void Line(Vector3 from, Vector3 to, Color4 colour)

    One segment.

  • public void Ring(Vector3 centre, Vector3 first, Vector3 second, float radius, Color4 colour)

    A circle, in the plane two directions span.

  • public void Sphere(Vector3 centre, float radius, Color4 colour)

    Three rings in the three axis planes, which reads as a sphere.

  • public void Box(Vector3 centre, Vector3 right, Vector3 up, Vector3 forward, Vector3 extents, Color4 colour)

    A wireframe box in an entity's own axes.

  • public void Cross(Vector3 origin, float arm, Color4 colour)

    A three-axis cross, which is what an entity with no shape is drawn as.

Used by (5)

  • ComponentGizmoTestsVixen.Editor.SceneView.Tests
  • ComponentGizmosVixen.Editor.SceneView
  • DeclaredContributionTestsVixen.Editor.App.Tests
  • DeclaredContributionsVixen.Editor.App
  • SpyVixen.Editor.SceneView.Tests