mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0

    Show / Hide Table of Contents

    Class ObjectManipulator

    This script allows for an object to be movable, scalable, and rotatable with one or two hands. You may also configure the script on only enable certain manipulations. The script works with both HoloLens' gesture input and immersive headset's motion controller input.

    Inheritance
    Object
    ObjectManipulator
    Implements
    IMixedRealityPointerHandler
    IMixedRealityFocusChangedHandler
    Namespace: Microsoft.MixedReality.Toolkit.UI
    Assembly: cs.temp.dll.dll
    Syntax
    public class ObjectManipulator : MonoBehaviour, IMixedRealityPointerHandler, IMixedRealityFocusChangedHandler

    Properties

    AllowFarManipulation

    Specifies whether manipulation can be done using far interaction with pointers.

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

    HostTransform

    Transform that will be dragged. Defaults to the object of the component.

    Declaration
    public Transform HostTransform { get; set; }
    Property Value
    Type Description
    Transform

    ManipulationType

    Can manipulation be done only with one hand, only with two hands, or with both?

    Declaration
    public ManipulationHandFlags ManipulationType { get; set; }
    Property Value
    Type Description
    ManipulationHandFlags

    MoveLerpTime

    Enter amount representing amount of smoothing to apply to the movement. Smoothing of 0 means no smoothing. Max value means no change to value.

    Declaration
    public float MoveLerpTime { get; set; }
    Property Value
    Type Description
    Single

    OneHandRotationModeFar

    Rotation behavior of object when using one hand at distance

    Declaration
    public ObjectManipulator.RotateInOneHandType OneHandRotationModeFar { get; set; }
    Property Value
    Type Description
    ObjectManipulator.RotateInOneHandType

    OneHandRotationModeNear

    Rotation behavior of object when using one hand near

    Declaration
    public ObjectManipulator.RotateInOneHandType OneHandRotationModeNear { get; set; }
    Property Value
    Type Description
    ObjectManipulator.RotateInOneHandType

    OnHoverEntered

    Unity event raised on hover started

    Declaration
    public ManipulationEvent OnHoverEntered { get; set; }
    Property Value
    Type Description
    ManipulationEvent

    OnHoverExited

    Unity event raised on hover ended

    Declaration
    public ManipulationEvent OnHoverExited { get; set; }
    Property Value
    Type Description
    ManipulationEvent

    OnManipulationEnded

    Unity event raised on manipulation ended

    Declaration
    public ManipulationEvent OnManipulationEnded { get; set; }
    Property Value
    Type Description
    ManipulationEvent

    OnManipulationStarted

    Unity event raised on manipulation started

    Declaration
    public ManipulationEvent OnManipulationStarted { get; set; }
    Property Value
    Type Description
    ManipulationEvent

    ReleaseBehavior

    Rigid body behavior of the dragged object when releasing it.

    Declaration
    public ObjectManipulator.ReleaseBehaviorType ReleaseBehavior { get; set; }
    Property Value
    Type Description
    ObjectManipulator.ReleaseBehaviorType

    RotateLerpTime

    Enter amount representing amount of smoothing to apply to the rotation. Smoothing of 0 means no smoothing. Max value means no change to value.

    Declaration
    public float RotateLerpTime { get; set; }
    Property Value
    Type Description
    Single

    ScaleLerpTime

    Enter amount representing amount of smoothing to apply to the scale. Smoothing of 0 means no smoothing. Max value means no change to value.

    Declaration
    public float ScaleLerpTime { get; set; }
    Property Value
    Type Description
    Single

    SmoothingActive

    Check to enable frame-rate independent smoothing.

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

    TwoHandedManipulationType

    What manipulation will two hands perform?

    Declaration
    public TransformFlags TwoHandedManipulationType { get; set; }
    Property Value
    Type Description
    TransformFlags

    Methods

    ForceEndManipulation()

    Releases the object that is currently manipulated

    Declaration
    public void ForceEndManipulation()

    GetPointerGrabPoint(UInt32)

    Gets the grab point for the given pointer id. Only use if you know that your given pointer id corresponds to a pointer that has grabbed this component.

    Declaration
    public Vector3 GetPointerGrabPoint(uint pointerId)
    Parameters
    Type Name Description
    UInt32 pointerId
    Returns
    Type Description
    Vector3

    OnBeforeFocusChange(FocusEventData)

    Declaration
    public void OnBeforeFocusChange(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnFocusChanged(FocusEventData)

    Declaration
    public void OnFocusChanged(FocusEventData eventData)
    Parameters
    Type Name Description
    FocusEventData eventData

    OnPointerClicked(MixedRealityPointerEventData)

    Declaration
    public void OnPointerClicked(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnPointerDown(MixedRealityPointerEventData)

    Declaration
    public void OnPointerDown(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnPointerDragged(MixedRealityPointerEventData)

    Declaration
    public void OnPointerDragged(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    OnPointerUp(MixedRealityPointerEventData)

    Declaration
    public void OnPointerUp(MixedRealityPointerEventData eventData)
    Parameters
    Type Name Description
    MixedRealityPointerEventData eventData

    Implements

    IMixedRealityPointerHandler
    IMixedRealityFocusChangedHandler
    In This Article
    • Properties
      • AllowFarManipulation
      • HostTransform
      • ManipulationType
      • MoveLerpTime
      • OneHandRotationModeFar
      • OneHandRotationModeNear
      • OnHoverEntered
      • OnHoverExited
      • OnManipulationEnded
      • OnManipulationStarted
      • ReleaseBehavior
      • RotateLerpTime
      • ScaleLerpTime
      • SmoothingActive
      • TwoHandedManipulationType
    • Methods
      • ForceEndManipulation()
      • GetPointerGrabPoint(UInt32)
      • OnBeforeFocusChange(FocusEventData)
      • OnFocusChanged(FocusEventData)
      • OnPointerClicked(MixedRealityPointerEventData)
      • OnPointerDown(MixedRealityPointerEventData)
      • OnPointerDragged(MixedRealityPointerEventData)
      • OnPointerUp(MixedRealityPointerEventData)
    • Implements
    Back to top Generated by DocFX