docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BurstPhysicsUtils

    Provides utility methods for physics calculations in Burst-compiled code.

    Inheritance
    object
    BurstPhysicsUtils
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Utilities
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public static class BurstPhysicsUtils

    Methods

    GetConecastOffset(in float3, in float3, in float3, out float)

    Gets the perpendicular distance from the given point to the nearest point on the given line.

    Declaration
    public static void GetConecastOffset(in float3 origin, in float3 conePoint, in float3 direction, out float coneOffset)
    Parameters
    Type Name Description
    float3 origin

    The starting point of the line.

    float3 conePoint

    The point to calculate horizontal distance to.

    float3 direction

    The direction of the line.

    float coneOffset

    The horizontal distance from conePoint to the nearest point on the line defined by origin and direction.

    GetConecastParameters(float, float, float, in Vector3, out Vector3, out float, out float)

    Computes conecast parameters given the angle radius, offset, and direction.

    Declaration
    public static void GetConecastParameters(float angleRadius, float offset, float maxOffset, in Vector3 direction, out Vector3 originOffset, out float radius, out float castMax)
    Parameters
    Type Name Description
    float angleRadius

    How wide the cone should be at a given distance.

    float offset

    How far from the origin this conecast will be starting from.

    float maxOffset

    The maximum distance this conecast will be allowed to travel.

    Vector3 direction

    The direction the conecast is traveling.

    Vector3 originOffset

    How much to offset the origin of the conecast.

    float radius

    The maximum radius this conecast should cover.

    float castMax

    The distance this conecast should travel, taking sphere size into account.

    GetSphereOverlapParameters(in Vector3, in Vector3, out Vector3, out float, out float)

    Computes sphere overlap parameters given the start and end positions of the overlap.

    Declaration
    public static void GetSphereOverlapParameters(in Vector3 overlapStart, in Vector3 overlapEnd, out Vector3 normalizedOverlapVector, out float overlapSqrMagnitude, out float overlapDistance)
    Parameters
    Type Name Description
    Vector3 overlapStart

    The starting position of the sphere overlap.

    Vector3 overlapEnd

    The ending position of the sphere overlap.

    Vector3 normalizedOverlapVector

    Output parameter containing the normalized overlap direction vector.

    float overlapSqrMagnitude

    Output parameter containing the square of the magnitude of the overlap vector.

    float overlapDistance

    Output parameter containing the distance of the overlap.

    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)