docs.unity3d.com
    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, ...).
    4) Data will be drawn when PhysicsDebugDisplaySystem's OnUpdate() is called.

    IMPORTANT: Drawing works only in Editor mode.

    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>(Boolean)
    SystemBase.GetComponentDataFromEntity<T>(Boolean)
    SystemBase.GetBuffer<T>(Entity, Boolean)
    SystemBase.GetBufferLookup<T>(Boolean)
    SystemBase.GetBufferFromEntity<T>(Boolean)
    SystemBase.GetEntityStorageInfoLookup()
    SystemBase.GetStorageInfoFromEntity()
    SystemBase.Exists(Entity)
    SystemBase.Dependency
    SystemBase.CheckedStateRef
    SystemBase.Entities
    SystemBase.Job
    ComponentSystemBase.ShouldRunSystem()
    ComponentSystemBase.GetComponentTypeHandle<T>(Boolean)
    ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetBufferTypeHandle<T>(Boolean)
    ComponentSystemBase.GetSharedComponentTypeHandle<T>()
    ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetEntityTypeHandle()
    ComponentSystemBase.RequireForUpdate(EntityQuery)
    ComponentSystemBase.RequireAnyForUpdate(EntityQuery[])
    ComponentSystemBase.RequireAnyForUpdate(NativeArray<EntityQuery>)
    ComponentSystemBase.RequireForUpdate<T>()
    ComponentSystemBase.RequireSingletonForUpdate<T>()
    ComponentSystemBase.HasSingleton<T>()
    ComponentSystemBase.GetSingleton<T>()
    ComponentSystemBase.GetSingletonRW<T>()
    ComponentSystemBase.GetSingletonBuffer<T>(Boolean)
    ComponentSystemBase.TryGetSingleton<T>(T)
    ComponentSystemBase.TryGetSingletonBuffer<T>(DynamicBuffer<T>)
    ComponentSystemBase.SetSingleton<T>(T)
    ComponentSystemBase.GetSingletonEntity<T>()
    ComponentSystemBase.TryGetSingletonEntity<T>(Entity)
    ComponentSystemBase.GetEntityQuery(ComponentType[])
    ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
    ComponentSystemBase.GetEntityQuery(EntityQueryDesc[])
    ComponentSystemBase.GetEntityQuery(EntityQueryBuilder)
    ComponentSystemBase.Enabled
    ComponentSystemBase.EntityQueries
    ComponentSystemBase.GlobalSystemVersion
    ComponentSystemBase.LastSystemVersion
    ComponentSystemBase.EntityManager
    ComponentSystemBase.World
    ComponentSystemBase.SystemHandle
    ComponentSystemBase.SystemHandleUntyped
    ComponentSystemBase.Time
    ComponentSystemBase.WorldUpdateAllocator
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Physics.Authoring
    Syntax
    public abstract class PhysicsDebugDisplaySystem : SystemBase

    Methods

    Arc(float3, float3, float3, Single, 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.

    Single 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, Single, 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.

    Single 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.

    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, Single, ColorIndex)

    Draws a point.

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

    World space position.

    Single size

    Extents.

    ColorIndex color

    Color.

    Triangle(float3, float3, float3, float3, ColorIndex)

    Draws a triangle.

    Declaration
    public static void Triangle(float3 vertex0, float3 vertex1, float3 vertex2, float3 normal, ColorIndex color)
    Parameters
    Type Name Description
    float3 vertex0

    Vertex 0 in world space.

    float3 vertex1

    Vertex 1 in world space.

    float3 vertex2

    Vertex 2 in world space.

    float3 normal

    Triangle normal.

    ColorIndex color

    Color.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023