Class BurstGazeUtility
Provides utility functions related to calculations for determining if things can be seen from a viewpoint.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Utilities
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public static class BurstGazeUtility
Methods
IsAlignedToGazeForward(in float3, in float3, float)
Returns 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 |
IsOutsideDistanceRange(in float3, in float3, float)
Returns 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 |
IsOutsideGaze(in float3, in float3, in float3, float)
Returns if a given position is outside of a specific 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 |