Struct CommandBuilder Extends IDisposable

Public

Builder for drawing commands.

You can use this to queue many drawing commands. The commands will be queued for rendering when you call the Dipose method. It is recommended that you use the using statement which automatically calls the Dispose method.

Warning

You must call either Dipose or DiscardAndDispose when you are done with this object to avoid memory leaks.

Inner Types

Holds rendering data for a box.

Holds rendering data for a circle.

Holds rendering data for a circle.

Holds rendering data for a line.

Public Methods

Arrow (from, to)

Draws an arrow between two points.

Public
Arrow (from, to, color)

Draws an arrow between two points.

Public
Arrow (from, to, up, headFraction)

Draws an arrow between two points.

Public
Arrow (from, to, up, headFraction, color)

Draws an arrow between two points.

Public
Arrowhead (center, direction, radius)

Draws an arrowhead at a point.

Public
Arrowhead (center, direction, up, radius)

Draws an arrowhead at a point.

Public
Arrowhead (center, direction, radius, color)

Draws an arrowhead at a point.

Public
Arrowhead (center, direction, up, radius, color)

Draws an arrowhead at a point.

Public
ArrowheadArc (origin, direction, offset, color)

Draws an arrowhead centered around a circle.

Public
ArrowheadArc (origin, direction, offset, width=60)

Draws an arrowhead centered around a circle.

Public
ArrowheadArc (origin, direction, offset, width, color)

Draws an arrowhead centered around a circle.

Public
Bezier (p0, p1, p2, p3)

Draws a cubic bezier curve.

Public
Bezier (p0, p1, p2, p3, color)

Draws a cubic bezier curve.

Public
Circle (center, normal, radius)

Draws a circle in the XY plane.

Public
Circle (center, normal, radius, color)

Draws a circle in the XY plane.

Public
CircleXY (center, radius, color)

Draws a circle in the XY plane.

Public
CircleXY (center, radius, startAngle=0f, endAngle=…)

Draws a circle in the XY plane.

Public
CircleXY (center, radius, startAngle, endAngle, color)

Draws a circle in the XY plane.

Public
CircleXZ (center, radius, color)

Draws a circle in the XZ plane.

Public
CircleXZ (center, radius, startAngle=0f, endAngle=…)

Draws a circle in the XZ plane.

Public
CircleXZ (center, radius, startAngle, endAngle, color)

Draws a circle in the XZ plane.

Public
Cross (position, size=1)

Draws a cross.

Public
Cross (position, color)

Draws a cross.

Public
Cross (position, size, color)

Draws a cross.

Public
CrossXY (position, color)

Draws a cross in the XY plane.

Public
CrossXY (position, size=1)

Draws a cross in the XY plane.

Public
CrossXY (position, size, color)

Draws a cross in the XY plane.

Public
CrossXZ (position, size=1)

Draws a cross in the XZ plane.

Public
CrossXZ (position, color)

Draws a cross in the XZ plane.

Public
CrossXZ (position, size, color)

Draws a cross in the XZ plane.

Public
DiscardAndDispose ()

Discards the contents of this command builder without rendering anything.

Public
Dispose ()

Submits this command builder for rendering.

Public
InLocalSpace (transform)

Scope to draw multiple things relative to a transform object.

Public
InScreenSpace (camera)

Scope to draw multiple things in screen space of a camera.

Public
Line (a, b)

Draws a line between two points.

Public
Line (a, b)
Public
Line (a, b, color)

Draws a line between two points.

Public
Line (a, b, color)
Public
Polyline (points, color)

Draws lines through a sequence of points.

Public
Polyline (points, color)

Draws lines through a sequence of points.

Public
Polyline (points, cycle=…)

Draws lines through a sequence of points.

Public
Polyline (points, cycle=…)

Draws lines through a sequence of points.

Public
Polyline (points, cycle=…)

Draws lines through a sequence of points.

Public
Polyline (points, cycle=…)

Draws lines through a sequence of points.

Public
Polyline (points, color)
Public
Polyline (points, color)
Public
Polyline (points, cycle, color)
Public
Polyline (points, cycle, color)

Draws lines through a sequence of points.

Public
Polyline (points, cycle, color)
Public
Polyline (points, cycle, color)

Draws lines through a sequence of points.

Public
PopColor ()

Pops a color from the stack.

Public
PopMatrix ()

Pops a matrix from the stack.

Public
PopPersist ()

Pops a persist scope from the stack.

Public
Preallocate (size)
Public
PushColor (color)

Draws everything until the next PopColor with the given color.

Public
PushMatrix (matrix)

Multiply all coordinates until the next PopMatrix with the given matrix.

Public
PushPersist (duration)

Draws everything until the next PopPersist for a number of seconds.

Public
PushSetMatrix (matrix)

Multiply all coordinates until the next PopMatrix with the given matrix.

Public
Ray (origin, direction)

Draws a ray starting at a point and going in the given direction.

Public
Ray (ray, length)

Draws a ray with a given length.

Public
Ray (origin, direction, color)

Draws a ray starting at a point and going in the given direction.

Public
Ray (ray, length, color)

Draws a ray with a given length.

Public
SolidBox (bounds)

Draws a solid box.

Public
SolidBox (bounds, color)

Draws a solid box.

Public
SolidBox (center, size)

Draws a solid box.

Public
SolidBox (center, size, color)

Draws a solid box.

Public
SolidBox (center, rotation, size)

Draws a solid box.

Public
SolidBox (center, rotation, size, color)

Draws a solid box.

Public
SolidMesh (vertices, triangles, colors)

Draws a solid mesh with the given vertices.

Public
SolidMesh (vertices, triangles, colors, vertexCount, indexCount)

Draws a solid mesh with the given vertices.

Public
WireBox (bounds)

Draws the outline of a box.

Public
WireBox (bounds, color)

Draws the outline of a box.

Public
WireBox (center, size)

Draws the outline of an axis aligned box.

Public
WireBox (center, size, color)

Draws the outline of an axis aligned box.

Public
WireBox (center, rotation, size)

Draws the outline of a box.

Public
WireBox (center, rotation, size, color)

Draws the outline of a box.

Public
WireCapsule (bottom, top, radius)

Draws a capsule.

Public
WireCapsule (bottom, top, radius, color)

Draws a capsule.

Public
WireCapsule (position, up, height, radius)

Draws a capsule.

Public
WireCapsule (position, up, height, radius, color)

Draws a capsule.

Public
WireCylinder (bottom, top, radius)

Draws a cylinder.

Public
WireCylinder (bottom, top, radius, color)

Draws a cylinder.

Public
WireCylinder (position, up, height, radius)

Draws a cylinder.

Public
WireCylinder (position, up, height, radius, color)

Draws a cylinder.

Public
WireGrid (center, rotation, cells, totalSize)

Draws a grid of lines.

Public
WireGrid (center, rotation, cells, totalSize, color)

Draws a grid of lines.

Public
WireHexagon (center, rotation, radius)

Draws a hexagon outline.

Public
WireHexagon (center, rotation, radius, color)

Draws a hexagon outline.

Public
WirePentagon (center, rotation, radius)

Draws a pentagon outline.

Public
WirePentagon (center, rotation, radius, color)

Draws a pentagon outline.

Public
WirePolygon (center, vertices, rotation, radius)

Draws a regular polygon outline.

Public
WirePolygon (center, vertices, rotation, radius, color)

Draws a regular polygon outline.

Public
WireRectangle (rect)

Draws a rectangle outline.

Public
WireRectangle (rect, color)

Draws a rectangle outline.

Public
WireRectangle (center, rotation, size)

Draws a rectangle outline.

Public
WireRectangle (center, rotation, size, color)

Draws a rectangle outline.

Public
WireRectangleXZ (center, size)

Draws a rectangle outline.

Public
WireRectangleXZ (center, size, color)

Draws a rectangle outline.

Public
WireSphere (position, radius)

Draws a wire sphere.

Public
WireSphere (position, radius, color)

Draws a wire sphere.

Public
WireTriangle (a, b, c)

Draws a triangle outline.

Public
WireTriangle (center, rotation, radius)

Draws a triangle outline.

Public
WireTriangle (a, b, c, color)

Draws a triangle outline.

Public
WireTriangle (center, rotation, radius, color)

Draws a triangle outline.

Public
WithColor (color)

Scope to draw multiple things with the same color.

Public
WithDuration (duration)

Scope to draw multiple things for a longer period of time.

Public
WithMatrix (matrix)

Scope to draw multiple things with an implicit matrix transformation.

Public

Public Static Methods

AssertNotRendering ()
Public Static
EvaluateCubicBezier (p0, p1, p2, p3, t)

Returns a point on a cubic bezier curve.

Public Static
GetSize (buffer)
Public Static

Public Static Variables

XZtoXYPlaneMatrix
Public Static Readonly
XZtoYZPlaneMatrix
Public Static Readonly

Private/Protected Members

Add< T > (value)
Private
AssignMeshData (mesh, bounds, vertices, triangles)
Private Static
buffer
Private
BufferSize
Private
Build (gizmos, buffers, camera, dependency)
Package Static
BuildMesh (gizmos, meshes, inputBuffers)
Package Static
CameraDepthToPixelSize (camera)

Helper for determining how large a pixel is at a given depth.

Private Static
Command

Internal rendering command.

Private
CommandBuilder (gizmos, hasher, frameRedrawScope, customRedrawScope, isGizmos)
Package
ConvertExistingDataToNativeArray< T > (data)
Private Static
gizmos
Private
MeshLayout
Private Static Readonly
Reserve (additionalSpace)

Ensures the buffer has room for at least N more bytes.

Private
Reserve< A > ()
Private
Reserve< A, B > ()
Private
Reserve< A, B, C > ()
Private
samplerConvert
Private Static Readonly
samplerLayout
Private Static Readonly
samplerSubmesh
Private Static Readonly
samplerUpdate
Private Static Readonly
threadIndex
Private
uniqueID
Private