docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PhysicsDebugDisplaySystem

    A system which is responsible for drawing physics debug display data. Create a singleton entity with PhysicsDebugDisplayData and select what you want to be drawn.

    If you want custom debug draw, you need to:

    1. Create a system which updates before PhysicsDebugDisplaySystem.
    2. In OnUpdate() of that system, call GetSingleton PhysicsDebugDisplayData (even if you are not using it, it is important to do so to properly chain dependencies).
    3. Afterwards, in OnUpdate() or in scheduled jobs, call one of the exposed draw methods (Line, Arrow, Plane, Triangle, Cone, Box, ...).
      IMPORTANT: Drawing works only in the Editor.
    Inheritance
    object
    ComponentSystemBase
    SystemBase
    PhysicsDebugDisplaySystem
    PhysicsDebugDisplaySystem_Default
    PhysicsDebugDisplaySystem_Editor
    Inherited Members
    SystemBase.CompleteDependency()
    SystemBase.Update()
    SystemBase.GetComponent<T>(Entity)
    SystemBase.SetComponent<T>(Entity, T)
    SystemBase.HasComponent<T>(Entity)
    SystemBase.HasBuffer<T>(Entity)
    SystemBase.GetComponentLookup<T>(bool)
    SystemBase.GetComponentDataFromEntity<T>(bool)
    SystemBase.GetBuffer<T>(Entity, bool)
    SystemBase.GetBufferLookup<T>(bool)
    SystemBase.GetBufferFromEntity<T>(bool)
    SystemBase.GetEntityStorageInfoLookup()
    SystemBase.GetStorageInfoFromEntity()
    SystemBase.Exists(Entity)
    SystemBase.Dependency
    SystemBase.CheckedStateRef
    SystemBase.Entities
    SystemBase.Job
    ComponentSystemBase.ShouldRunSystem()
    ComponentSystemBase.GetComponentTypeHandle<T>(bool)
    ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetBufferTypeHandle<T>(bool)
    ComponentSystemBase.GetSharedComponentTypeHandle<T>()
    ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetEntityTypeHandle()
    ComponentSystemBase.RequireForUpdate(EntityQuery)
    ComponentSystemBase.RequireAnyForUpdate(params EntityQuery[])
    ComponentSystemBase.RequireAnyForUpdate(NativeArray<EntityQuery>)
    ComponentSystemBase.RequireForUpdate<T>()
    ComponentSystemBase.RequireSingletonForUpdate<T>()
    ComponentSystemBase.HasSingleton<T>()
    ComponentSystemBase.GetSingleton<T>()
    ComponentSystemBase.GetSingletonRW<T>()
    ComponentSystemBase.GetSingletonBuffer<T>(bool)
    ComponentSystemBase.TryGetSingleton<T>(out T)
    ComponentSystemBase.TryGetSingletonBuffer<T>(out DynamicBuffer<T>)
    ComponentSystemBase.SetSingleton<T>(T)
    ComponentSystemBase.GetSingletonEntity<T>()
    ComponentSystemBase.TryGetSingletonEntity<T>(out Entity)
    ComponentSystemBase.GetEntityQuery(params ComponentType[])
    ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
    ComponentSystemBase.GetEntityQuery(params EntityQueryDesc[])
    ComponentSystemBase.GetEntityQuery(in EntityQueryBuilder)
    ComponentSystemBase.Enabled
    ComponentSystemBase.EntityQueries
    ComponentSystemBase.GlobalSystemVersion
    ComponentSystemBase.LastSystemVersion
    ComponentSystemBase.EntityManager
    ComponentSystemBase.World
    ComponentSystemBase.SystemHandle
    ComponentSystemBase.SystemHandleUntyped
    ComponentSystemBase.Time
    ComponentSystemBase.WorldUpdateAllocator
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Physics.Authoring
    Assembly: Unity.Physics.Hybrid.dll
    Syntax
    public abstract class PhysicsDebugDisplaySystem : SystemBase

    Methods

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

    Draws an arc.

    Declaration
    public static 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 static 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 static 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 static 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 static 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 static 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 static 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 static 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.

    Plane(float3, float3, ColorIndex)

    Draws a plane.

    Declaration
    public static 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 static void Point(float3 x, float size, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    World space position.

    float size

    Extents.

    ColorIndex color

    Color.

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

    Draws multiple triangles from the provided data arrays.

    Declaration
    public static 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 static 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 static 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 static 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 static 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.

    In This Article
    Back to top
    Copyright © 2025 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)