Edit

Share via


NearInteractionTouchable Class

Definition

Add a NearInteractionTouchable to your scene and configure a touchable surface in order to get PointerDown and PointerUp events whenever a PokePointer touches this surface.

public ref class NearInteractionTouchable : Microsoft::MixedReality::Toolkit::Input::NearInteractionTouchableSurface
[UnityEngine.AddComponentMenu("Scripts/MRTK/Services/NearInteractionTouchable")]
public class NearInteractionTouchable : Microsoft.MixedReality.Toolkit.Input.NearInteractionTouchableSurface
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Services/NearInteractionTouchable")>]
type NearInteractionTouchable = class
    inherit NearInteractionTouchableSurface
Public Class NearInteractionTouchable
Inherits NearInteractionTouchableSurface
Inheritance
UnityEngine.MonoBehaviour
NearInteractionTouchable
Attributes
UnityEngine.AddComponentMenuAttribute

Constructors

NearInteractionTouchable()

Fields

bounds
debounceThreshold (Inherited from BaseNearInteractionTouchable)
eventsToReceive (Inherited from BaseNearInteractionTouchable)
localCenter
localForward
localUp

Properties

AreLocalVectorsOrthogonal

Returns true if the LocalForward and LocalUp vectors are orthogonal.

Bounds

Bounds or size of the 2D NearInteractionTouchablePlane

ColliderEnabled

Check if the touchableCollider is enabled and in the gameObject hierarchy

DebounceThreshold

Distance in front of the surface at which you will receive a touch completed event.

(Inherited from BaseNearInteractionTouchable)
EventsToReceive

The type of event to receive.

(Inherited from BaseNearInteractionTouchable)
Forward

Forward direction of the gameObject

LocalCenter

Local space object center

LocalForward

Local space forward direction

LocalPressDirection

Forward direction of the NearInteractionTouchable plane, the press direction needs to face the camera.

LocalRight

Local space and gameObject right

LocalUp

Local space up direction

TouchableCollider

BoxCollider used to calculate bounds and local center, if not set before runtime the gameObjects's BoxCollider will be used by default

Methods

DistanceToTouchable(Vector3, Vector3) UnityEngine.MonoBehaviour.DistanceToTouchable(UnityEngine.Vector3,UnityEngine.Vector3@)
OnValidate()
SetBounds(Vector2)

Set the size (bounds) of the 2D NearInteractionTouchable plane.

SetLocalCenter(Vector3)

Set the position (center) of the NearInteractionTouchable plane relative to the gameObject.
The position of the plane should be in front of the gameObject.

SetLocalForward(Vector3)

Set local forward direction and ensure that local up is perpendicular to the new local forward and local right direction. The forward position should be facing the camera. The direction is indicated in scene view by a white arrow in the center of the plane.

SetLocalUp(Vector3)

Set new local up direction and ensure that local forward is perpendicular to the new local up and local right direction.

SetTouchableCollider(BoxCollider)

Adjust the bounds, local center and local forward to match a given box collider. This method also changes the size of the box collider attached to the gameObject. Default Behavior: if touchableCollider is null at runtime, the object's box collider will be used to size and place the NearInteractionTouchable plane in front of the gameObject

Applies to