Inner Types
Public Methods
void
Bezier
(
float3
p0
Start point
float3
p1
First control point
float3
p2
Second control point
float3
p3
End point
)
Draws a cubic bezier curve.
Todo Currently uses a fixed resolution of 20 segments. Resolution should depend on the distance to the camera.
void
Bezier
(
float3
p0
Start point
float3
p1
First control point
float3
p2
Second control point
float3
p3
End point
Color
color
)
Draws a cubic bezier curve.
Todo Currently uses a fixed resolution of 20 segments. Resolution should depend on the distance to the camera.
void
Circle
(
float3
center
float3
normal
float
radius
)
Draws a circle in the XY plane.
Note This overload does not allow you to draw an arc. Use CircleXY or CircleXZ instead.
void
Circle
(
float3
center
float3
normal
float
radius
Color
color
)
Draws a circle in the XY plane.
Note This overload does not allow you to draw an arc. Use CircleXY or CircleXZ instead.
void
CircleXY
(
float3
center
float
radius
Color
color
)
Draws a circle in the XY plane.
You can draw an arc by supplying the startAngle and endAngle parameters.
void
CircleXY
(
float3
center
float
radius
float
startAngle=0f
float
endAngle=2 *Mathf.PI
)
Draws a circle in the XY plane.
You can draw an arc by supplying the startAngle and endAngle parameters.
void
CircleXY
(
float3
center
float
radius
float
startAngle
float
endAngle
Color
color
)
Draws a circle in the XY plane.
You can draw an arc by supplying the startAngle and endAngle parameters.
void
CircleXZ
(
float3
center
float
radius
Color
color
)
Draws a circle in the XZ plane.
You can draw an arc by supplying the startAngle and endAngle parameters.
void
CircleXZ
(
float3
center
float
radius
float
startAngle=0f
float
endAngle=2 *Mathf.PI
)
Draws a circle in the XZ plane.
You can draw an arc by supplying the startAngle and endAngle parameters.
void
CircleXZ
(
float3
center
float
radius
float
startAngle
float
endAngle
Color
color
)
Draws a circle in the XZ plane.
You can draw an arc by supplying the startAngle and endAngle parameters.
void
CrossXY
(
float3
position
Color
color
)
Draws a cross in the XY plane.
void
CrossXY
(
float3
position
float
size=1
)
Draws a cross in the XY plane.
void
CrossXY
(
float3
position
float
size
Color
color
)
Draws a cross in the XY plane.
void
CrossXZ
(
float3
position
float
size=1
)
Draws a cross in the XZ plane.
void
CrossXZ
(
float3
position
Color
color
)
Draws a cross in the XZ plane.
void
CrossXZ
(
float3
position
float
size
Color
color
)
Draws a cross in the XZ plane.
void
DiscardAndDispose
( )
)
Scope to draw multiple things relative to a transform object.
All coordinates for items drawn inside the scope will be multiplied by the transform's localToWorldMatrix.
Your browser does not support the video tag.
)
Scope to draw multiple things in screen space of a camera.
If you draw 2D coordinates (i.e. (x,y,0)) they will be projected onto a plane (2*near clip plane of the camera) world units in front of the camera.
The lower left corner of the camera is (0,0,0) and the upper right is (camera.pixelWidth, camera.pixelHeight, 0)
void
Line
(
)
Draws a line between two points.
void
Line
(
float3
a
float3
b
Color
color
)
Draws a line between two points.
void
Polyline
(
NativeArray<float3>
points
Sequence of points to draw lines through
Color
color
)
Draws lines through a sequence of points.
void
Polyline
(
List<Vector3 >
points
Seq u ence of points to draw lines through
Color
color
)
Draws lines through a sequence of points.
void
Polyline
(
Vector3 []
points
Sequence of points to draw lines through
bool
cycle=false
If true a line will be drawn from the last point in the sequence back to the first point.
)
Draws lines through a sequence of points.
void
Polyline
(
NativeArray<float3>
points
Sequence of points to draw lines through
bool
cycle=false
If true a line will be drawn from the last point in the sequence back to the first point.
)
Draws lines through a sequence of points.
void
Polyline
(
float3 []
points
Sequence of points to draw lines through
bool
cycle=false
If true a line will be drawn from the last point in the sequence back to the first point.
)
Draws lines through a sequence of points.
void
Polyline
(
List<Vector3 >
points
Seq u ence of points to draw lines through
bool
cycle=false
If true a line will be drawn from the last point in the sequence back to the first point.
)
Draws lines through a sequence of points.
void
Polyline
(
float3 []
points
Color
color
)
void
Polyline
(
float3 []
points
bool
cycle
Color
color
)
void
Polyline
(
NativeArray<float3>
points
Sequence of points to draw lines through
bool
cycle
If true a line will be drawn from the last point in the sequence back to the first point.
Color
color
)
Draws lines through a sequence of points.
void
Polyline
(
List<Vector3 >
points
Seq u ence of points to draw lines through
bool
cycle
If true a line will be drawn from the last point in the sequence back to the first point.
Color
color
)
Draws lines through a sequence of points.
void
Ray
(
float3
origin
float3
direction
)
Draws a ray starting at a point and going in the given direction.
The ray will end at origin + direction .
void
Ray
(
)
Draws a ray with a given length.
void
Ray
(
float3
origin
float3
direction
Color
color
)
Draws a ray starting at a point and going in the given direction.
The ray will end at origin + direction .
void
Ray
(
)
Draws a ray with a given length.
void
SolidBox
(
Bounds
bounds
Bounding box of the box
)
Draws a solid box.
void
SolidBox
(
)
Draws a solid box.
void
SolidBox
(
float3
center
Center of the box
float3
size
Width of the box along all dimensions
)
Draws a solid box.
void
SolidBox
(
float3
center
Center of the box
float3
size
Width of the box along all dimensions
Color
color
)
Draws a solid box.
void
SolidBox
(
float3
center
Center of the box
Quaternion
rotation
Rotation of the box
float3
size
Width of the box along all dimensions
)
Draws a solid box.
void
SolidBox
(
float3
center
Center of the box
Quaternion
rotation
Rotation of the box
float3
size
Width of the box along all dimensions
Color
color
)
Draws a solid box.
void
SolidMesh
(
List<Vector3 >
vertices
List<int>
triangles
List<Color >
colors
)
Draws a solid mesh with the given vertices.
Note This method is not thread safe and must not be used from the Unity Job System.
Todo Are matrices handled?
void
SolidMesh
(
Vector3 []
vertices
int []
triangles
Color []
colors
int
vertexCount
int
indexCount
)
Draws a solid mesh with the given vertices.
Note This method is not thread safe and must not be used from the Unity Job System.
Todo Are matrices handled?
void
WireBox
(
)
Draws the outline of a box.
void
WireBox
(
)
Draws the outline of a box.
void
WireBox
(
float3
center
Center of the box
float3
size
Width of the box along all dimensions
)
Draws the outline of an axis aligned box.
void
WireBox
(
float3
center
Center of the box
float3
size
Width of the box along all dimensions
Color
color
)
Draws the outline of an axis aligned box.
void
WireBox
(
float3
center
Center of the box
Quaternion
rotation
Rotation of the box
float3
size
Width of the box along all dimensions
)
Draws the outline of a box.
void
WireBox
(
float3
center
Center of the box
Quaternion
rotation
Rotation of the box
float3
size
Width of the box along all dimensions
Color
color
)
Draws the outline of a box.
void
WireCapsule
(
float3
bottom
float3
top
float
radius
)
Draws a capsule.
The capsule's lower circle will be centered at the bottom parameter and similarly for the upper circle.
void
WireCapsule
(
float3
bottom
float3
top
float
radius
Color
color
)
Draws a capsule.
The capsule's lower circle will be centered at the bottom parameter and similarly for the upper circle.
void
WireCapsule
(
float3
position
Lowest point of the capsule.
float3
up
Up direction of the capsule.
float
height
Distance between the lowest and highest points of the capsule. The height will be clamped to be at least 2*radius.
float
radius
The radius of the capsule.
)
Draws a capsule.
void
WireCapsule
(
float3
position
Lowest point of the capsule.
float3
up
Up direction of the capsule.
float
height
Distance between the lowest and highest points of the capsule. The height will be clamped to be at least 2*radius.
float
radius
The radius of the capsule.
Color
color
)
Draws a capsule.
void
WireCylinder
(
float3
bottom
float3
top
float
radius
)
Draws a cylinder.
The cylinder's bottom circle will be centered at the bottom parameter and similarly for the top circle.
void
WireCylinder
(
float3
bottom
float3
top
float
radius
Color
color
)
Draws a cylinder.
The cylinder's bottom circle will be centered at the bottom parameter and similarly for the top circle.
void
WireCylinder
(
float3
position
float3
up
float
height
float
radius
)
Draws a cylinder.
The cylinder's bottom circle will be centered at the position parameter. The cylinder's orientation will be determined by the up and height parameters.
void
WireCylinder
(
float3
position
float3
up
float
height
float
radius
Color
color
)
Draws a cylinder.
The cylinder's bottom circle will be centered at the position parameter. The cylinder's orientation will be determined by the up and height parameters.
void
WireSphere
(
float3
position
float
radius
)
Draws a wire sphere.
void
WireSphere
(
float3
position
float
radius
Color
color
)
Draws a wire sphere.
)
Scope to draw multiple things with the same color.
float
duration
How long the drawn items should persist in seconds.
)
Scope to draw multiple things for a longer period of time.
Normally drawn items will only be rendered for a single frame. Using a persist scope you can make the items be drawn for any amount of time.
)
Scope to draw multiple things with an implicit matrix transformation.
All coordinates for items drawn inside the scope will be multiplied by the matrix. If WithMatrix scopes are nested then they are multiplied by all nested matrices.
Public Static Methods
void
AssertNotRendering
( )
float3
EvaluateCubicBezier
(
float3
p0
float3
p1
float3
p2
float3
p3
float
t
)
Returns a point on a cubic bezier curve.
t is clamped between 0 and 1
Public Static Variables
Matrix4x4
XZtoXYPlaneMatrix = Matrix4x4.Rotate(Quaternion.Euler(new Vector3(-90, 0, 0)))
Matrix4x4
XZtoYZPlaneMatrix = Matrix4x4.Rotate(Quaternion.Euler(new Vector3(0, 0, 90)))
Private/Protected Members
void
AssignMeshData
(
Mesh
mesh
Bounds
bounds
UnsafeAppendBuffer
vertices
UnsafeAppendBuffer
triangles
)
unsafe UnsafeAppendBuffer *
buffer
unsafe JobHandle
Build
(
)
unsafe void
BuildMesh
(
RetainedGizmos
gizmos
List<MeshWithType>
meshes
ProcessedBuilderData.MeshBuffers *
inputBuffers
)
float2
CameraDepthToPixelSize
(
)
Helper for determining how large a pixel is at a given depth.
A a distance D from the camera a pixel corresponds to roughly value.x * D + value.y world units. Where value is the return value from this function.
Command
PushColorInline= 1 << 8
PushColor= 0
PopColor
PushMatrix
PushSetMatrix
PopMatrix
Line
Circle
CircleXZ
Box
PushPersist
PopPersist
CommandBuilder
(
RetainedGizmos
gizmos
Hasher
hasher
RedrawScope
redrawScope
bool
isGizmos
)
NativeArray<T>
ConvertExistingDataToNativeArray< T >
(
)
VertexAttributeDescriptor []
MeshLayout = {
new VertexAttributeDescriptor(VertexAttribute.Position, VertexAttributeFormat.Float32, 3),
new VertexAttributeDescriptor(VertexAttribute.Normal, VertexAttributeFormat.Float32, 3),
new VertexAttributeDescriptor(VertexAttribute.Color, VertexAttributeFormat.UNorm8, 4),
new VertexAttributeDescriptor(VertexAttribute.TexCoord0, VertexAttributeFormat.Float32, 2),
}
void
Reserve< A, B, C >
( )
CustomSampler
samplerConvert = CustomSampler.Create("Convert")
CustomSampler
samplerLayout = CustomSampler.Create("SetLayout")
CustomSampler
samplerSubmesh = CustomSampler.Create("Submesh")
CustomSampler
samplerUpdate = CustomSampler.Create("Update")