docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct DebugDraw

    Debug draw singleton component with functions used for drawing debug display. PhysicsDebugDisplaySystem

    Implements
    IComponentData
    IQueryTypeParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Physics.Authoring
    Assembly: Unity.Physics.Hybrid.dll
    Syntax
    public struct DebugDraw : IComponentData, IQueryTypeParameter

    Methods

    Arc(float3, float3, float3, float, ColorIndex)

    Draws an arc.

    Declaration
    public void Arc(float3 center, float3 normal, float3 arm, float angle, ColorIndex color)
    Parameters
    Type Name Description
    float3 center

    World space position of the arc center.

    float3 normal

    Arc normal.

    float3 arm

    Arc arm.

    float angle

    Arc angle.

    ColorIndex color

    Color.

    Arrow(float3, float3, ColorIndex)

    Draws an arrow.

    Declaration
    public void Arrow(float3 x, float3 v, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    World space position of the arrow base.

    float3 v

    Arrow direction with length.

    ColorIndex color

    Color.

    Box(float3, float3, quaternion, ColorIndex)

    Draws a box.

    Declaration
    public void Box(float3 size, float3 center, quaternion orientation, ColorIndex color)
    Parameters
    Type Name Description
    float3 size

    Size of the box.

    float3 center

    Center of the box in world space.

    quaternion orientation

    Orientation of the box in world space.

    ColorIndex color

    Color.

    Cone(float3, float3, float, ColorIndex)

    Draws a cone.

    Declaration
    public void Cone(float3 point, float3 axis, float angle, ColorIndex color)
    Parameters
    Type Name Description
    float3 point

    Point in world space.

    float3 axis

    Cone axis.

    float angle

    Cone angle.

    ColorIndex color

    Color.

    Line(float3, float3, ColorIndex)

    Draws a line between 2 points.

    Declaration
    public void Line(float3 x0, float3 x1, ColorIndex color)
    Parameters
    Type Name Description
    float3 x0

    Point 0 in world space.

    float3 x1

    Point 1 in world space.

    ColorIndex color

    Color.

    Lines(in NativeArray<float3>, ColorIndex)

    Draws multiple lines between the provided pairs of points.

    Declaration
    public void Lines(in NativeArray<float3> lineVertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> lineVertices

    An array of vertices containing a sequence of point pairs. A line is drawn between every pair of points.

    ColorIndex color

    Color.

    Lines(in NativeList<float3>, ColorIndex)

    Draws multiple lines between the provided pairs of points.

    Declaration
    public void Lines(in NativeList<float3> lineVertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeList<float3> lineVertices

    A list of vertices containing a sequence of point pairs. A line is drawn between every pair of points.

    ColorIndex color

    Color.

    Lines(float3*, int, ColorIndex)

    Draws multiple lines between the provided pairs of points.

    Declaration
    public void Lines(float3* lineVertices, int numVertices, ColorIndex color)
    Parameters
    Type Name Description
    float3* lineVertices

    A pointer to a vertices array containing a sequence of point pairs. A line is drawn between every pair of points.

    int numVertices

    Number of vertices.

    ColorIndex color

    Color.

    Number(int, float3, float, float, ColorIndex)

    Draws a number in world space using 7-segment line display.

    Declaration
    public void Number(int value, float3 position, float scale, float spacing, ColorIndex color)
    Parameters
    Type Name Description
    int value

    The integer number to draw.

    float3 position

    The world space position of the number (bottom-left).

    float scale

    The scale for each digit segment.

    float spacing

    The space between digits.

    ColorIndex color

    The color of the number lines.

    Plane(float3, float3, ColorIndex)

    Draws a plane.

    Declaration
    public void Plane(float3 x, float3 v, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    Point in world space.

    float3 v

    Normal.

    ColorIndex color

    Color.

    Point(float3, float, ColorIndex)

    Draws a point.

    Declaration
    public void Point(float3 x, float size, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    World space position.

    float size

    Extents.

    ColorIndex color

    Color.

    Text(FixedString32Bytes, float3, float, float, ColorIndex)

    Draws a string in world space using line segments for letters and symbols.

    Declaration
    public void Text(FixedString32Bytes text, float3 position, float scale, float spacing, ColorIndex color)
    Parameters
    Type Name Description
    FixedString32Bytes text

    The text message to draw (uppercase A-Z, digits, space, colon supported).

    float3 position

    The world space position of the first character (bottom-left).

    float scale

    The scale for each character segment.

    float spacing

    The space between characters.

    ColorIndex color

    The color of the text lines.

    TriangleEdges(in NativeArray<float3>, in NativeArray<int>, ColorIndex)

    Draws multiple triangles from the provided data arrays.

    Declaration
    public void TriangleEdges(in NativeArray<float3> vertices, in NativeArray<int> triangleIndices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> vertices

    An array of vertices.

    NativeArray<int> triangleIndices

    An array of triangle indices pointing into the vertices array. A triangle is drawn from every triplet of triangle indices.

    ColorIndex color

    Color.

    Triangles(in NativeArray<float3>, in NativeArray<int>, ColorIndex)

    Draws multiple triangles from the provided data arrays.

    Declaration
    public void Triangles(in NativeArray<float3> vertices, in NativeArray<int> triangleIndices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> vertices

    An array of vertices.

    NativeArray<int> triangleIndices

    An array of triangle indices pointing into the vertices array. A triangle is drawn from every triplet of triangle indices.

    ColorIndex color

    Color.

    Triangles(in NativeArray<float3>, ColorIndex)

    Draws multiple triangles from the provided array of triplets of vertices.

    Declaration
    public void Triangles(in NativeArray<float3> vertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> vertices

    An array containing a sequence of vertex triplets. A triangle is drawn from every triplet of vertices.

    ColorIndex color

    Color.

    Triangles(in NativeList<float3>, ColorIndex)

    Draws multiple triangles from the provided list of triplets of vertices.

    Declaration
    public void Triangles(in NativeList<float3> vertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeList<float3> vertices

    A list containing a sequence of vertex triplets. A triangle is drawn from every triplet of vertices.

    ColorIndex color

    Color.

    Triangles(float3*, int, ColorIndex)

    Draws multiple triangles from the provided array of triplets of vertices.

    Declaration
    public void Triangles(float3* vertices, int numVertices, ColorIndex color)
    Parameters
    Type Name Description
    float3* vertices

    An array containing a sequence of vertex triplets. A triangle is drawn from every triplet of vertices.

    int numVertices

    Number of vertices.

    ColorIndex color

    Color.

    Implements

    Unity.Entities.IComponentData
    Unity.Entities.IQueryTypeParameter
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)