docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BurstGazeUtility

    Provides utility functions related to calculations for determining if things can be seen from a viewpoint.

    Inheritance
    object
    BurstGazeUtility
    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 BurstGazeUtility

    Methods

    IsAlignedToGazeForward(in float3, in float3, float)

    Checks if a given direction is aligned with a viewer (looking at it).

    Declaration
    public static bool IsAlignedToGazeForward(in float3 gazeDirection, in float3 targetDirection, float angleThreshold)
    Parameters
    Type Name Description
    float3 gazeDirection

    The direction the viewer is facing

    float3 targetDirection

    The direction the target is facing

    float angleThreshold

    How far the viewer and target can diverge and still be considered looking at one another

    Returns
    Type Description
    bool

    Returns true if targetDirection is within gaze angle threshold.

    IsOutsideDistanceRange(in float3, in float3, float)

    Checks if a given position is outside of a given view range

    Declaration
    public static bool IsOutsideDistanceRange(in float3 gazePosition, in float3 targetPosition, float distanceThreshold)
    Parameters
    Type Name Description
    float3 gazePosition

    The position of the viewer

    float3 targetPosition

    The position of the target

    float distanceThreshold

    How far away a target can be before it is outside the viewing range

    Returns
    Type Description
    bool

    Returns true if targetPosition is outside the gaze distance threshold.

    IsOutsideGaze(in float3, in float3, in float3, float)

    Checks if a given position is outside of a specific gaze viewpoint.

    Declaration
    public static bool IsOutsideGaze(in float3 gazePosition, in float3 gazeDirection, in float3 targetPosition, float angleThreshold)
    Parameters
    Type Name Description
    float3 gazePosition

    The position of the viewer

    float3 gazeDirection

    The direction the viewer is facing

    float3 targetPosition

    The position of the object being viewed

    float angleThreshold

    How wide a field of view the viewer has

    Returns
    Type Description
    bool

    Returns true if targetPosition is outside gaze angle threshold.

    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)