Tanoda
Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer Class Reference

Public Member 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. More...
 
void EndGuard ()
 Ends a draw-guard. If any gizmos were drawn to this drawer during the guard, an exception will be thrown. More...
 
void RelativeTo (Transform transform)
 Causes all remaining gizmos drawing to be done in the local coordinate space of the given transform. More...
 
void PushMatrix ()
 Saves the current gizmo matrix to the gizmo matrix stack. More...
 
void PopMatrix ()
 Restores the current gizmo matrix from the gizmo matrix stack. More...
 
void ResetMatrixAndColorState ()
 Resets the matrix to the identity matrix and the color to white. More...
 
void DrawMesh (Mesh mesh, Matrix4x4 matrix)
 Draw a filled gizmo mesh using the given matrix transform. More...
 
void DrawMesh (Mesh mesh, Vector3 position, Quaternion rotation, Vector3 scale)
 Draws a filled gizmo mesh at the given transform location. More...
 
void DrawWireMesh (Mesh mesh, Matrix4x4 matrix)
 Draws a wire gizmo mesh using the given matrix transform. More...
 
void DrawWireMesh (Mesh mesh, Vector3 position, Quaternion rotation, Vector3 scale)
 Draws a wire gizmo mesh at the given transform location. More...
 
void DrawLine (Vector3 a, Vector3 b)
 Draws a gizmo line that connects the two positions. More...
 
void DrawCube (Vector3 position, Vector3 size)
 Draws a filled gizmo cube at the given position with the given size. More...
 
void DrawWireCube (Vector3 position, Vector3 size)
 Draws a wire gizmo cube at the given position with the given size. More...
 
void DrawSphere (Vector3 center, float radius)
 Draws a filled gizmo sphere at the given position with the given radius. More...
 
void DrawWireSphere (Pose pose, float radius, int numSegments=32)
 
void DrawWireSphere (Vector3 center, float radius, int numSegments=32)
 Draws a wire gizmo sphere at the given position with the given radius. More...
 
void DrawEllipsoid (Vector3 foci1, Vector3 foci2, float minorAxis)
 Draws a wire ellipsoid gizmo with two specified foci and a specified minor axis length. More...
 
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. More...
 
void DrawWireArc (Vector3 center, Vector3 normal, Vector3 radialStartDirection, float radius, float fractionOfCircleToDraw, int numCircleSegments=16)
 
void DrawColliders (GameObject gameObject, bool useWireframe=true, bool traverseHierarchy=true, bool drawTriggers=false)
 
void DrawCollider (Collider collider, bool useWireframe=true, bool skipMatrixSetup=false)
 
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). More...
 
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). More...
 
void DrawPosition (Vector3 pos, float overrideScale)
 
void DrawRect (Transform frame, Rect rect)
 
void ClearAllGizmos ()
 
void DrawAllGizmosToScreen ()
 

Public Attributes

Mesh cubeMesh
 
Mesh wireCubeMesh
 
Mesh sphereMesh
 
Mesh wireSphereMesh
 

Static Public Attributes

const int UNLIT_SOLID_PASS = 0
 
const int UNLIT_TRANSPARENT_PASS = 1
 
const int SHADED_SOLID_PASS = 2
 
const int SHADED_TRANSPARENT_PASS = 3
 

Properties

Shader gizmoShader [get, set]
 
Color color [get, set]
 Sets or gets the color for the gizmos that will be drawn next. More...
 
Matrix4x4 matrix [get, set]
 Sets or gets the matrix used to transform all gizmos. More...
 

Detailed Description

Definition at line 345 of file RuntimeGizmoManager.cs.

Member Function Documentation

◆ BeginGuard()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.BeginGuard ( )

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

Definition at line 390 of file RuntimeGizmoManager.cs.

◆ ClearAllGizmos()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.ClearAllGizmos ( )

Definition at line 779 of file RuntimeGizmoManager.cs.

◆ DrawAllGizmosToScreen()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawAllGizmosToScreen ( )

Definition at line 791 of file RuntimeGizmoManager.cs.

◆ DrawCollider()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawCollider ( Collider  collider,
bool  useWireframe = true,
bool  skipMatrixSetup = false 
)

Definition at line 638 of file RuntimeGizmoManager.cs.

◆ DrawColliders()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawColliders ( GameObject  gameObject,
bool  useWireframe = true,
bool  traverseHierarchy = true,
bool  drawTriggers = false 
)

Definition at line 615 of file RuntimeGizmoManager.cs.

◆ DrawCube()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawCube ( Vector3  position,
Vector3  size 
)

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

Definition at line 510 of file RuntimeGizmoManager.cs.

◆ DrawEllipsoid()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawEllipsoid ( Vector3  foci1,
Vector3  foci2,
float  minorAxis 
)

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

Definition at line 554 of file RuntimeGizmoManager.cs.

◆ DrawLine()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawLine ( Vector3  a,
Vector3  b 
)

Draws a gizmo line that connects the two positions.

Definition at line 502 of file RuntimeGizmoManager.cs.

◆ DrawMesh() [1/2]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawMesh ( Mesh  mesh,
Matrix4x4  matrix 
)

Draw a filled gizmo mesh using the given matrix transform.

Definition at line 472 of file RuntimeGizmoManager.cs.

◆ DrawMesh() [2/2]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawMesh ( Mesh  mesh,
Vector3  position,
Quaternion  rotation,
Vector3  scale 
)

Draws a filled gizmo mesh at the given transform location.

Definition at line 480 of file RuntimeGizmoManager.cs.

◆ DrawPosition() [1/3]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.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).

Definition at line 759 of file RuntimeGizmoManager.cs.

◆ DrawPosition() [2/3]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.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.

Definition at line 711 of file RuntimeGizmoManager.cs.

◆ DrawPosition() [3/3]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawPosition ( Vector3  pos,
float  overrideScale 
)

Definition at line 763 of file RuntimeGizmoManager.cs.

◆ DrawRect()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawRect ( Transform  frame,
Rect  rect 
)

Definition at line 767 of file RuntimeGizmoManager.cs.

◆ DrawSphere()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawSphere ( Vector3  center,
float  radius 
)

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

Definition at line 524 of file RuntimeGizmoManager.cs.

◆ DrawWireArc()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawWireArc ( Vector3  center,
Vector3  normal,
Vector3  radialStartDirection,
float  radius,
float  fractionOfCircleToDraw,
int  numCircleSegments = 16 
)

Definition at line 600 of file RuntimeGizmoManager.cs.

◆ DrawWireCapsule()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.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.

Definition at line 572 of file RuntimeGizmoManager.cs.

◆ DrawWireCube()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawWireCube ( Vector3  position,
Vector3  size 
)

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

Definition at line 517 of file RuntimeGizmoManager.cs.

◆ DrawWireMesh() [1/2]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawWireMesh ( Mesh  mesh,
Matrix4x4  matrix 
)

Draws a wire gizmo mesh using the given matrix transform.

Definition at line 487 of file RuntimeGizmoManager.cs.

◆ DrawWireMesh() [2/2]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawWireMesh ( Mesh  mesh,
Vector3  position,
Quaternion  rotation,
Vector3  scale 
)

Draws a wire gizmo mesh at the given transform location.

Definition at line 495 of file RuntimeGizmoManager.cs.

◆ DrawWireSphere() [1/2]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawWireSphere ( Pose  pose,
float  radius,
int  numSegments = 32 
)

Definition at line 534 of file RuntimeGizmoManager.cs.

◆ DrawWireSphere() [2/2]

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.DrawWireSphere ( Vector3  center,
float  radius,
int  numSegments = 32 
)

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

Definition at line 546 of file RuntimeGizmoManager.cs.

◆ EndGuard()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.EndGuard ( )

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

Definition at line 397 of file RuntimeGizmoManager.cs.

◆ PopMatrix()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.PopMatrix ( )

Restores the current gizmo matrix from the gizmo matrix stack.

Definition at line 423 of file RuntimeGizmoManager.cs.

◆ PushMatrix()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.PushMatrix ( )

Saves the current gizmo matrix to the gizmo matrix stack.

Definition at line 416 of file RuntimeGizmoManager.cs.

◆ RelativeTo()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.RelativeTo ( Transform  transform)

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

Definition at line 409 of file RuntimeGizmoManager.cs.

◆ ResetMatrixAndColorState()

void Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.ResetMatrixAndColorState ( )

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

Definition at line 430 of file RuntimeGizmoManager.cs.

Member Data Documentation

◆ cubeMesh

Mesh Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.cubeMesh

Definition at line 385 of file RuntimeGizmoManager.cs.

◆ SHADED_SOLID_PASS

const int Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.SHADED_SOLID_PASS = 2
static

Definition at line 348 of file RuntimeGizmoManager.cs.

◆ SHADED_TRANSPARENT_PASS

const int Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.SHADED_TRANSPARENT_PASS = 3
static

Definition at line 349 of file RuntimeGizmoManager.cs.

◆ sphereMesh

Mesh Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.sphereMesh

Definition at line 385 of file RuntimeGizmoManager.cs.

◆ UNLIT_SOLID_PASS

const int Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.UNLIT_SOLID_PASS = 0
static

Definition at line 346 of file RuntimeGizmoManager.cs.

◆ UNLIT_TRANSPARENT_PASS

const int Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.UNLIT_TRANSPARENT_PASS = 1
static

Definition at line 347 of file RuntimeGizmoManager.cs.

◆ wireCubeMesh

Mesh Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.wireCubeMesh

Definition at line 385 of file RuntimeGizmoManager.cs.

◆ wireSphereMesh

Mesh Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.wireSphereMesh

Definition at line 385 of file RuntimeGizmoManager.cs.

Property Documentation

◆ color

Color Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.color
getset

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

Definition at line 438 of file RuntimeGizmoManager.cs.

◆ gizmoShader

Shader Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.gizmoShader
getset

Definition at line 366 of file RuntimeGizmoManager.cs.

◆ matrix

Matrix4x4 Leap.Unity.RuntimeGizmos.RuntimeGizmoDrawer.matrix
getset

Sets or gets the matrix used to transform all gizmos.

Definition at line 455 of file RuntimeGizmoManager.cs.


The documentation for this class was generated from the following file: