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
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
Check to enable frame-rate independent smoothing.
Declaration
public bool SmoothingActive { get; set; }
Property Value
What manipulation will two hands perform?
Declaration
public TransformFlags TwoHandedManipulationType { get; set; }
Property Value
Type |
Description |
TransformFlags |
|
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