The '''Interaction Handler''' component is used to control and handle the user interactions like grabbing, tooltips, and all general controls for the user regarding their hands.
<!--T:2-->
<!--T:2-->
Line 12:
Line 12:
{{Table ComponentFields
{{Table ComponentFields
|Side|Chirality|Specifies Left or Right Hand
|Side|Chirality|Specifies Left or Right Hand
|LocomotionController|LocomotionController|
|LocomotionController|{{RootFieldType|RelayRef`1|[[Component:LocomotionController|LocomotionController]]}}|TypeAdv1=true| The locomotion controller the user is using
|GrabSmoothing|Float|
|GrabSmoothing|Float| How much to smooth grabbing interactions
|_streamDriver|CommonToolStreamDriver|
|_streamDriver|'''[[Component:InteractionHandlerStreamDriver|InteractionHandlerStreamDriver]]'''|TypeAdv3=true| The stream providing info from the user regarding interaction using hands.
|_undoItem|ContextMenuItem|
|_undoItem|'''[[Component:ContextMenuItem|ContextMenuItem]]'''|TypeAdv4=true| The context menu item used to [[undo]] actions for this user.
|_redoItem|ContextMenuItem|
|_redoItem|'''[[Component:ContextMenuItem|ContextMenuItem]]'''|TypeAdv5=true| The context menu item used to [[undo|redo]] actions for this user.
|ContextMenu|ContextMenu|
|ContextMenu|'''[[Component:ContextMenu|ContextMenu]]'''|TypeAdv6=true| The context menu for the user.
|EquippingEnabled|Bool|
|EquippingEnabled|Bool| Whether the user can equip stuff.
|MenuEnabled|Bool|
|MenuEnabled|Bool| Whether the user can use their menu.
|UserScalingEnabled|Bool|
|UserScalingEnabled|Bool| Whether the user can scale themselves.
|VisualEnabled|Bool|
|VisualEnabled|Bool| Whether the user's visual is enabled.
|PointingGrab|Bool|
|PointingGrab|Bool| Whether the user is grabbing with this hand via the pointer. (remote grabbing)
|PointingTouch|Bool|
|PointingTouch|Bool| Whether the user is physical grabbing with this hand.
|_tooltipRoot|Slot|
|_toolRoot|Slot| The root of the tool equipped to this hand currently.
|_laserSlot|Slot|
|_laserSlot|Slot| The laser object slot of this hand.
|_holderAxisOffset|Float| The holder axis offset for this hand.
|_originalTwistOffset|Float|
|_holderRotationOffset|FloatQ| The holder rotation offset for this hand. used for laser rotation.
|_userspaceToggleIndicator|RingMesh|
|_holderRotationReference|'''[[Type:Nullable`1|Nullable`1]]<[[Type:FloatQ|FloatQ]]>'''|TypeAdv26=true| the reference value for the holder rotation for this hand. used for laser rotation.
|ShowInteractionHints|Bool| Whether to show tooltip interaction hints for this hand for the user.
|_grabIgnoreRoot|Slot|
|_grabberSphereActive|{{RootFieldType|FieldDrive`1|[[Type:Bool|Bool]]}}|TypeAdv31=true| The field to drive with whether the grab sphere visual should be visible.
|_grabber|Grabber|
|_grabIgnoreRoot|Slot| The slot which to ignore grabbable objects for this hand.
|_currentGrabType|GrabType|
|_grabber|'''[[Component:Grabber|Grabber]]'''|TypeAdv33=true| The grabber component for this hand to handle grabbing objects.
|ActiveToolLink|{{RootFieldType|LinkTargetRef`1|[[Type:ITool|ITool]]}}|TypeAdv35=true| The link that references to the active tool for this hand. Points to the <code>_equipLink</code> on the equipped tool for this hand.
|_tooltipLocked|Bool|
|_activeToolGripPoseReference|'''[[Component:GripPoseReference|GripPoseReference]]'''|TypeAdv36=true| The grip pose reference to use for positioning the active tool for the user in this hand.
|_tooltipSynchronizer|ChildrenSynchronizer|
|_toolLocked|Bool| Whether the tool is equipped and locked into place.
|_grabMaterial|FresnelMaterial|
|_grabMaterial|'''[[Component:FresnelMaterial|FresnelMaterial]]'''|TypeAdv38=true| The material used for the grab sphere visual for this hand.
|_itemShelfSlot|Slot|
|_itemShelfSlot|Slot| The slot for the current item shelf on the user.
|_itemShelf|ItemShelf|
|_itemShelf|'''[[Component:ItemShelf|ItemShelf]]'''|TypeAdv40=true| The component for the current item shelf on the user.
|_shelfItemSynchronizer|ChildrenSynchronizer|
}}
== Sync Delegates ==
{{Table ComponentTriggers
|Dequip:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The button handler for dequipping a tool on this hand.
|EquipGrabbed:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for equipping a grabbed tool on this hand.
|OpenLocomotionMenu:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for opening the locomotion on this hand via the menu.
|OpenGrabbingMenu:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for opening the grabbing options on this hand via the menu.
|OpenHandGrabMenu:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for opening the hand grabbing options on this hand via the menu.
|SetLocomotion:[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Type:ILocomotionModule|ILocomotionModule]]>|[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Type:ILocomotionModule|ILocomotionModule]]>|true| The handler for setting the active locomotion on this hand via the menu.
|SetGrabType:[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Component:InteractionHandler#HandGrabType|InteractionHandler.HandGrabType]]>|[[Type:ButtonEventHandler`1|ButtonEventHandler`1]]<[[Component:InteractionHandler#HandGrabType|InteractionHandler.HandGrabType]]>|true| The handler for setting the hand grab type on this hand via the menu.
|DestroyGrabbed:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for destroying the grabbed objects on this hand via the menu.
|DuplicateGrabbed:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for duplicating the grabbed objects on this hand via the menu.
|SaveGrabbed:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for saving the grabbed objects on this hand via the menu.
|Undo:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for redoing an action via the menu on this hand.
|Redo:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for undoing an action via the menu on this hand.
|ResetUserScale:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for resetting the user's scale via the menu on this hand.
|OnStraighten:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for straightening the grabbed object to the closest vertical axis on this hand.
|OnRotateUp:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for rotating the grabbed object to the up direction on this hand,
|OnRotateRight:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for rotating the grabbed object to the right direction on this hand,
|OnRotateForward:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for rotating the grabbed object to the forward direction on this hand,
|OnRotateUnconstrained:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| The handler for rotating the grabbed object on this hand,
}}
== HandGrabType ==
used when [[#GrabType|InteractionHandler.GrabType]] is set to "Hand"
{{Table EnumValues
|Palm|0| Grab via grab sphere influence.
|Precision|1| Grab via whatever grabbable intercects the center point of the grab sphere.
|Auto|2| Automatically decide whether to use "Palm" or "Precision".
|Off|3| Hand grabbing is disabled.
}}
== LaserRotationType ==
{{Table EnumValues
|AxisX|0| Rotate the grabbed item along the X axis.
|AxisY|1| Rotate the grabbed item along the Y axis.
|AxisZ|2| Rotate the grabbed item along the Z axis.
|Unconstrained|3| Rotate the grabbed item along any axis. even all 3 at once.
}}
== GrabType ==
{{Table EnumValues
|None|0| No grabbing allowed.
|Hand|1| Grab via hand only.
|Laser|2| Grab via laser only.
|Touch|3| Grab via touch only.
}}
}}
== Usage ==
== Usage ==
{{stub}}
<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
Found on the right and left controller objects which are slots under the user's root slot.
Interaction Handler component as seen in the Scene Inspector
The Interaction Handler component is used to control and handle the user interactions like grabbing, tooltips, and all general controls for the user regarding their hands.