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

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

    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

    ConstraintsManager

    Constraint manager slot to enable constraints when manipulating the object.

    Declaration
    public ConstraintManager ConstraintsManager { get; set; }
    Property Value
    Type Description
    ConstraintManager

    ElasticsManager

    Elastics Manager slot to enable elastics simulation when manipulating the object.

    Declaration
    public ElasticsManager ElasticsManager { get; set; }
    Property Value
    Type Description
    ElasticsManager

    EnableConstraints

    Enable or disable constraint support of this component. When enabled, transform changes will be post processed by the linked constraint manager.

    Declaration
    public bool EnableConstraints { 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

    Obsolete: Whether to enable frame-rate independent smoothing.

    Declaration
    [Obsolete("SmoothingActive is obsolete and will be removed in a future version. Applications should use SmoothingFar, SmoothingNear or a combination of the two.")]
    public bool SmoothingActive { get; set; }
    Property Value
    Type Description
    Boolean

    SmoothingFar

    Whether to enable frame-rate independent smoothing for far interactions.

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

    Far smoothing is enabled by default.

    SmoothingNear

    Whether to enable frame-rate independent smoothing for near interactions.

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

    Note that enabling near smoothing may be perceived as being 'disconnected' from the hand.

    TwoHandedManipulationType

    What manipulation will two hands perform?

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

    UseForcesForNearManipulation

    Whether physics forces are used to move the object when performing near manipulations.

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

    Setting this to false will make the object feel more directly connected to the users hand. Setting this to true will honor the mass and inertia of the object, but may feel as though the object is connected through a spring. The default is false.

    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
    Back to top Generated by DocFX