Class TrackedDeviceGraphicRaycaster
Custom implementation of Unity
Inheritance
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.UI
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("Event/Tracked Device Graphic Raycaster", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.1/api/UnityEngine.XR.Interaction.Toolkit.UI.TrackedDeviceGraphicRaycaster.html")]
public class TrackedDeviceGraphicRaycaster : BaseRaycaster, IPokeStateDataProvider, IMultiPokeStateDataProvider
Properties
blockingMask
The layers of objects that are checked to determine if they block Graphic ray casts when checking for 2D or 3D occlusion.
Declaration
public LayerMask blockingMask { get; set; }
Property Value
Type | Description |
---|---|
Layer |
checkFor2DOcclusion
Whether or not 2D occlusion is checked when performing ray casts. Enable to make Graphics be blocked by 2D objects that exist in front of it.
Declaration
public bool checkFor2DOcclusion { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This property has no effect when the project does not include the Physics 2D module.
checkFor3DOcclusion
Whether or not 3D occlusion is checked when performing ray casts. Enable to make Graphics be blocked by 3D objects that exist in front of it.
Declaration
public bool checkFor3DOcclusion { get; set; }
Property Value
Type | Description |
---|---|
bool |
eventCamera
Declaration
public override Camera eventCamera { get; }
Property Value
Type | Description |
---|---|
Camera |
Overrides
ignoreReversedGraphics
Whether Graphics facing away from the ray caster are checked for ray casts. Enable this to ignore backfacing Graphics.
Declaration
public bool ignoreReversedGraphics { get; set; }
Property Value
Type | Description |
---|---|
bool |
pokeStateData
IRead
Declaration
public IReadOnlyBindableVariable<PokeStateData> pokeStateData { get; }
Property Value
Type | Description |
---|---|
IRead |
See Also
raycastTriggerInteraction
Specifies whether the ray cast should hit Triggers when checking for 3D occlusion.
Declaration
public QueryTriggerInteraction raycastTriggerInteraction { get; set; }
Property Value
Type | Description |
---|---|
Query |
Remarks
When set to Use
Methods
Awake()
See MonoBehaviour.Awake.
Declaration
protected override void Awake()
Overrides
GetPokeStateDataForTarget(Transform)
Gets the Poke
Declaration
public IReadOnlyBindableVariable<PokeStateData> GetPokeStateDataForTarget(Transform target)
Parameters
Type | Name | Description |
---|---|---|
Transform | target | The target to get the Poke |
Returns
Type | Description |
---|---|
IRead |
Returns an IRead |
IsPokeInteractingWithUI(IUIInteractor)
Checks if poke interactor is interacting with any raycaster in the scene.
Declaration
public static bool IsPokeInteractingWithUI(IUIInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IUIInteractor | interactor | The IUIInteractor to check against, typically an XRPoke |
Returns
Type | Description |
---|---|
bool | Returns true if the poke interactor is hovering or selecting any graphic in the scene. |
IsPokeSelectingWithUI(IUIInteractor)
This method is used to determine if the poke interactor has met the requirements for selecting. This can be treated like the equivalent of left mouse down for a mouse.
Declaration
public static bool IsPokeSelectingWithUI(IUIInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IUIInteractor | interactor | The IUIInteractor to check against, typically an XRPoke |
Returns
Type | Description |
---|---|
bool | Returns true if the IUIInteractor meets requirements for poke with any Tracked |
OnDestroy()
Declaration
protected override void OnDestroy()
Overrides
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnDrawGizmosSelected()
See Mono
Declaration
[Conditional("UNITY_EDITOR")]
protected void OnDrawGizmosSelected()
Raycast(PointerEventData, List<RaycastResult>)
Performs a ray cast against objects within this Raycaster's domain.
Declaration
public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
Parameters
Type | Name | Description |
---|---|---|
Pointer |
eventData | Data containing where and how to ray cast. |
List<Raycast |
resultAppendList | The resultant hits from the ray cast. |
Overrides
TryGetPokeStateDataForInteractor(IUIInteractor, out PokeStateData)
Attempts to get the Poke
Declaration
public static bool TryGetPokeStateDataForInteractor(IUIInteractor interactor, out PokeStateData data)
Parameters
Type | Name | Description |
---|---|---|
IUIInteractor | interactor | The IUIInteractor to check against, typically an XRPoke |
Poke |
data | The Poke |
Returns
Type | Description |
---|---|
bool | Returns true if the poke interactor is hovering or selecting any graphic in the scene
and thus its associated Poke |