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
ObjectManipulator
Implements
IMixedRealityPointerHandler
IMixedRealityFocusChangedHandler
Assembly: cs.temp.dll.dll
public class ObjectManipulator : MonoBehaviour, IMixedRealityPointerHandler, IMixedRealityFocusChangedHandler
Properties
Specifies whether manipulation can be done using far interaction with pointers.
Declaration
public bool AllowFarManipulation { get; set; }
Property Value
Constraint manager slot to enable constraints when manipulating the object.
Declaration
public ConstraintManager ConstraintsManager { get; set; }
Property Value
Elastics Manager slot to enable elastics simulation when manipulating the object.
Declaration
public ElasticsManager ElasticsManager { get; set; }
Property Value
Type |
Description |
ElasticsManager |
|
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
Transform that will be dragged. Defaults to the object of the component.
Declaration
public Transform HostTransform { get; set; }
Property Value
Type |
Description |
Transform |
|
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 |
|
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
Rotation behavior of object when using one hand at distance
Declaration
public ObjectManipulator.RotateInOneHandType OneHandRotationModeFar { get; set; }
Property Value
Rotation behavior of object when using one hand near
Declaration
public ObjectManipulator.RotateInOneHandType OneHandRotationModeNear { get; set; }
Property Value
Unity event raised on hover started
Declaration
public ManipulationEvent OnHoverEntered { get; set; }
Property Value
Unity event raised on hover ended
Declaration
public ManipulationEvent OnHoverExited { get; set; }
Property Value
Unity event raised on manipulation ended
Declaration
public ManipulationEvent OnManipulationEnded { get; set; }
Property Value
Unity event raised on manipulation started
Declaration
public ManipulationEvent OnManipulationStarted { get; set; }
Property Value
Rigid body behavior of the dragged object when releasing it.
Declaration
public ObjectManipulator.ReleaseBehaviorType ReleaseBehavior { get; set; }
Property Value
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
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
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
Whether to enable frame-rate independent smoothing for far interactions.
Declaration
public bool SmoothingFar { get; set; }
Property Value
Whether to enable frame-rate independent smoothing for near interactions.
Declaration
public bool SmoothingNear { get; set; }
Property Value
What manipulation will two hands perform?
Declaration
public TransformFlags TwoHandedManipulationType { get; set; }
Property Value
Type |
Description |
TransformFlags |
|
Whether physics forces are used to move the object when performing near manipulations.
Declaration
public bool UseForcesForNearManipulation { get; set; }
Property Value
Methods
Releases the object that is currently manipulated
Declaration
public void ForceEndManipulation()
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
Declaration
public void OnBeforeFocusChange(FocusEventData eventData)
Parameters
Type |
Name |
Description |
FocusEventData |
eventData |
|
Declaration
public void OnFocusChanged(FocusEventData eventData)
Parameters
Type |
Name |
Description |
FocusEventData |
eventData |
|
Declaration
public void OnPointerClicked(MixedRealityPointerEventData eventData)
Parameters
Type |
Name |
Description |
MixedRealityPointerEventData |
eventData |
|
Declaration
public void OnPointerDown(MixedRealityPointerEventData eventData)
Parameters
Type |
Name |
Description |
MixedRealityPointerEventData |
eventData |
|
Declaration
public void OnPointerDragged(MixedRealityPointerEventData eventData)
Parameters
Type |
Name |
Description |
MixedRealityPointerEventData |
eventData |
|
Declaration
public void OnPointerUp(MixedRealityPointerEventData eventData)
Parameters
Type |
Name |
Description |
MixedRealityPointerEventData |
eventData |
|
Implements
IMixedRealityPointerHandler
IMixedRealityFocusChangedHandler