docs.unity3d.com
    Show / Hide Table of Contents

    Class BurstMathUtility

    Provides utility functions related to vector and quaternion calculations, optimized for use with the Burst compiler when available.

    Inheritance
    Object
    BurstMathUtility
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Utilities
    Syntax
    public static class BurstMathUtility

    Methods

    LookRotationWithForwardProjectedOnPlane(in float3, in float3, out quaternion)

    Computes the look rotation with the forward vector projected on a plane defined by a normal orthogonal to the plane.

    Declaration
    public static void LookRotationWithForwardProjectedOnPlane(in float3 forward, in float3 planeNormal, out quaternion lookRotation)
    Parameters
    Type Name Description
    float3 forward

    The forward vector to be projected onto the plane.

    float3 planeNormal

    The normal vector orthogonal to the plane.

    quaternion lookRotation

    The resulting look rotation with the projected forward vector and plane normal as up direction.

    LookRotationWithForwardProjectedOnPlane(in Vector3, in Vector3, out Quaternion)

    Computes the look rotation with the forward vector projected on a plane defined by a normal orthogonal to the plane.

    Declaration
    public static void LookRotationWithForwardProjectedOnPlane(in Vector3 forward, in Vector3 planeNormal, out Quaternion lookRotation)
    Parameters
    Type Name Description
    Vector3 forward

    The forward vector to be projected onto the plane.

    Vector3 planeNormal

    The normal vector orthogonal to the plane.

    Quaternion lookRotation

    The resulting look rotation with the projected forward vector and plane normal as up direction.

    Remarks

    Convenience method signature to cast output from quaternion to Quaternion.

    OrthogonalLookRotation(in float3, in float3, out quaternion)

    Calculates a look rotation quaternion given a forward vector and a reference up vector.

    Declaration
    public static void OrthogonalLookRotation(in float3 forward, in float3 referenceUp, out quaternion lookRotation)
    Parameters
    Type Name Description
    float3 forward

    The forward vector.

    float3 referenceUp

    The reference up vector.

    quaternion lookRotation

    The calculated look rotation quaternion.

    OrthogonalLookRotation(in Vector3, in Vector3, out Quaternion)

    Calculates a look rotation quaternion given a forward vector and a reference up vector.

    Declaration
    public static void OrthogonalLookRotation(in Vector3 forward, in Vector3 referenceUp, out Quaternion lookRotation)
    Parameters
    Type Name Description
    Vector3 forward

    The forward vector.

    Vector3 referenceUp

    The reference up vector.

    Quaternion lookRotation

    The calculated look rotation quaternion.

    Remarks

    Convenience method signature to cast output from quaternion to Quaternion.

    OrthogonalUpVector(in float3, in float3, out float3)

    Calculates the orthogonal up vector for a given forward vector and a reference up vector.

    Declaration
    public static void OrthogonalUpVector(in float3 forward, in float3 referenceUp, out float3 orthogonalUp)
    Parameters
    Type Name Description
    float3 forward

    The forward vector.

    float3 referenceUp

    The reference up vector.

    float3 orthogonalUp

    The calculated orthogonal up vector.

    OrthogonalUpVector(in Vector3, in Vector3, out Vector3)

    Calculates the orthogonal up vector for a given forward vector and a reference up vector.

    Declaration
    public static void OrthogonalUpVector(in Vector3 forward, in Vector3 referenceUp, out Vector3 orthogonalUp)
    Parameters
    Type Name Description
    Vector3 forward

    The forward vector.

    Vector3 referenceUp

    The reference up vector.

    Vector3 orthogonalUp

    The calculated orthogonal up vector.

    Remarks

    Convenience method signature to cast output from float3 to Vector3.

    ProjectOnPlane(in float3, in float3, out float3)

    Projects a vector onto a plane defined by a normal orthogonal to the plane.

    Declaration
    public static void ProjectOnPlane(in float3 vector, in float3 planeNormal, out float3 projectedVector)
    Parameters
    Type Name Description
    float3 vector

    The vector to be projected.

    float3 planeNormal

    The normal vector orthogonal to the plane.

    float3 projectedVector

    The projected vector on the plane.

    ProjectOnPlane(in Vector3, in Vector3, out Vector3)

    Projects a vector onto a plane defined by a normal orthogonal to the plane.

    Declaration
    public static void ProjectOnPlane(in Vector3 vector, in Vector3 planeNormal, out Vector3 projectedVector)
    Parameters
    Type Name Description
    Vector3 vector

    The vector to be projected.

    Vector3 planeNormal

    The normal vector orthogonal to the plane.

    Vector3 projectedVector

    The projected vector on the plane.

    Remarks

    Convenience method signature to cast output from float3 to Vector3.

    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