日本語翻訳ドキュメントはサポートを終了しました

MRTK 2.6 以降のドキュメントについては、公式の Microsoft ドキュメント を参照してください。

    Show / Hide Table of Contents

    Class NearInteractionTouchable

    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.

    Inheritance
    Object
    BaseNearInteractionTouchable
    NearInteractionTouchableSurface
    NearInteractionTouchable
    Inherited Members
    BaseNearInteractionTouchable.eventsToReceive
    BaseNearInteractionTouchable.EventsToReceive
    BaseNearInteractionTouchable.debounceThreshold
    BaseNearInteractionTouchable.DebounceThreshold
    Namespace: Microsoft.MixedReality.Toolkit.Input
    Assembly: cs.temp.dll.dll
    Syntax
    public class NearInteractionTouchable : NearInteractionTouchableSurface

    Fields

    bounds

    Declaration
    protected Vector2 bounds
    Field Value
    Type Description
    Vector2

    localCenter

    Declaration
    protected Vector3 localCenter
    Field Value
    Type Description
    Vector3

    localForward

    Declaration
    protected Vector3 localForward
    Field Value
    Type Description
    Vector3

    localUp

    Declaration
    protected Vector3 localUp
    Field Value
    Type Description
    Vector3

    Properties

    AreLocalVectorsOrthogonal

    Returns true if the LocalForward and LocalUp vectors are orthogonal.

    Declaration
    public bool AreLocalVectorsOrthogonal { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    LocalRight is computed using the cross product and is always orthogonal to LocalForward and LocalUp.

    Bounds

    Bounds or size of the 2D NearInteractionTouchablePlane

    Declaration
    public override Vector2 Bounds { get; }
    Property Value
    Type Description
    Vector2
    Overrides
    NearInteractionTouchableSurface.Bounds

    ColliderEnabled

    Check if the touchableCollider is enabled and in the gameObject hierarchy

    Declaration
    public bool ColliderEnabled { get; }
    Property Value
    Type Description
    Boolean

    Forward

    Forward direction of the gameObject

    Declaration
    public Vector3 Forward { get; }
    Property Value
    Type Description
    Vector3

    LocalCenter

    Local space object center

    Declaration
    public override Vector3 LocalCenter { get; }
    Property Value
    Type Description
    Vector3
    Overrides
    NearInteractionTouchableSurface.LocalCenter

    LocalForward

    Local space forward direction

    Declaration
    public Vector3 LocalForward { get; }
    Property Value
    Type Description
    Vector3

    LocalPressDirection

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

    Declaration
    public override Vector3 LocalPressDirection { get; }
    Property Value
    Type Description
    Vector3
    Overrides
    NearInteractionTouchableSurface.LocalPressDirection

    LocalRight

    Local space and gameObject right

    Declaration
    public Vector3 LocalRight { get; }
    Property Value
    Type Description
    Vector3

    LocalUp

    Local space up direction

    Declaration
    public Vector3 LocalUp { get; }
    Property Value
    Type Description
    Vector3

    TouchableCollider

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

    Declaration
    public Collider TouchableCollider { get; }
    Property Value
    Type Description
    Collider

    Methods

    DistanceToTouchable(Vector3, out Vector3)

    Declaration
    public override float DistanceToTouchable(Vector3 samplePoint, out Vector3 normal)
    Parameters
    Type Name Description
    Vector3 samplePoint
    Vector3 normal
    Returns
    Type Description
    Single
    Overrides
    BaseNearInteractionTouchable.DistanceToTouchable(Vector3, out Vector3)

    OnValidate()

    Declaration
    protected override void OnValidate()
    Overrides
    BaseNearInteractionTouchable.OnValidate()

    SetBounds(Vector2)

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

    Declaration
    public void SetBounds(Vector2 newBounds)
    Parameters
    Type Name Description
    Vector2 newBounds

    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.

    Declaration
    public void SetLocalCenter(Vector3 newLocalCenter)
    Parameters
    Type Name Description
    Vector3 newLocalCenter

    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.

    Declaration
    public void SetLocalForward(Vector3 newLocalForward)
    Parameters
    Type Name Description
    Vector3 newLocalForward

    SetLocalUp(Vector3)

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

    Declaration
    public void SetLocalUp(Vector3 newLocalUp)
    Parameters
    Type Name Description
    Vector3 newLocalUp

    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

    Declaration
    public void SetTouchableCollider(BoxCollider newCollider)
    Parameters
    Type Name Description
    BoxCollider newCollider
    Back to top Generated by DocFX