Class Leap::RuntimeGizmos::RuntimeGizmoDrawer

class Leap.RuntimeGizmos.RuntimeGizmoDrawer

Public Functions

void BeginGuard ()

Begins a draw-guard. If any gizmos are drawn to this drawer an exception will be thrown at the end of the guard.

void EndGuard ()

Ends a draw-guard. If any gizmos were drawn to this drawer during the guard, an exception will be thrown.

void RelativeTo (Transform transform)

Causes all remaining gizmos drawing to be done in the local coordinate space of the given transform.

void PushMatrix ()

Saves the current gizmo matrix to the gizmo matrix stack.

void PopMatrix ()

Restores the current gizmo matrix from the gizmo matrix stack.

void ResetMatrixAndColorState ()

Resets the matrix to the identity matrix and the color to white.

void DrawMesh (Mesh mesh, Matrix4x4 matrix)

Draw a filled gizmo mesh using the given matrix transform.

void DrawMesh (Mesh mesh, Vector3 position, Quaternion rotation, Vector3 scale)

Draws a filled gizmo mesh at the given transform location.

void DrawWireMesh (Mesh mesh, Matrix4x4 matrix)

Draws a wire gizmo mesh using the given matrix transform.

void DrawWireMesh (Mesh mesh, Vector3 position, Quaternion rotation, Vector3 scale)

Draws a wire gizmo mesh at the given transform location.

void DrawLine (Vector3 a, Vector3 b)

Draws a gizmo line that connects the two positions.

void DrawCube (Vector3 position, Vector3 size)

Draws a filled gizmo cube at the given position with the given size.

void DrawWireCube (Vector3 position, Vector3 size)

Draws a wire gizmo cube at the given position with the given size.

void DrawSphere (Vector3 center, float radius)

Draws a filled gizmo sphere at the given position with the given radius.

void DrawWireSphere (Vector3 center, float radius, int numSegments = 32)

Draws a wire gizmo sphere at the given position with the given radius.

void DrawEllipsoid (Vector3 foci1, Vector3 foci2, float minorAxis)

Draws a wire ellipsoid gizmo with two specified foci and a specified minor axis length.

void DrawWireCapsule (Vector3 start, Vector3 end, float radius)

Draws a wire gizmo capsule at the given position, with the given start and end points and radius.

void DrawPosition (Vector3 pos, Color lerpColor, float lerpCoeff, float overrideScale = null)

Draws a simple XYZ-cross position gizmo at the target position, whose size is scaled relative to the main camera’s distance to the target position (for reliable visibility).

Or, if you provide an override scale, you can enforce a radius size for the gizmo.

You can also provide a color argument and lerp coefficient towards that color from the axes’ default colors (red, green, blue). Colors are lerped in HSV space.

void DrawPosition (Vector3 pos)

Draws a simple XYZ-cross position gizmo at the target position, whose size is scaled relative to the main camera’s distance to the target position (for reliable visibility).

Properties

Color color { get; set; }

Sets or gets the color for the gizmos that will be drawn next.

Matrix4x4 matrix { get; set; }

Sets or gets the matrix used to transform all gizmos.