diff --git a/Assets/MixedRealityToolkit/InputSystem/Cursors/BaseCursor.cs b/Assets/MixedRealityToolkit/InputSystem/Cursors/BaseCursor.cs index 7dea62a094a..a3181374f52 100644 --- a/Assets/MixedRealityToolkit/InputSystem/Cursors/BaseCursor.cs +++ b/Assets/MixedRealityToolkit/InputSystem/Cursors/BaseCursor.cs @@ -170,10 +170,6 @@ public virtual void OnSourceLost(SourceStateEventData eventData) } } - public virtual void OnSourcePositionChanged(SourcePositionEventData eventData) { } - - public virtual void OnSourceRotationChanged(SourceRotationEventData eventData) { } - #endregion IMixedRealitySourceStateHandler Implementation #region IMixedRealityFocusChangedHandler Implementation @@ -200,7 +196,7 @@ public virtual void OnFocusChanged(FocusEventData eventData) { } /// Function for receiving OnPointerDown events from InputManager /// /// - public virtual void OnPointerDown(ClickEventData eventData) + public virtual void OnPointerDown(InputClickEventData eventData) { foreach (var sourcePointer in eventData.InputSource.Pointers) { @@ -215,13 +211,13 @@ public virtual void OnPointerDown(ClickEventData eventData) /// Function for receiving OnPointerClicked events from InputManager /// /// - public virtual void OnPointerClicked(ClickEventData eventData) { } + public virtual void OnPointerClicked(InputClickEventData eventData) { } /// /// Function for receiving OnPointerUp events from InputManager /// /// - public virtual void OnPointerUp(ClickEventData eventData) + public virtual void OnPointerUp(InputClickEventData eventData) { foreach (var sourcePointer in eventData.InputSource.Pointers) { diff --git a/Assets/MixedRealityToolkit/InputSystem/Focus/FocusProvider.cs b/Assets/MixedRealityToolkit/InputSystem/Focus/FocusProvider.cs index 35c4c1dabcc..82ca30c8d7c 100644 --- a/Assets/MixedRealityToolkit/InputSystem/Focus/FocusProvider.cs +++ b/Assets/MixedRealityToolkit/InputSystem/Focus/FocusProvider.cs @@ -892,10 +892,6 @@ public void OnSourceLost(SourceStateEventData eventData) } } - public void OnSourcePositionChanged(SourcePositionEventData eventData) { } - - public void OnSourceRotationChanged(SourceRotationEventData eventData) { } - #endregion ISourceState Implementation } } diff --git a/Assets/MixedRealityToolkit/InputSystem/MixedRealityInputManager.cs b/Assets/MixedRealityToolkit/InputSystem/MixedRealityInputManager.cs index 405cc65a46b..2ddbc4df198 100644 --- a/Assets/MixedRealityToolkit/InputSystem/MixedRealityInputManager.cs +++ b/Assets/MixedRealityToolkit/InputSystem/MixedRealityInputManager.cs @@ -47,14 +47,16 @@ public class MixedRealityInputManager : MixedRealityEventManager, IMixedRealityI private int disabledRefCount; private SourceStateEventData sourceStateEventData; - private SourcePositionEventData sourcePositionEventData; - private SourceRotationEventData sourceRotationEventData; private FocusEventData focusEventData; + private InputEventData inputEventData; + private InputClickEventData inputClickEventData; private InputPressedEventData inputPressedEventData; - private ClickEventData clickEventData; - private DualAxisInputEventData dualAxisInputEventData; + + private TwoDoFInputEventData twoDoFInputEventData; + private ThreeDoFInputEventData threeDoFInputEventData; + private SixDoFInputEventData sixDoFInputEventData; private NavigationEventData navigationEventData; private ManipulationEventData manipulationEventData; @@ -79,15 +81,16 @@ private void InitializeInternal() GazeProvider = CameraCache.Main.gameObject.EnsureComponent(); sourceStateEventData = new SourceStateEventData(EventSystem.current); - sourcePositionEventData = new SourcePositionEventData(EventSystem.current); - sourceRotationEventData = new SourceRotationEventData(EventSystem.current); - clickEventData = new ClickEventData(EventSystem.current); focusEventData = new FocusEventData(EventSystem.current); inputEventData = new InputEventData(EventSystem.current); + inputClickEventData = new InputClickEventData(EventSystem.current); inputPressedEventData = new InputPressedEventData(EventSystem.current); - dualAxisInputEventData = new DualAxisInputEventData(EventSystem.current); + + twoDoFInputEventData = new TwoDoFInputEventData(EventSystem.current); + threeDoFInputEventData = new ThreeDoFInputEventData(EventSystem.current); + sixDoFInputEventData = new SixDoFInputEventData(EventSystem.current); navigationEventData = new NavigationEventData(EventSystem.current); manipulationEventData = new ManipulationEventData(EventSystem.current); @@ -349,10 +352,10 @@ public uint GenerateNewSourceId() } /// - public void RaiseSourceDetected(IMixedRealityInputSource source, object[] tags = null) + public void RaiseSourceDetected(IMixedRealityInputSource source) { // Create input event - sourceStateEventData.Initialize(source, tags); + sourceStateEventData.Initialize(source); AddSource(source); } @@ -374,10 +377,11 @@ private void AddSource(IMixedRealityInputSource source) handler.OnSourceDetected(casted); }; - public void RaiseSourceLost(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseSourceLost(IMixedRealityInputSource source) { // Create input event - sourceStateEventData.Initialize(source, tags); + sourceStateEventData.Initialize(source); RemoveSource(source); } @@ -399,66 +403,11 @@ private void RemoveSource(IMixedRealityInputSource source) handler.OnSourceLost(casted); }; - public void RaiseSourcePositionChanged(IMixedRealityInputSource source, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null) - { - // Create input event - sourcePositionEventData.Initialize(source, pointerPosition, gripPosition, tags); - - // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(sourcePositionEventData, OnSourcePositionChangedEventHandler); - } - - public void RaiseSourcePositionChanged(IMixedRealityInputSource source, Handedness sourceHandedness, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null) - { - // Create input event - sourcePositionEventData.Initialize(source, sourceHandedness, pointerPosition, gripPosition, tags); - - // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(sourcePositionEventData, OnSourcePositionChangedEventHandler); - } - - private static readonly ExecuteEvents.EventFunction OnSourcePositionChangedEventHandler = - delegate (IMixedRealitySourceStateHandler handler, BaseEventData eventData) - { - var casted = ExecuteEvents.ValidateEventData(eventData); - handler.OnSourcePositionChanged(casted); - }; - - public void RaiseSourceRotationChanged(IMixedRealityInputSource source, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null) - { - // Create input event - sourceRotationEventData.Initialize(source, pointerRotation, gripRotation, tags); - - // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(sourceRotationEventData, OnSourceRotationChangedEventHandler); - } - - public void RaiseSourceRotationChanged(IMixedRealityInputSource source, Handedness sourceHandedness, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null) - { - // Create input event - sourceRotationEventData.Initialize(source, sourceHandedness, pointerRotation, gripRotation, tags); - - // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(sourceRotationEventData, OnSourceRotationChangedEventHandler); - } - - private static readonly ExecuteEvents.EventFunction OnSourceRotationChangedEventHandler = - delegate (IMixedRealitySourceStateHandler handler, BaseEventData eventData) - { - var casted = ExecuteEvents.ValidateEventData(eventData); - handler.OnSourceRotationChanged(casted); - }; - #endregion Input Source State Events #region Focus Events - /// - /// Raise the Pre Focus Changed Event. - /// - /// - /// - /// + /// public void RaisePreFocusChangedEvent(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject) { focusEventData.Initialize(pointer, oldFocusedObject, newFocusedObject); @@ -488,12 +437,7 @@ public void RaisePreFocusChangedEvent(IMixedRealityPointer pointer, GameObject o handler.OnBeforeFocusChange(casted); }; - /// - /// Raise focus enter and exit events for when an input (that supports pointing) points to a game object. - /// - /// - /// - /// + /// public void OnFocusChangedEvent(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject) { focusEventData.Initialize(pointer, oldFocusedObject, newFocusedObject); @@ -523,11 +467,7 @@ public void OnFocusChangedEvent(IMixedRealityPointer pointer, GameObject oldFocu handler.OnFocusChanged(casted); }; - /// - /// Raise the event OnBeforeFocusChange to the game object when focus enters it. - /// - /// The pointer that focused the GameObject. - /// The GameObject that is focused. + /// public void RaiseFocusEnter(IMixedRealityPointer pointer, GameObject focusedObject) { focusEventData.Initialize(pointer); @@ -548,11 +488,7 @@ public void RaiseFocusEnter(IMixedRealityPointer pointer, GameObject focusedObje handler.OnFocusEnter(casted); }; - /// - /// Raise the event OnFocusExit to the game object when focus exists it. - /// - /// The pointer that unfocused the GameObject. - /// The GameObject that is unfocused. + /// public void RaiseFocusExit(IMixedRealityPointer pointer, GameObject unfocusedObject) { focusEventData.Initialize(pointer); @@ -582,11 +518,11 @@ public void RaiseFocusExit(IMixedRealityPointer pointer, GameObject unfocusedObj private static readonly ExecuteEvents.EventFunction OnPointerDownEventHandler = delegate (IMixedRealityPointerHandler handler, BaseEventData eventData) { - var casted = ExecuteEvents.ValidateEventData(eventData); + var casted = ExecuteEvents.ValidateEventData(eventData); handler.OnPointerDown(casted); }; - private void ExecutePointerDown(GraphicInputEventData graphicInputEventData) + private static void ExecutePointerDown(GraphicInputEventData graphicInputEventData) { if (graphicInputEventData != null && graphicInputEventData.selectedObject != null) { @@ -597,31 +533,34 @@ private void ExecutePointerDown(GraphicInputEventData graphicInputEventData) private GraphicInputEventData HandlePointerDown(IMixedRealityPointer pointingSource) { // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(clickEventData, OnPointerDownEventHandler); + HandleEvent(inputClickEventData, OnPointerDownEventHandler); return FocusProvider.GetSpecificPointerGraphicEventData(pointingSource); } - public void RaisePointerDown(IMixedRealityPointer pointer, object[] tags = null) + /// + public void RaisePointerDown(IMixedRealityPointer pointer) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, tags); + inputClickEventData.Initialize(pointer.InputSourceParent); ExecutePointerDown(HandlePointerDown(pointer)); } - public void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness, object[] tags = null) + /// + public void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, handedness, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, handedness); ExecutePointerDown(HandlePointerDown(pointer)); } - public void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, object[] tags = null) + /// + public void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness, InputType inputType) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, handedness, inputType, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, handedness, inputType); if (inputType == InputType.Select) { @@ -636,38 +575,41 @@ public void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness private static readonly ExecuteEvents.EventFunction OnInputClickedEventHandler = delegate (IMixedRealityPointerHandler handler, BaseEventData eventData) { - var casted = ExecuteEvents.ValidateEventData(eventData); + var casted = ExecuteEvents.ValidateEventData(eventData); handler.OnPointerClicked(casted); }; private void HandleClick() { // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(clickEventData, OnInputClickedEventHandler); + HandleEvent(inputClickEventData, OnInputClickedEventHandler); // NOTE: In Unity UI, a "click" happens on every pointer up, so we have RaisePointerUp call the pointerClickHandler. } - public void RaiseInputClicked(IMixedRealityPointer pointer, int count, object[] tags = null) + /// + public void RaiseInputClicked(IMixedRealityPointer pointer, int count) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, count, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, count); HandleClick(); } - public void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, int count, object[] tags = null) + /// + public void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, int count) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, count, handedness, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, count, handedness); HandleClick(); } - public void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, int count, object[] tags = null) + /// + public void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, int count) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, count, inputType, handedness, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, count, inputType, handedness); HandleClick(); } @@ -679,11 +621,11 @@ public void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handednes private static readonly ExecuteEvents.EventFunction OnPointerUpEventHandler = delegate (IMixedRealityPointerHandler handler, BaseEventData eventData) { - var casted = ExecuteEvents.ValidateEventData(eventData); + var casted = ExecuteEvents.ValidateEventData(eventData); handler.OnPointerUp(casted); }; - private void ExecutePointerUp(GraphicInputEventData graphicInputEventData) + private static void ExecutePointerUp(GraphicInputEventData graphicInputEventData) { if (graphicInputEventData != null) { @@ -700,31 +642,34 @@ private void ExecutePointerUp(GraphicInputEventData graphicInputEventData) private GraphicInputEventData HandlePointerUp(IMixedRealityPointer pointingSource) { // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(clickEventData, OnPointerUpEventHandler); + HandleEvent(inputClickEventData, OnPointerUpEventHandler); return FocusProvider.GetSpecificPointerGraphicEventData(pointingSource); } - public void RaisePointerUp(IMixedRealityPointer pointer, object[] tags = null) + /// + public void RaisePointerUp(IMixedRealityPointer pointer) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, tags); + inputClickEventData.Initialize(pointer.InputSourceParent); ExecutePointerUp(HandlePointerUp(pointer)); } - public void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, object[] tags = null) + /// + public void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, handedness, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, handedness); ExecutePointerUp(HandlePointerUp(pointer)); } - public void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, object[] tags = null) + /// + public void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, InputType inputType) { // Create input event - clickEventData.Initialize(pointer.InputSourceParent, handedness, inputType, tags); + inputClickEventData.Initialize(pointer.InputSourceParent, handedness, inputType); if (inputType == InputType.Select) { @@ -747,46 +692,51 @@ public void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, handler.OnInputDown(casted); }; - public void RaiseOnInputDown(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseOnInputDown(IMixedRealityInputSource source) { // Create input event - inputEventData.Initialize(source, tags); + inputEventData.Initialize(source); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputDownEventHandler); } - public void RaiseOnInputDown(IMixedRealityInputSource source, KeyCode keyCode, object[] tags = null) + /// + public void RaiseOnInputDown(IMixedRealityInputSource source, KeyCode keyCode) { // Create input event - inputEventData.Initialize(source, keyCode, tags); + inputEventData.Initialize(source, keyCode); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputDownEventHandler); } - public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness) { // Create input event - inputEventData.Initialize(source, handedness, tags); + inputEventData.Initialize(source, handedness); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputDownEventHandler); } - public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, object[] tags = null) + /// + public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode) { // Create input event - inputEventData.Initialize(source, handedness, keyCode, tags); + inputEventData.Initialize(source, handedness, keyCode); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputDownEventHandler); } - public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, InputType inputType, object[] tags = null) + /// + public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, InputType inputType) { // Create input event - inputEventData.Initialize(source, handedness, inputType, tags); + inputEventData.Initialize(source, handedness, inputType); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputDownEventHandler); @@ -803,79 +753,81 @@ public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedn handler.OnInputPressed(casted); }; - public void RaiseOnInputPressed(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseOnInputPressed(IMixedRealityInputSource source) { // Create input event - inputPressedEventData.Initialize(source, tags); + inputPressedEventData.Initialize(source); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } - public void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode, object[] tags = null) + /// + public void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode) { // Create input event - inputPressedEventData.Initialize(source, keyCode, 1D, tags); + inputPressedEventData.Initialize(source, keyCode, 1D); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } /// - public void RaiseOnInputPressed(IMixedRealityInputSource source, double pressAmount, object[] tags = null) + public void RaiseOnInputPressed(IMixedRealityInputSource source, double pressAmount) { // Create input event - inputPressedEventData.Initialize(source, pressAmount, tags); + inputPressedEventData.Initialize(source, pressAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } /// - public void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode, double pressAmount, object[] tags = null) + public void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode, double pressAmount) { // Create input event - inputPressedEventData.Initialize(source, keyCode, pressAmount, tags); + inputPressedEventData.Initialize(source, keyCode, pressAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } /// - public void RaiseOnInputPressed(IMixedRealityInputSource source, InputType inputType, double pressAmount, object[] tags = null) + public void RaiseOnInputPressed(IMixedRealityInputSource source, InputType inputType, double pressAmount) { // Create input event - inputPressedEventData.Initialize(source, inputType, pressAmount, tags); + inputPressedEventData.Initialize(source, inputType, pressAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } /// - public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, double pressAmount, object[] tags = null) + public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, double pressAmount) { // Create input event - inputPressedEventData.Initialize(source, handedness, pressAmount, tags); + inputPressedEventData.Initialize(source, handedness, pressAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } /// - public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, double pressAmount, object[] tags = null) + public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, double pressAmount) { // Create input event - inputPressedEventData.Initialize(source, handedness, keyCode, pressAmount, tags); + inputPressedEventData.Initialize(source, handedness, keyCode, pressAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); } /// - public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, InputType inputType, float pressAmount, object[] tags = null) + public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, InputType inputType, float pressAmount) { // Create input event - inputPressedEventData.Initialize(source, handedness, inputType, pressAmount, tags); + inputPressedEventData.Initialize(source, handedness, inputType, pressAmount); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputPressedEventData, OnInputPressedEventHandler); @@ -892,46 +844,51 @@ public void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness hand handler.OnInputUp(casted); }; - public void RaiseOnInputUp(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseOnInputUp(IMixedRealityInputSource source) { // Create input event - inputEventData.Initialize(source, tags); + inputEventData.Initialize(source); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputUpEventHandler); } - public void RaiseOnInputUp(IMixedRealityInputSource source, KeyCode keyCode, object[] tags = null) + /// + public void RaiseOnInputUp(IMixedRealityInputSource source, KeyCode keyCode) { // Create input event - inputEventData.Initialize(source, keyCode, tags); + inputEventData.Initialize(source, keyCode); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputUpEventHandler); } - public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness) { // Create input event - inputEventData.Initialize(source, handedness, tags); + inputEventData.Initialize(source, handedness); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputUpEventHandler); } - public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, object[] tags = null) + /// + public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode) { // Create input event - inputEventData.Initialize(source, handedness, keyCode, tags); + inputEventData.Initialize(source, handedness, keyCode); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputUpEventHandler); } - public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, InputType inputType, object[] tags = null) + /// + public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, InputType inputType) { // Create input event - inputEventData.Initialize(source, handedness, inputType, tags); + inputEventData.Initialize(source, handedness, inputType); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnInputUpEventHandler); @@ -939,34 +896,118 @@ public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handednes #endregion Input Up - #region Input DualAxis Changed + #region Input 2DoF Changed - private static readonly ExecuteEvents.EventFunction OnDualAxisInputChanged = + private static readonly ExecuteEvents.EventFunction OnTwoDoFInputChanged = delegate (IMixedRealityInputHandler handler, BaseEventData eventData) { - var casted = ExecuteEvents.ValidateEventData(eventData); - handler.OnDualAxisInputChanged(casted); + var casted = ExecuteEvents.ValidateEventData(eventData); + handler.On2DoFInputChanged(casted); + }; + + /// + public void Raise2DoFInputChanged(IMixedRealityInputSource source, InputType inputType, Vector2 inputPosition) + { + // Create input event + twoDoFInputEventData.Initialize(source, inputType, inputPosition); + + // Pass handler through HandleEvent to perform modal/fallback logic + HandleEvent(twoDoFInputEventData, OnTwoDoFInputChanged); + } + + /// + public void Raise2DoFInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Vector2 inputPosition) + { + // Create input event + twoDoFInputEventData.Initialize(source, inputType, inputPosition, handedness); + + // Pass handler through HandleEvent to perform modal/fallback logic + HandleEvent(twoDoFInputEventData, OnTwoDoFInputChanged); + } + + #endregion Input 2Dof Changed + + #region Input 3DoF Changed + + private static readonly ExecuteEvents.EventFunction OnThreeDoFInputChanged = + delegate (IMixedReality3DoFInputHandler handler, BaseEventData eventData) + { + var casted = ExecuteEvents.ValidateEventData(eventData); + handler.On3DoFInputChanged(casted); }; - public void RaiseDualAxisInputChanged(IMixedRealityInputSource source, InputType inputType, Vector2 inputPosition, object[] tags = null) + /// + public void Raise3DoFInputChanged(IMixedRealityInputSource source, InputType inputType, Vector3 position) + { + // Create input event + threeDoFInputEventData.Initialize(source, inputType, position); + + // Pass handler through HandleEvent to perform modal/fallback logic + HandleEvent(threeDoFInputEventData, OnThreeDoFInputChanged); + } + + /// + public void Raise3DoFInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Vector3 position) + { + // Create input event + threeDoFInputEventData.Initialize(source, handedness, inputType, position); + + // Pass handler through HandleEvent to perform modal/fallback logic + HandleEvent(threeDoFInputEventData, OnThreeDoFInputChanged); + } + + /// + public void Raise3DoFInputChanged(IMixedRealityInputSource source, InputType inputType, Quaternion rotation) { // Create input event - dualAxisInputEventData.Initialize(source, inputType, inputPosition, tags); + threeDoFInputEventData.Initialize(source, inputType, rotation); // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(dualAxisInputEventData, OnDualAxisInputChanged); + HandleEvent(threeDoFInputEventData, OnThreeDoFInputChanged); } - public void RaiseDualAxisInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Vector2 inputPosition, object[] tags = null) + /// + public void Raise3DoFInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Quaternion rotation) { // Create input event - dualAxisInputEventData.Initialize(source, inputType, inputPosition, handedness, tags); + threeDoFInputEventData.Initialize(source, handedness, inputType, rotation); // Pass handler through HandleEvent to perform modal/fallback logic - HandleEvent(dualAxisInputEventData, OnDualAxisInputChanged); + HandleEvent(threeDoFInputEventData, OnThreeDoFInputChanged); } - #endregion Input DualAxis Changed + #endregion Input 3DoF Changed + + #region Input 6DoF Changed + + private static readonly ExecuteEvents.EventFunction OnSixDoFInputChanged = + delegate (IMixedReality6DoFInputHandler handler, BaseEventData eventData) + { + var casted = ExecuteEvents.ValidateEventData(eventData); + handler.On6DoFInputChanged(casted); + }; + + /// + public void Raise6DofInputChanged(IMixedRealityInputSource source, InputType inputType, Tuple inputData) + { + // Create input event + sixDoFInputEventData.Initialize(source, inputType, inputData); + + // Pass handler through HandleEvent to perform modal/fallback logic + HandleEvent(threeDoFInputEventData, OnSixDoFInputChanged); + } + + /// + public void Raise6DofInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Tuple inputData) + { + // Create input event + sixDoFInputEventData.Initialize(source, handedness, inputType, inputData); + + // Pass handler through HandleEvent to perform modal/fallback logic + HandleEvent(threeDoFInputEventData, OnSixDoFInputChanged); + } + + #endregion Input 6DoF Changed #endregion Generic Input Events @@ -979,19 +1020,21 @@ public void RaiseDualAxisInputChanged(IMixedRealityInputSource source, Handednes handler.OnHoldStarted(casted); }; - public void RaiseHoldStarted(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseHoldStarted(IMixedRealityInputSource source) { // Create input event - inputEventData.Initialize(source, tags); + inputEventData.Initialize(source); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnHoldStartedEventHandler); } - public void RaiseHoldStarted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseHoldStarted(IMixedRealityInputSource source, Handedness handedness) { // Create input event - inputEventData.Initialize(source, handedness, tags); + inputEventData.Initialize(source, handedness); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnHoldStartedEventHandler); @@ -1004,19 +1047,21 @@ public void RaiseHoldStarted(IMixedRealityInputSource source, Handedness handedn handler.OnHoldCompleted(casted); }; - public void RaiseHoldCompleted(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseHoldCompleted(IMixedRealityInputSource source) { // Create input event - inputEventData.Initialize(source, tags); + inputEventData.Initialize(source); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnHoldCompletedEventHandler); } - public void RaiseHoldCompleted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseHoldCompleted(IMixedRealityInputSource source, Handedness handedness) { // Create input event - inputEventData.Initialize(source, handedness, tags); + inputEventData.Initialize(source, handedness); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnHoldCompletedEventHandler); @@ -1029,19 +1074,21 @@ public void RaiseHoldCompleted(IMixedRealityInputSource source, Handedness hande handler.OnHoldCanceled(casted); }; - public void RaiseHoldCanceled(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseHoldCanceled(IMixedRealityInputSource source) { // Create input event - inputEventData.Initialize(source, tags); + inputEventData.Initialize(source); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnHoldCanceledEventHandler); } - public void RaiseHoldCanceled(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseHoldCanceled(IMixedRealityInputSource source, Handedness handedness) { // Create input event - inputEventData.Initialize(source, handedness, tags); + inputEventData.Initialize(source, handedness); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(inputEventData, OnHoldCanceledEventHandler); @@ -1058,19 +1105,21 @@ public void RaiseHoldCanceled(IMixedRealityInputSource source, Handedness handed handler.OnNavigationStarted(casted); }; - public void RaiseNavigationStarted(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseNavigationStarted(IMixedRealityInputSource source) { // Create input event - navigationEventData.Initialize(source, Vector3.zero, tags); + navigationEventData.Initialize(source, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationStartedEventHandler); } - public void RaiseNavigationStarted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseNavigationStarted(IMixedRealityInputSource source, Handedness handedness) { // Create input event - navigationEventData.Initialize(source, handedness, Vector3.zero, tags); + navigationEventData.Initialize(source, handedness, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationStartedEventHandler); @@ -1083,19 +1132,21 @@ public void RaiseNavigationStarted(IMixedRealityInputSource source, Handedness h handler.OnNavigationUpdated(casted); }; - public void RaiseNavigationUpdated(IMixedRealityInputSource source, Vector3 normalizedOffset, object[] tags = null) + /// + public void RaiseNavigationUpdated(IMixedRealityInputSource source, Vector3 normalizedOffset) { // Create input event - navigationEventData.Initialize(source, normalizedOffset, tags); + navigationEventData.Initialize(source, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationUpdatedEventHandler); } - public void RaiseNavigationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset, object[] tags = null) + /// + public void RaiseNavigationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset) { // Create input event - navigationEventData.Initialize(source, handedness, normalizedOffset, tags); + navigationEventData.Initialize(source, handedness, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationUpdatedEventHandler); @@ -1108,19 +1159,21 @@ public void RaiseNavigationUpdated(IMixedRealityInputSource source, Handedness h handler.OnNavigationCompleted(casted); }; - public void RaiseNavigationCompleted(IMixedRealityInputSource source, Vector3 normalizedOffset, object[] tags = null) + /// + public void RaiseNavigationCompleted(IMixedRealityInputSource source, Vector3 normalizedOffset) { // Create input event - navigationEventData.Initialize(source, normalizedOffset, tags); + navigationEventData.Initialize(source, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCompletedEventHandler); } - public void RaiseNavigationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset, object[] tags = null) + /// + public void RaiseNavigationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset) { // Create input event - navigationEventData.Initialize(source, handedness, normalizedOffset, tags); + navigationEventData.Initialize(source, handedness, normalizedOffset); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCompletedEventHandler); @@ -1133,19 +1186,21 @@ public void RaiseNavigationCompleted(IMixedRealityInputSource source, Handedness handler.OnNavigationCanceled(casted); }; - public void RaiseNavigationCanceled(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseNavigationCanceled(IMixedRealityInputSource source) { // Create input event - navigationEventData.Initialize(source, Vector3.zero, tags); + navigationEventData.Initialize(source, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCanceledEventHandler); } - public void RaiseNavigationCanceled(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseNavigationCanceled(IMixedRealityInputSource source, Handedness handedness) { // Create input event - navigationEventData.Initialize(source, handedness, Vector3.zero, tags); + navigationEventData.Initialize(source, handedness, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(navigationEventData, OnNavigationCanceledEventHandler); @@ -1162,19 +1217,21 @@ public void RaiseNavigationCanceled(IMixedRealityInputSource source, Handedness handler.OnManipulationStarted(casted); }; - public void RaiseManipulationStarted(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseManipulationStarted(IMixedRealityInputSource source) { // Create input event - manipulationEventData.Initialize(source, Vector3.zero, tags); + manipulationEventData.Initialize(source, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationStartedEventHandler); } - public void RaiseManipulationStarted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseManipulationStarted(IMixedRealityInputSource source, Handedness handedness) { // Create input event - manipulationEventData.Initialize(source, handedness, Vector3.zero, tags); + manipulationEventData.Initialize(source, handedness, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationStartedEventHandler); @@ -1187,19 +1244,21 @@ public void RaiseManipulationStarted(IMixedRealityInputSource source, Handedness handler.OnManipulationUpdated(casted); }; - public void RaiseManipulationUpdated(IMixedRealityInputSource source, Vector3 cumulativeDelta, object[] tags = null) + /// + public void RaiseManipulationUpdated(IMixedRealityInputSource source, Vector3 cumulativeDelta) { // Create input event - manipulationEventData.Initialize(source, cumulativeDelta, tags); + manipulationEventData.Initialize(source, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationUpdatedEventHandler); } - public void RaiseManipulationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta, object[] tags = null) + /// + public void RaiseManipulationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta) { // Create input event - manipulationEventData.Initialize(source, handedness, cumulativeDelta, tags); + manipulationEventData.Initialize(source, handedness, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationUpdatedEventHandler); @@ -1212,19 +1271,21 @@ public void RaiseManipulationUpdated(IMixedRealityInputSource source, Handedness handler.OnManipulationCompleted(casted); }; - public void RaiseManipulationCompleted(IMixedRealityInputSource source, Vector3 cumulativeDelta, object[] tags = null) + /// + public void RaiseManipulationCompleted(IMixedRealityInputSource source, Vector3 cumulativeDelta) { // Create input event - manipulationEventData.Initialize(source, cumulativeDelta, tags); + manipulationEventData.Initialize(source, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCompletedEventHandler); } - public void RaiseManipulationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta, object[] tags = null) + /// + public void RaiseManipulationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta) { // Create input event - manipulationEventData.Initialize(source, handedness, cumulativeDelta, tags); + manipulationEventData.Initialize(source, handedness, cumulativeDelta); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCompletedEventHandler); @@ -1237,19 +1298,21 @@ public void RaiseManipulationCompleted(IMixedRealityInputSource source, Handedne handler.OnManipulationCanceled(casted); }; - public void RaiseManipulationCanceled(IMixedRealityInputSource source, object[] tags = null) + /// + public void RaiseManipulationCanceled(IMixedRealityInputSource source) { // Create input event - manipulationEventData.Initialize(source, Vector3.zero, tags); + manipulationEventData.Initialize(source, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCanceledEventHandler); } - public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handedness handedness, object[] tags = null) + /// + public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handedness handedness) { // Create input event - manipulationEventData.Initialize(source, handedness, Vector3.zero, tags); + manipulationEventData.Initialize(source, handedness, Vector3.zero); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(manipulationEventData, OnManipulationCanceledEventHandler); @@ -1266,10 +1329,10 @@ public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handednes // handler.OnTeleportIntent(casted); // }; - //public void RaiseTeleportIntent(TeleportPointer pointer, object[] tags = null) + //public void RaiseTeleportIntent(TeleportPointer pointer) //{ // // Create input event - // teleportEventData.Initialize(pointer.InputSourceParent, tags); + // teleportEventData.Initialize(pointer.InputSourceParent); // // Pass handler through HandleEvent to perform modal/fallback logic // HandleEvent(teleportEventData, OnTeleportIntentHandler); @@ -1282,10 +1345,10 @@ public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handednes // handler.OnTeleportStarted(casted); // }; - //public void RaiseTeleportStarted(TeleportPointer pointer, object[] tags = null) + //public void RaiseTeleportStarted(TeleportPointer pointer) //{ // // Create input event - // teleportEventData.Initialize(pointer.InputSourceParent, tags); + // teleportEventData.Initialize(pointer.InputSourceParent); // // Pass handler through HandleEvent to perform modal/fallback logic // HandleEvent(teleportEventData, OnTeleportStartedHandler); @@ -1298,10 +1361,10 @@ public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handednes // handler.OnTeleportCompleted(casted); // }; - //public void RaiseTeleportCompleted(TeleportPointer pointer, object[] tags = null) + //public void RaiseTeleportCompleted(TeleportPointer pointer) //{ // // Create input event - // teleportEventData.Initialize(pointer.InputSourceParent, tags); + // teleportEventData.Initialize(pointer.InputSourceParent); // // Pass handler through HandleEvent to perform modal/fallback logic // HandleEvent(teleportEventData, OnTeleportCompletedHandler); @@ -1314,10 +1377,10 @@ public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handednes // handler.OnTeleportCanceled(casted); // }; - //public void RaiseTeleportCanceled(TeleportPointer pointer, object[] tags = null) + //public void RaiseTeleportCanceled(TeleportPointer pointer) //{ // // Create input event - // teleportEventData.Initialize(pointer.InputSourceParent, tags); + // teleportEventData.Initialize(pointer.InputSourceParent); // // Pass handler through HandleEvent to perform modal/fallback logic // HandleEvent(teleportEventData, OnTeleportCanceledHandler); @@ -1336,10 +1399,11 @@ public void RaiseManipulationCanceled(IMixedRealityInputSource source, Handednes handler.OnSpeechKeywordRecognized(casted); }; - public void RaiseSpeechKeywordPhraseRecognized(IMixedRealityInputSource source, UnityEngine.Windows.Speech.ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, UnityEngine.Windows.Speech.SemanticMeaning[] semanticMeanings, string text, object[] tags = null) + /// + public void RaiseSpeechKeywordPhraseRecognized(IMixedRealityInputSource source, UnityEngine.Windows.Speech.ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, UnityEngine.Windows.Speech.SemanticMeaning[] semanticMeanings, string text) { // Create input event - speechEventData.Initialize(source, confidence, phraseDuration, phraseStartTime, semanticMeanings, text, tags); + speechEventData.Initialize(source, confidence, phraseDuration, phraseStartTime, semanticMeanings, text); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(speechEventData, OnSpeechKeywordRecognizedEventHandler); @@ -1356,10 +1420,11 @@ public void RaiseSpeechKeywordPhraseRecognized(IMixedRealityInputSource source, handler.OnDictationHypothesis(casted); }; - public void RaiseDictationHypothesis(IMixedRealityInputSource source, string dictationHypothesis, AudioClip dictationAudioClip = null, object[] tags = null) + /// + public void RaiseDictationHypothesis(IMixedRealityInputSource source, string dictationHypothesis, AudioClip dictationAudioClip = null) { // Create input event - dictationEventData.Initialize(source, dictationHypothesis, dictationAudioClip, tags); + dictationEventData.Initialize(source, dictationHypothesis, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationHypothesisEventHandler); @@ -1372,10 +1437,11 @@ public void RaiseDictationHypothesis(IMixedRealityInputSource source, string dic handler.OnDictationResult(casted); }; - public void RaiseDictationResult(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) + /// + public void RaiseDictationResult(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null) { // Create input event - dictationEventData.Initialize(source, dictationResult, dictationAudioClip, tags); + dictationEventData.Initialize(source, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationResultEventHandler); @@ -1388,10 +1454,11 @@ public void RaiseDictationResult(IMixedRealityInputSource source, string dictati handler.OnDictationComplete(casted); }; - public void RaiseDictationComplete(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip, object[] tags = null) + /// + public void RaiseDictationComplete(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip) { // Create input event - dictationEventData.Initialize(source, dictationResult, dictationAudioClip, tags); + dictationEventData.Initialize(source, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationCompleteEventHandler); @@ -1404,10 +1471,11 @@ public void RaiseDictationComplete(IMixedRealityInputSource source, string dicta handler.OnDictationError(casted); }; - public void RaiseDictationError(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) + /// + public void RaiseDictationError(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null) { // Create input event - dictationEventData.Initialize(source, dictationResult, dictationAudioClip, tags); + dictationEventData.Initialize(source, dictationResult, dictationAudioClip); // Pass handler through HandleEvent to perform modal/fallback logic HandleEvent(dictationEventData, OnDictationErrorEventHandler); diff --git a/Assets/MixedRealityToolkit/InputSystem/Pointers/BaseControllerPointer.cs b/Assets/MixedRealityToolkit/InputSystem/Pointers/BaseControllerPointer.cs index 0f1cf0189bf..b67384380e3 100644 --- a/Assets/MixedRealityToolkit/InputSystem/Pointers/BaseControllerPointer.cs +++ b/Assets/MixedRealityToolkit/InputSystem/Pointers/BaseControllerPointer.cs @@ -361,7 +361,7 @@ public virtual void OnInputPressed(InputPressedEventData eventData) { } /// /// Updates target point orientation via thumbstick /// - public virtual void OnDualAxisInputChanged(DualAxisInputEventData eventData) { } + public virtual void On2DoFInputChanged(TwoDoFInputEventData eventData) { } #endregion IMixedRealityInputHandler Implementation } diff --git a/Assets/MixedRealityToolkit/InputSystem/Sources/InteractionInputSources.cs b/Assets/MixedRealityToolkit/InputSystem/Sources/InteractionInputSources.cs index 75bb6e641a8..c2c14be7a31 100644 --- a/Assets/MixedRealityToolkit/InputSystem/Sources/InteractionInputSources.cs +++ b/Assets/MixedRealityToolkit/InputSystem/Sources/InteractionInputSources.cs @@ -106,8 +106,10 @@ public void Reset() ThumbstickPositionUpdated = false; TouchpadPositionUpdated = false; TouchpadTouchedUpdated = false; - PositionUpdated = false; - RotationUpdated = false; + PointerPositionUpdated = false; + PointerRotationUpdated = false; + GripPositionUpdated = false; + GripRotationUpdated = false; SelectPressedAmountUpdated = false; } @@ -125,8 +127,10 @@ public void Reset() public bool ThumbstickPositionUpdated; public bool TouchpadPositionUpdated; public bool TouchpadTouchedUpdated; - public bool PositionUpdated; - public bool RotationUpdated; + public bool PointerPositionUpdated; + public bool PointerRotationUpdated; + public bool GripPositionUpdated; + public bool GripRotationUpdated; public bool SelectPressedAmountUpdated; public override bool TryGetPointerPosition(IMixedRealityPointer pointer, out Vector3 position) @@ -815,9 +819,14 @@ private static void UpdateInteractionSource(InteractionSourceState interactionSo newGripPosition = CameraCache.Main.transform.parent.TransformPoint(newGripPosition); } - if (sourceData.PointerPosition.IsAvailable || sourceData.GripPosition.IsAvailable) + if (sourceData.PointerPosition.IsAvailable) { - sourceData.PositionUpdated = sourceData.PointerPosition.CurrentReading != newPointerPosition || sourceData.GripPosition.CurrentReading != newGripPosition; + sourceData.PointerPositionUpdated = sourceData.PointerPosition.CurrentReading != newPointerPosition; + } + + if (sourceData.GripPosition.IsAvailable) + { + sourceData.GripPositionUpdated = sourceData.GripPosition.CurrentReading != newGripPosition; } sourceData.PointerPosition.CurrentReading = newPointerPosition; @@ -839,9 +848,14 @@ private static void UpdateInteractionSource(InteractionSourceState interactionSo newGripRotation.eulerAngles = CameraCache.Main.transform.parent.TransformDirection(newGripRotation.eulerAngles); } - if (sourceData.PointerRotation.IsAvailable || sourceData.GripRotation.IsAvailable) + if (sourceData.PointerRotation.IsAvailable) + { + sourceData.PointerRotationUpdated = sourceData.PointerRotation.CurrentReading != newPointerRotation; + } + + else if (sourceData.GripRotation.IsAvailable) { - sourceData.RotationUpdated = sourceData.PointerRotation.CurrentReading != newPointerRotation || sourceData.GripRotation.CurrentReading != newGripRotation; + sourceData.GripRotationUpdated = sourceData.GripRotation.CurrentReading != newGripRotation; } sourceData.PointerRotation.CurrentReading = newPointerRotation; @@ -955,24 +969,34 @@ private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdate UpdateInteractionSource(args.state, inputSource); - if (inputSource.PositionUpdated) + if (inputSource.PointerPositionUpdated) + { + inputSystem.Raise3DoFInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.PointerPosition, inputSource.PointerPosition.CurrentReading); + } + + if (inputSource.GripPositionUpdated) + { + inputSystem.Raise3DoFInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.GripPosition, inputSource.GripPosition.CurrentReading); + } + + if (inputSource.PointerRotationUpdated) { - inputSystem.RaiseSourcePositionChanged(inputSource, (Handedness)args.state.source.handedness, inputSource.PointerPosition.CurrentReading, inputSource.GripPosition.CurrentReading); + inputSystem.Raise3DoFInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.PointerRotation, inputSource.PointerRotation.CurrentReading); } - if (inputSource.RotationUpdated) + if (inputSource.GripRotationUpdated) { - inputSystem.RaiseSourceRotationChanged(inputSource, (Handedness)args.state.source.handedness, inputSource.PointerRotation.CurrentReading, inputSource.GripRotation.CurrentReading); + inputSystem.Raise3DoFInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.GripRotation, inputSource.GripRotation.CurrentReading); } if (inputSource.ThumbstickPositionUpdated) { - inputSystem.RaiseDualAxisInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.ThumbStick, inputSource.Thumbstick.CurrentReading.Position); + inputSystem.Raise2DoFInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.ThumbStick, inputSource.Thumbstick.CurrentReading.Position); } if (inputSource.TouchpadPositionUpdated) { - inputSystem.RaiseDualAxisInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.Touchpad, inputSource.Touchpad.CurrentReading.AxisButton.Position); + inputSystem.Raise2DoFInputChanged(inputSource, (Handedness)args.state.source.handedness, InputType.Touchpad, inputSource.Touchpad.CurrentReading.AxisButton.Position); } if (inputSource.TouchpadTouchedUpdated) diff --git a/Assets/MixedRealityToolkit/InputSystem/Utilities/Interactions/HandDraggable.cs b/Assets/MixedRealityToolkit/InputSystem/Utilities/Interactions/HandDraggable.cs index c157ac9ac5b..3336cfc7fd2 100644 --- a/Assets/MixedRealityToolkit/InputSystem/Utilities/Interactions/HandDraggable.cs +++ b/Assets/MixedRealityToolkit/InputSystem/Utilities/Interactions/HandDraggable.cs @@ -388,7 +388,7 @@ void IMixedRealityInputHandler.OnInputDown(InputEventData eventData) void IMixedRealityInputHandler.OnInputPressed(InputPressedEventData eventData) { } - void IMixedRealityInputHandler.OnDualAxisInputChanged(DualAxisInputEventData eventData) { } + void IMixedRealityInputHandler.On2DoFInputChanged(TwoDoFInputEventData eventData) { } void IMixedRealitySourceStateHandler.OnSourceDetected(SourceStateEventData eventData) { } @@ -399,9 +399,5 @@ void IMixedRealitySourceStateHandler.OnSourceLost(SourceStateEventData eventData StopDragging(); } } - - void IMixedRealitySourceStateHandler.OnSourcePositionChanged(SourcePositionEventData eventData) { } - - void IMixedRealitySourceStateHandler.OnSourceRotationChanged(SourceRotationEventData eventData) { } } } diff --git a/Assets/MixedRealityToolkit/InputSystem/Utilities/MotionController/MotionControllerVisualizer.cs b/Assets/MixedRealityToolkit/InputSystem/Utilities/MotionController/MotionControllerVisualizer.cs index 0fd13922a69..02b0f794982 100644 --- a/Assets/MixedRealityToolkit/InputSystem/Utilities/MotionController/MotionControllerVisualizer.cs +++ b/Assets/MixedRealityToolkit/InputSystem/Utilities/MotionController/MotionControllerVisualizer.cs @@ -17,7 +17,7 @@ #if !UNITY_EDITOR using Windows.Foundation; using Windows.Storage.Streams; - +using Microsoft.MixedReality.Toolkit.Internal.Extensions; #endif #endif diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/BaseInputEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/BaseInputEventData.cs index 97efc8f7cac..2b56b4087aa 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/BaseInputEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/BaseInputEventData.cs @@ -21,11 +21,6 @@ public abstract class BaseInputEventData : BaseEventData /// public uint SourceId { get; private set; } - /// - /// An optional, input-source-dependent object to be associated with this event. - /// - public object[] Tags { get; private set; } - /// /// Constructor. /// @@ -36,13 +31,11 @@ public BaseInputEventData(EventSystem eventSystem) : base(eventSystem) { } /// Used to initialize/reset the event and populate the data. /// /// - /// - protected void BaseInitialize(IMixedRealityInputSource inputSource, object[] tags) + protected void BaseInitialize(IMixedRealityInputSource inputSource) { Reset(); InputSource = inputSource; SourceId = InputSource.SourceId; - Tags = tags; } } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DictationEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DictationEventData.cs index 88263732fa6..ee7d303ff61 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DictationEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DictationEventData.cs @@ -30,10 +30,9 @@ public DictationEventData(UnityEngine.EventSystems.EventSystem eventSystem) : ba /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, string dictationResult, AudioClip dictationAudioClip = null) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); DictationResult = dictationResult; DictationAudioClip = dictationAudioClip; } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ClickEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputClickEventData.cs similarity index 74% rename from Assets/MixedRealityToolkit/_Core/EventDatum/Input/ClickEventData.cs rename to Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputClickEventData.cs index d4480b5fa39..270cd4770ae 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ClickEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputClickEventData.cs @@ -10,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input /// /// Describes an Input Event that involves a tap, click, or touch. /// - public class ClickEventData : InputEventData + public class InputClickEventData : InputEventData { /// /// Number of Clicks, Taps, or Presses that triggered the event. @@ -18,17 +18,16 @@ public class ClickEventData : InputEventData public int Count { get; private set; } /// - public ClickEventData(EventSystem eventSystem) : base(eventSystem) { } + public InputClickEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// Used to initialize/reset the event and populate the data. /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, int count, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, int count) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); Count = count; } @@ -38,10 +37,9 @@ public void Initialize(IMixedRealityInputSource inputSource, int count, object[] /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, int count, Handedness handedness, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, int count, Handedness handedness) { - Initialize(inputSource, handedness, tags); + Initialize(inputSource, handedness); Count = count; } @@ -52,10 +50,9 @@ public void Initialize(IMixedRealityInputSource inputSource, int count, Handedne /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, int count, InputType inputType, Handedness handedness, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, int count, InputType inputType, Handedness handedness) { - Initialize(inputSource, handedness, inputType, tags); + Initialize(inputSource, handedness, inputType); Count = count; } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ClickEventData.cs.meta b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputClickEventData.cs.meta similarity index 86% rename from Assets/MixedRealityToolkit/_Core/EventDatum/Input/ClickEventData.cs.meta rename to Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputClickEventData.cs.meta index 9be8012a90b..462e0aac1c5 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ClickEventData.cs.meta +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputClickEventData.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 guid: b304d3268ca1ec74aa0fd59559e3d8cb -timeCreated: 1482758406 -licenseType: Free MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputEventData.cs index 6bf78e07f23..b09a2cbcf9f 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputEventData.cs @@ -16,17 +16,17 @@ public class InputEventData : BaseInputEventData /// /// Handedness of the . /// - public Handedness Handedness { get; private set; } + public Handedness Handedness { get; private set; } = Handedness.None; /// /// The KeyCode of the . /// - public KeyCode KeyCode { get; private set; } + public KeyCode KeyCode { get; private set; } = KeyCode.None; /// /// The InputType of the . /// - public InputType InputType { get; private set; } + public InputType InputType { get; private set; } = InputType.None; /// public InputEventData(EventSystem eventSystem) : base(eventSystem) { } @@ -35,13 +35,9 @@ public InputEventData(EventSystem eventSystem) : base(eventSystem) { } /// Used to initialize/reset the event and populate the data. /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource) { - BaseInitialize(inputSource, tags); - Handedness = Handedness.None; - KeyCode = KeyCode.None; - InputType = InputType.None; + BaseInitialize(inputSource); } /// @@ -49,13 +45,10 @@ public void Initialize(IMixedRealityInputSource inputSource, object[] tags) /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, KeyCode keyCode, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource, KeyCode keyCode) { - BaseInitialize(inputSource, tags); - Handedness = Handedness.None; + BaseInitialize(inputSource); KeyCode = keyCode; - InputType = InputType.None; } /// @@ -63,12 +56,9 @@ public void Initialize(IMixedRealityInputSource inputSource, KeyCode keyCode, ob /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType) { - BaseInitialize(inputSource, tags); - Handedness = Handedness.None; - KeyCode = KeyCode.None; + BaseInitialize(inputSource); InputType = inputType; } @@ -77,13 +67,10 @@ public void Initialize(IMixedRealityInputSource inputSource, InputType inputType /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); Handedness = handedness; - KeyCode = KeyCode.None; - InputType = InputType.None; } /// @@ -92,13 +79,11 @@ public void Initialize(IMixedRealityInputSource inputSource, Handedness handedne /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, KeyCode keyCode, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, KeyCode keyCode) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); Handedness = handedness; KeyCode = keyCode; - InputType = InputType.None; } /// @@ -107,12 +92,10 @@ public void Initialize(IMixedRealityInputSource inputSource, Handedness handedne /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); Handedness = handedness; - KeyCode = KeyCode.None; InputType = inputType; } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputPressedEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputPressedEventData.cs index 3dc8a460c4f..51a99c1e496 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputPressedEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/InputPressedEventData.cs @@ -26,10 +26,9 @@ public InputPressedEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, double pressedAmount, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, double pressedAmount) { - Initialize(inputSource, tags); + Initialize(inputSource); PressedAmount = pressedAmount; } @@ -39,10 +38,9 @@ public void Initialize(IMixedRealityInputSource inputSource, double pressedAmoun /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, double pressedAmount, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, double pressedAmount) { - Initialize(inputSource, handedness, tags); + Initialize(inputSource, handedness); PressedAmount = pressedAmount; } @@ -52,10 +50,9 @@ public void Initialize(IMixedRealityInputSource inputSource, Handedness handedne /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, KeyCode keyCode, double pressedAmount, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, KeyCode keyCode, double pressedAmount) { - Initialize(inputSource, keyCode, tags); + Initialize(inputSource, keyCode); PressedAmount = pressedAmount; } @@ -65,10 +62,9 @@ public void Initialize(IMixedRealityInputSource inputSource, KeyCode keyCode, do /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, double pressedAmount, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, double pressedAmount) { - Initialize(inputSource, inputType, tags); + Initialize(inputSource, inputType); PressedAmount = pressedAmount; } @@ -79,10 +75,9 @@ public void Initialize(IMixedRealityInputSource inputSource, InputType inputType /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, KeyCode keyCode, double pressedAmount, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, KeyCode keyCode, double pressedAmount) { - Initialize(inputSource, handedness, keyCode, tags); + Initialize(inputSource, handedness, keyCode); PressedAmount = pressedAmount; } @@ -93,10 +88,9 @@ public void Initialize(IMixedRealityInputSource inputSource, Handedness handedne /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType, double pressedAmount, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType, double pressedAmount) { - Initialize(inputSource, handedness, inputType, tags); + Initialize(inputSource, handedness, inputType); PressedAmount = pressedAmount; } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ManipulationEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ManipulationEventData.cs index b67d9243c22..fe28ae294ce 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ManipulationEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ManipulationEventData.cs @@ -27,10 +27,9 @@ public ManipulationEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Vector3 cumulativeDelta, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Vector3 cumulativeDelta) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); CumulativeDelta = cumulativeDelta; } @@ -40,10 +39,9 @@ public void Initialize(IMixedRealityInputSource inputSource, Vector3 cumulativeD /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, Vector3 cumulativeDelta, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, Vector3 cumulativeDelta) { - Initialize(inputSource, handedness, tags); + Initialize(inputSource, handedness); CumulativeDelta = cumulativeDelta; } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/NavigationEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/NavigationEventData.cs index f57cd47ab57..bf9a5af88f6 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/NavigationEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/NavigationEventData.cs @@ -27,10 +27,9 @@ public NavigationEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Vector3 normalizedOffset, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Vector3 normalizedOffset) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); NormalizedOffset = normalizedOffset; } @@ -40,10 +39,9 @@ public void Initialize(IMixedRealityInputSource inputSource, Vector3 normalizedO /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, Vector3 normalizedOffset, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, Vector3 normalizedOffset) { - Initialize(inputSource, handedness, tags); + Initialize(inputSource, handedness); NormalizedOffset = normalizedOffset; } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SixDoFInputEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SixDoFInputEventData.cs new file mode 100644 index 00000000000..01e2852c743 --- /dev/null +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SixDoFInputEventData.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using System; +using Microsoft.MixedReality.Toolkit.Internal.Definitions; +using Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem; +using UnityEngine; +using UnityEngine.EventSystems; + +namespace Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input +{ + /// + /// Describes an Input Event that involves an Input Source's spatial position AND rotation. + /// + public class SixDoFInputEventData : ThreeDoFInputEventData + { + /// + /// The and input data. + /// + public Tuple InputData { get; private set; } = new Tuple(Vector3.zero, Quaternion.identity); + + /// + /// Constructor. + /// + /// + public SixDoFInputEventData(EventSystem eventSystem) : base(eventSystem) { } + + /// + /// Used to initialize/reset the event and populate the data. + /// + /// + /// + /// + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Tuple inputData) + { + Initialize(inputSource, inputType); + Position = inputData.Item1; + Rotation = inputData.Item2; + InputData = inputData; + } + + /// + /// Used to initialize/reset the event and populate the data. + /// + /// + /// + /// + /// + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType, Tuple inputData) + { + Initialize(inputSource, handedness, inputType); + Position = inputData.Item1; + Rotation = inputData.Item2; + InputData = inputData; + } + } +} \ No newline at end of file diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SixDoFInputEventData.cs.meta b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SixDoFInputEventData.cs.meta new file mode 100644 index 00000000000..f9fbfbff08a --- /dev/null +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SixDoFInputEventData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a1b5ccc049b34fefa035feb2dd92f487 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourcePositionEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourcePositionEventData.cs deleted file mode 100644 index 9b1335925ca..00000000000 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourcePositionEventData.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using Microsoft.MixedReality.Toolkit.Internal.Definitions; -using Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input -{ - /// - /// Describes an input event that involves an Input Source's spatial position. - /// - public class SourcePositionEventData : InputEventData - { - /// - /// The Pointer Position of the Input Source. - /// - public Vector3 PointerPosition { get; private set; } - - /// - /// The Grip Position of the Input Source. - /// - public Vector3 GripPosition { get; private set; } - - /// - public SourcePositionEventData(EventSystem eventSystem) : base(eventSystem) { } - - /// - /// Populates the event with data. - /// - /// - /// - /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null) - { - BaseInitialize(inputSource, tags); - PointerPosition = pointerPosition; - GripPosition = gripPosition; - } - - /// - /// Populates the event with data. - /// - /// - /// - /// - /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null) - { - Initialize(inputSource, handedness, tags); - PointerPosition = pointerPosition; - GripPosition = gripPosition; - } - } -} diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceRotationEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceRotationEventData.cs deleted file mode 100644 index 44b0ad3de91..00000000000 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceRotationEventData.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using Microsoft.MixedReality.Toolkit.Internal.Definitions; -using Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input -{ - /// - /// Describes an input event that involves an Input Source's rotation. - /// - public class SourceRotationEventData : InputEventData - { - /// - /// The Pointer Rotation of the Input Source. - /// - public Quaternion PointerRotation { get; private set; } - - /// - /// The Grip Rotation of the Input Source. - /// - public Quaternion GripRotation { get; private set; } - - /// - public SourceRotationEventData(EventSystem eventSystem) : base(eventSystem) { } - - /// - /// Populates the event with data. - /// - /// - /// - /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null) - { - Initialize(inputSource, tags); - PointerRotation = pointerRotation; - GripRotation = gripRotation; - } - - /// - /// Populates the event with data. - /// - /// - /// - /// - /// - /// - public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null) - { - Initialize(inputSource, handedness, tags); - PointerRotation = pointerRotation; - GripRotation = gripRotation; - } - } -} diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceStateEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceStateEventData.cs index 707c911871d..9e57c0d4b8a 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceStateEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceStateEventData.cs @@ -18,10 +18,9 @@ public SourceStateEventData(EventSystem eventSystem) : base(eventSystem) { } /// Populates the event with data. /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, object[] tags) + public void Initialize(IMixedRealityInputSource inputSource) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); } } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SpeechEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SpeechEventData.cs index 5363140a622..f1acfb8a6c0 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SpeechEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SpeechEventData.cs @@ -55,10 +55,9 @@ public SpeechEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SemanticMeaning[] semanticMeanings, string recognizedText) { - BaseInitialize(inputSource, tags); + BaseInitialize(inputSource); Confidence = confidence; PhraseDuration = phraseDuration; PhraseStartTime = phraseStartTime; diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ThreeDoFInputEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ThreeDoFInputEventData.cs new file mode 100644 index 00000000000..da9469e1894 --- /dev/null +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ThreeDoFInputEventData.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using Microsoft.MixedReality.Toolkit.Internal.Definitions; +using Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem; +using UnityEngine; +using UnityEngine.EventSystems; + +namespace Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input +{ + /// + /// Describes an input event that involves an Input Source's spatial position OR rotation. + /// + public class ThreeDoFInputEventData : InputEventData + { + /// + /// The Position of the Input. + /// + public Vector3 Position { get; protected set; } = Vector3.zero; + + /// + /// The Rotation of the Input. + /// + public Quaternion Rotation { get; protected set; } = Quaternion.identity; + + /// + public ThreeDoFInputEventData(EventSystem eventSystem) : base(eventSystem) { } + + /// + /// Populates the event with data. + /// + /// + /// + /// + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Vector3 position) + { + Initialize(inputSource, inputType); + Position = position; + } + + /// + /// Populates the event with data. + /// + /// + /// + /// + /// + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType, Vector3 position) + { + Initialize(inputSource, handedness, inputType); + Position = position; + } + + /// + /// Populates the event with data. + /// + /// + /// + /// + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Quaternion rotation) + { + Initialize(inputSource, inputType); + Rotation = rotation; + } + + /// + /// Populates the event with data. + /// + /// + /// + /// + /// + public void Initialize(IMixedRealityInputSource inputSource, Handedness handedness, InputType inputType, Quaternion rotation) + { + Initialize(inputSource, handedness, inputType); + Rotation = rotation; + } + } +} diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ThreeDoFInputEventData.cs.meta b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ThreeDoFInputEventData.cs.meta new file mode 100644 index 00000000000..ec495f3575a --- /dev/null +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/ThreeDoFInputEventData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d769e3ca3c2035244be947203cdb1acd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DualAxisInputEventData.cs b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/TwoDoFInputEventData.cs similarity index 68% rename from Assets/MixedRealityToolkit/_Core/EventDatum/Input/DualAxisInputEventData.cs rename to Assets/MixedRealityToolkit/_Core/EventDatum/Input/TwoDoFInputEventData.cs index 1503e6de4b5..8b167555597 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DualAxisInputEventData.cs +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/TwoDoFInputEventData.cs @@ -9,18 +9,18 @@ namespace Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input { /// - /// Describes Dual Axis Positional Event data, usually generated from a Joystick, or Touch input source. + /// Describes Two Degrees of Freedom event data, usually generated from a Joystick, or Touch input source. /// - public class DualAxisInputEventData : InputEventData + public class TwoDoFInputEventData : InputEventData { /// /// Two values, typically from -1.0 to 1.0 in the X-axis and Y-axis, representing where the input control is positioned. /// Typically this is Touch or Joystick data. /// - public Vector2 DualAxisPosition { get; private set; } + public Vector2 Position { get; private set; } = Vector2.zero; /// - public DualAxisInputEventData(EventSystem eventSystem) : base(eventSystem) { } + public TwoDoFInputEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// Populates the event with data. @@ -28,11 +28,10 @@ public DualAxisInputEventData(EventSystem eventSystem) : base(eventSystem) { } /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Vector2 position, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Vector2 position) { - Initialize(inputSource, inputType, tags); - DualAxisPosition = position; + Initialize(inputSource, inputType); + Position = position; } /// @@ -42,11 +41,10 @@ public void Initialize(IMixedRealityInputSource inputSource, InputType inputType /// /// /// - /// - public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Vector2 position, Handedness handedness, object[] tags = null) + public void Initialize(IMixedRealityInputSource inputSource, InputType inputType, Vector2 position, Handedness handedness) { - Initialize(inputSource, handedness, inputType, tags); - DualAxisPosition = position; + Initialize(inputSource, handedness, inputType); + Position = position; } } } diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DualAxisInputEventData.cs.meta b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/TwoDoFInputEventData.cs.meta similarity index 62% rename from Assets/MixedRealityToolkit/_Core/EventDatum/Input/DualAxisInputEventData.cs.meta rename to Assets/MixedRealityToolkit/_Core/EventDatum/Input/TwoDoFInputEventData.cs.meta index aa1077845a0..c02a76ca2a0 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/DualAxisInputEventData.cs.meta +++ b/Assets/MixedRealityToolkit/_Core/EventDatum/Input/TwoDoFInputEventData.cs.meta @@ -1,12 +1,11 @@ fileFormatVersion: 2 guid: f4b783d031c61914eafbc9bb710d3ed7 -timeCreated: 1487294857 -licenseType: Pro MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 8a1b00ef1a7a8b94891466c1f0911027, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/MixedRealityToolkit/_Core/Extensions/BoundsExtensions.cs b/Assets/MixedRealityToolkit/_Core/Extensions/BoundsExtensions.cs index fb0d829fa75..ac8b12ebb02 100644 --- a/Assets/MixedRealityToolkit/_Core/Extensions/BoundsExtensions.cs +++ b/Assets/MixedRealityToolkit/_Core/Extensions/BoundsExtensions.cs @@ -88,8 +88,9 @@ public static bool IsValid(this Bounds bounds) /// /// Gets all the corner points of the bounds in world space /// - /// + /// /// + /// /// /// Use BoxColliderExtensions.{Left|Right}{Bottom|Top}{Front|Back} consts to index into the output /// corners array. @@ -114,14 +115,14 @@ public static void GetCornerPositions(this Bounds bounds, Transform transform, r } // Transform all the local points to world space. - positions[BoundsExtensions.LBF] = transform.TransformPoint(leftEdge, bottomEdge, frontEdge); - positions[BoundsExtensions.LBB] = transform.TransformPoint(leftEdge, bottomEdge, backEdge); - positions[BoundsExtensions.LTF] = transform.TransformPoint(leftEdge, topEdge, frontEdge); - positions[BoundsExtensions.LTB] = transform.TransformPoint(leftEdge, topEdge, backEdge); - positions[BoundsExtensions.RBF] = transform.TransformPoint(rightEdge, bottomEdge, frontEdge); - positions[BoundsExtensions.RBB] = transform.TransformPoint(rightEdge, bottomEdge, backEdge); - positions[BoundsExtensions.RTF] = transform.TransformPoint(rightEdge, topEdge, frontEdge); - positions[BoundsExtensions.RTB] = transform.TransformPoint(rightEdge, topEdge, backEdge); + positions[LBF] = transform.TransformPoint(leftEdge, bottomEdge, frontEdge); + positions[LBB] = transform.TransformPoint(leftEdge, bottomEdge, backEdge); + positions[LTF] = transform.TransformPoint(leftEdge, topEdge, frontEdge); + positions[LTB] = transform.TransformPoint(leftEdge, topEdge, backEdge); + positions[RBF] = transform.TransformPoint(rightEdge, bottomEdge, frontEdge); + positions[RBB] = transform.TransformPoint(rightEdge, bottomEdge, backEdge); + positions[RTF] = transform.TransformPoint(rightEdge, topEdge, frontEdge); + positions[RTB] = transform.TransformPoint(rightEdge, topEdge, backEdge); } /// @@ -146,14 +147,14 @@ public static void GetCornerPositionsFromRendererBounds(this Bounds bounds, ref positions = new Vector3[numPoints]; } - positions[BoundsExtensions.LBF] = new Vector3(leftEdge, bottomEdge, frontEdge); - positions[BoundsExtensions.LBB] = new Vector3(leftEdge, bottomEdge, backEdge); - positions[BoundsExtensions.LTF] = new Vector3(leftEdge, topEdge, frontEdge); - positions[BoundsExtensions.LTB] = new Vector3(leftEdge, topEdge, backEdge); - positions[BoundsExtensions.RBF] = new Vector3(rightEdge, bottomEdge, frontEdge); - positions[BoundsExtensions.RBB] = new Vector3(rightEdge, bottomEdge, backEdge); - positions[BoundsExtensions.RTF] = new Vector3(rightEdge, topEdge, frontEdge); - positions[BoundsExtensions.RTB] = new Vector3(rightEdge, topEdge, backEdge); + positions[LBF] = new Vector3(leftEdge, bottomEdge, frontEdge); + positions[LBB] = new Vector3(leftEdge, bottomEdge, backEdge); + positions[LTF] = new Vector3(leftEdge, topEdge, frontEdge); + positions[LTB] = new Vector3(leftEdge, topEdge, backEdge); + positions[RBF] = new Vector3(rightEdge, bottomEdge, frontEdge); + positions[RBB] = new Vector3(rightEdge, bottomEdge, backEdge); + positions[RTF] = new Vector3(rightEdge, topEdge, frontEdge); + positions[RTB] = new Vector3(rightEdge, topEdge, backEdge); } public static void GetFacePositions(this Bounds bounds, Transform transform, ref Vector3[] positions) @@ -167,12 +168,12 @@ public static void GetFacePositions(this Bounds bounds, Transform transform, ref positions = new Vector3[numPoints]; } - positions[BoundsExtensions.TOP] = transform.TransformPoint(center + Vector3.up * extents.y); - positions[BoundsExtensions.BOT] = transform.TransformPoint(center + Vector3.down * extents.y); - positions[BoundsExtensions.LFT] = transform.TransformPoint(center + Vector3.left * extents.x); - positions[BoundsExtensions.RHT] = transform.TransformPoint(center + Vector3.right * extents.x); - positions[BoundsExtensions.FWD] = transform.TransformPoint(center + Vector3.forward * extents.z); - positions[BoundsExtensions.BCK] = transform.TransformPoint(center + Vector3.back * extents.z); + positions[TOP] = transform.TransformPoint(center + Vector3.up * extents.y); + positions[BOT] = transform.TransformPoint(center + Vector3.down * extents.y); + positions[LFT] = transform.TransformPoint(center + Vector3.left * extents.x); + positions[RHT] = transform.TransformPoint(center + Vector3.right * extents.x); + positions[FWD] = transform.TransformPoint(center + Vector3.forward * extents.z); + positions[BCK] = transform.TransformPoint(center + Vector3.back * extents.z); } /// @@ -193,36 +194,36 @@ public static void GetCornerAndMidPointPositions(this Bounds bounds, Transform t float backEdge = center.z + extents.z; // Allocate the array if needed. - const int numPoints = BoundsExtensions.LTF_LTB + 1; + const int numPoints = LTF_LTB + 1; if (positions == null || positions.Length != numPoints) { positions = new Vector3[numPoints]; } // Transform all the local points to world space. - positions[BoundsExtensions.LBF] = transform.TransformPoint(leftEdge, bottomEdge, frontEdge); - positions[BoundsExtensions.LBB] = transform.TransformPoint(leftEdge, bottomEdge, backEdge); - positions[BoundsExtensions.LTF] = transform.TransformPoint(leftEdge, topEdge, frontEdge); - positions[BoundsExtensions.LTB] = transform.TransformPoint(leftEdge, topEdge, backEdge); - positions[BoundsExtensions.RBF] = transform.TransformPoint(rightEdge, bottomEdge, frontEdge); - positions[BoundsExtensions.RBB] = transform.TransformPoint(rightEdge, bottomEdge, backEdge); - positions[BoundsExtensions.RTF] = transform.TransformPoint(rightEdge, topEdge, frontEdge); - positions[BoundsExtensions.RTB] = transform.TransformPoint(rightEdge, topEdge, backEdge); - - positions[BoundsExtensions.LTF_RTF] = Vector3.Lerp(positions[BoundsExtensions.LTF], positions[BoundsExtensions.RTF], 0.5f); - positions[BoundsExtensions.LBF_RBF] = Vector3.Lerp(positions[BoundsExtensions.LBF], positions[BoundsExtensions.RBF], 0.5f); - positions[BoundsExtensions.RTB_LTB] = Vector3.Lerp(positions[BoundsExtensions.RTB], positions[BoundsExtensions.LTB], 0.5f); - positions[BoundsExtensions.RBB_LBB] = Vector3.Lerp(positions[BoundsExtensions.RBB], positions[BoundsExtensions.LBB], 0.5f); - - positions[BoundsExtensions.LTF_LBF] = Vector3.Lerp(positions[BoundsExtensions.LTF], positions[BoundsExtensions.LBF], 0.5f); - positions[BoundsExtensions.RTB_RBB] = Vector3.Lerp(positions[BoundsExtensions.RTB], positions[BoundsExtensions.RBB], 0.5f); - positions[BoundsExtensions.LTB_LBB] = Vector3.Lerp(positions[BoundsExtensions.LTB], positions[BoundsExtensions.LBB], 0.5f); - positions[BoundsExtensions.RTF_RBF] = Vector3.Lerp(positions[BoundsExtensions.RTF], positions[BoundsExtensions.RBF], 0.5f); - - positions[BoundsExtensions.RBF_RBB] = Vector3.Lerp(positions[BoundsExtensions.RBF], positions[BoundsExtensions.RBB], 0.5f); - positions[BoundsExtensions.RTF_RTB] = Vector3.Lerp(positions[BoundsExtensions.RTF], positions[BoundsExtensions.RTB], 0.5f); - positions[BoundsExtensions.LBF_LBB] = Vector3.Lerp(positions[BoundsExtensions.LBF], positions[BoundsExtensions.LBB], 0.5f); - positions[BoundsExtensions.LTF_LTB] = Vector3.Lerp(positions[BoundsExtensions.LTF], positions[BoundsExtensions.LTB], 0.5f); + positions[LBF] = transform.TransformPoint(leftEdge, bottomEdge, frontEdge); + positions[LBB] = transform.TransformPoint(leftEdge, bottomEdge, backEdge); + positions[LTF] = transform.TransformPoint(leftEdge, topEdge, frontEdge); + positions[LTB] = transform.TransformPoint(leftEdge, topEdge, backEdge); + positions[RBF] = transform.TransformPoint(rightEdge, bottomEdge, frontEdge); + positions[RBB] = transform.TransformPoint(rightEdge, bottomEdge, backEdge); + positions[RTF] = transform.TransformPoint(rightEdge, topEdge, frontEdge); + positions[RTB] = transform.TransformPoint(rightEdge, topEdge, backEdge); + + positions[LTF_RTF] = Vector3.Lerp(positions[LTF], positions[RTF], 0.5f); + positions[LBF_RBF] = Vector3.Lerp(positions[LBF], positions[RBF], 0.5f); + positions[RTB_LTB] = Vector3.Lerp(positions[RTB], positions[LTB], 0.5f); + positions[RBB_LBB] = Vector3.Lerp(positions[RBB], positions[LBB], 0.5f); + + positions[LTF_LBF] = Vector3.Lerp(positions[LTF], positions[LBF], 0.5f); + positions[RTB_RBB] = Vector3.Lerp(positions[RTB], positions[RBB], 0.5f); + positions[LTB_LBB] = Vector3.Lerp(positions[LTB], positions[LBB], 0.5f); + positions[RTF_RBF] = Vector3.Lerp(positions[RTF], positions[RBF], 0.5f); + + positions[RBF_RBB] = Vector3.Lerp(positions[RBF], positions[RBB], 0.5f); + positions[RTF_RTB] = Vector3.Lerp(positions[RTF], positions[RTB], 0.5f); + positions[LBF_LBB] = Vector3.Lerp(positions[LBF], positions[LBB], 0.5f); + positions[LTF_LTB] = Vector3.Lerp(positions[LTF], positions[LTB], 0.5f); } /// @@ -242,7 +243,7 @@ public static void GetCornerAndMidPointPositions2D(this Bounds bounds, Transform float topEdge = 0; // Allocate the array if needed. - const int numPoints = BoundsExtensions.LB_LT + 1; + const int numPoints = LB_LT + 1; if (positions == null || positions.Length != numPoints) { positions = new Vector3[numPoints]; @@ -257,10 +258,10 @@ public static void GetCornerAndMidPointPositions2D(this Bounds bounds, Transform bottomEdge = center.y - extents.y; topEdge = center.y + extents.y; // Transform all the local points to world space. - positions[BoundsExtensions.LT] = transform.TransformPoint(0, topEdge, leftEdge); - positions[BoundsExtensions.LB] = transform.TransformPoint(0, bottomEdge, leftEdge); - positions[BoundsExtensions.RT] = transform.TransformPoint(0, topEdge, rightEdge); - positions[BoundsExtensions.RB] = transform.TransformPoint(0, bottomEdge, rightEdge); + positions[LT] = transform.TransformPoint(0, topEdge, leftEdge); + positions[LB] = transform.TransformPoint(0, bottomEdge, leftEdge); + positions[RT] = transform.TransformPoint(0, topEdge, rightEdge); + positions[RB] = transform.TransformPoint(0, bottomEdge, rightEdge); break; case Axis.Y: @@ -269,10 +270,10 @@ public static void GetCornerAndMidPointPositions2D(this Bounds bounds, Transform bottomEdge = center.x - extents.x; topEdge = center.x + extents.x; // Transform all the local points to world space. - positions[BoundsExtensions.LT] = transform.TransformPoint(topEdge, 0, leftEdge); - positions[BoundsExtensions.LB] = transform.TransformPoint(bottomEdge, 0, leftEdge); - positions[BoundsExtensions.RT] = transform.TransformPoint(topEdge, 0, rightEdge); - positions[BoundsExtensions.RB] = transform.TransformPoint(bottomEdge, 0, rightEdge); + positions[LT] = transform.TransformPoint(topEdge, 0, leftEdge); + positions[LB] = transform.TransformPoint(bottomEdge, 0, leftEdge); + positions[RT] = transform.TransformPoint(topEdge, 0, rightEdge); + positions[RB] = transform.TransformPoint(bottomEdge, 0, rightEdge); break; case Axis.Z: @@ -281,17 +282,17 @@ public static void GetCornerAndMidPointPositions2D(this Bounds bounds, Transform bottomEdge = center.y - extents.y; topEdge = center.y + extents.y; // Transform all the local points to world space. - positions[BoundsExtensions.LT] = transform.TransformPoint(leftEdge, topEdge, 0); - positions[BoundsExtensions.LB] = transform.TransformPoint(leftEdge, bottomEdge, 0); - positions[BoundsExtensions.RT] = transform.TransformPoint(rightEdge, topEdge, 0); - positions[BoundsExtensions.RB] = transform.TransformPoint(rightEdge, bottomEdge, 0); + positions[LT] = transform.TransformPoint(leftEdge, topEdge, 0); + positions[LB] = transform.TransformPoint(leftEdge, bottomEdge, 0); + positions[RT] = transform.TransformPoint(rightEdge, topEdge, 0); + positions[RB] = transform.TransformPoint(rightEdge, bottomEdge, 0); break; } - positions[BoundsExtensions.LT_RT] = Vector3.Lerp(positions[BoundsExtensions.LT], positions[BoundsExtensions.RT], 0.5f); - positions[BoundsExtensions.RT_RB] = Vector3.Lerp(positions[BoundsExtensions.RT], positions[BoundsExtensions.RB], 0.5f); - positions[BoundsExtensions.RB_LB] = Vector3.Lerp(positions[BoundsExtensions.RB], positions[BoundsExtensions.LB], 0.5f); - positions[BoundsExtensions.LB_LT] = Vector3.Lerp(positions[BoundsExtensions.LB], positions[BoundsExtensions.LT], 0.5f); + positions[LT_RT] = Vector3.Lerp(positions[LT], positions[RT], 0.5f); + positions[RT_RB] = Vector3.Lerp(positions[RT], positions[RB], 0.5f); + positions[RB_LB] = Vector3.Lerp(positions[RB], positions[LB], 0.5f); + positions[LB_LT] = Vector3.Lerp(positions[LB], positions[LT], 0.5f); } /// @@ -446,10 +447,8 @@ public static bool CloserToPoint(this Bounds bounds, Vector3 point, Bounds other return (toCenter1.magnitude <= toCenter2.magnitude); } - else - { - return (distToClosestPoint1.magnitude <= distToClosestPoint2.magnitude); - } + + return (distToClosestPoint1.magnitude <= distToClosestPoint2.magnitude); } #endregion diff --git a/Assets/MixedRealityToolkit/_Core/Extensions/DoubleExtensions.cs b/Assets/MixedRealityToolkit/_Core/Extensions/DoubleExtensions.cs index 0b4c05a392f..425a534e092 100644 --- a/Assets/MixedRealityToolkit/_Core/Extensions/DoubleExtensions.cs +++ b/Assets/MixedRealityToolkit/_Core/Extensions/DoubleExtensions.cs @@ -11,7 +11,7 @@ namespace Microsoft.MixedReality.Toolkit.Internal.Extensions public static class DoubleExtensions { /// - /// Checks if two numbers are approximately equal. Similar to , but the tolerance + /// Checks if two numbers are approximately equal. Similar to , but the tolerance /// can be specified. /// /// One of the numbers to compare. diff --git a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality3DoFInputHandler.cs b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality3DoFInputHandler.cs new file mode 100644 index 00000000000..a6861e68b8b --- /dev/null +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality3DoFInputHandler.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input; + +namespace Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem.Handlers +{ + /// + /// Interface to implement for 3 Degree of Freedom input. + /// + public interface IMixedReality3DoFInputHandler : IMixedRealityInputHandler + { + /// + /// 3 Degree of Freedom input update. + /// + /// + void On3DoFInputChanged(ThreeDoFInputEventData eventData); + } +} \ No newline at end of file diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourcePositionEventData.cs.meta b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality3DoFInputHandler.cs.meta similarity index 74% rename from Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourcePositionEventData.cs.meta rename to Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality3DoFInputHandler.cs.meta index 96faeef4f5d..36440610d53 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourcePositionEventData.cs.meta +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality3DoFInputHandler.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: d769e3ca3c2035244be947203cdb1acd -timeCreated: 1487717291 -licenseType: Pro +guid: 6b81accff6a3443c944a88b28325dd38 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality6DoFInputHandler.cs b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality6DoFInputHandler.cs new file mode 100644 index 00000000000..4b2b90147ec --- /dev/null +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality6DoFInputHandler.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using Microsoft.MixedReality.Toolkit.Internal.EventDatum.Input; + +namespace Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem.Handlers +{ + /// + /// Interface to implement for 6 Degree of Freedom input. + /// + public interface IMixedReality6DoFInputHandler : IMixedReality3DoFInputHandler + { + /// + /// Six Degree of Freedom input update. + /// + /// + void On6DoFInputChanged(SixDoFInputEventData eventData); + } +} \ No newline at end of file diff --git a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceRotationEventData.cs.meta b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality6DoFInputHandler.cs.meta similarity index 74% rename from Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceRotationEventData.cs.meta rename to Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality6DoFInputHandler.cs.meta index f1942d8b4d4..e3f55997af8 100644 --- a/Assets/MixedRealityToolkit/_Core/EventDatum/Input/SourceRotationEventData.cs.meta +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedReality6DoFInputHandler.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 46bec53400582f347869fcef85519630 -timeCreated: 1487798430 -licenseType: Pro +guid: d2a924925bc24e7a91107eb50ebf5cdb MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityInputHandler.cs b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityInputHandler.cs index 22f9a1b42e0..906e67ac681 100644 --- a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityInputHandler.cs +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityInputHandler.cs @@ -7,7 +7,7 @@ namespace Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem.Handlers { /// - /// Interface to implement to react to simple generic input. + /// Interface to implement for simple generic input. /// public interface IMixedRealityInputHandler : IEventSystemHandler { @@ -34,6 +34,6 @@ public interface IMixedRealityInputHandler : IEventSystemHandler /// Input Position updates from Thumbsticks, Touchpads, or any other simple input with a position. /// /// InputDualAxisPositionEventData - void OnDualAxisInputChanged(DualAxisInputEventData eventData); + void On2DoFInputChanged(TwoDoFInputEventData eventData); } } \ No newline at end of file diff --git a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityPointerHandler.cs b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityPointerHandler.cs index 1d55d085c3d..d656eb0b8b3 100644 --- a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityPointerHandler.cs +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealityPointerHandler.cs @@ -11,8 +11,8 @@ namespace Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem.Handler /// public interface IMixedRealityPointerHandler : IEventSystemHandler { - void OnPointerUp(ClickEventData eventData); - void OnPointerDown(ClickEventData eventData); - void OnPointerClicked(ClickEventData eventData); + void OnPointerUp(InputClickEventData eventData); + void OnPointerDown(InputClickEventData eventData); + void OnPointerClicked(InputClickEventData eventData); } } \ No newline at end of file diff --git a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealitySourceStateHandler.cs b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealitySourceStateHandler.cs index 6b30ad76b41..aedb52dd289 100644 --- a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealitySourceStateHandler.cs +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/Handlers/IMixedRealitySourceStateHandler.cs @@ -13,7 +13,5 @@ public interface IMixedRealitySourceStateHandler : IEventSystemHandler { void OnSourceDetected(SourceStateEventData eventData); void OnSourceLost(SourceStateEventData eventData); - void OnSourcePositionChanged(SourcePositionEventData eventData); - void OnSourceRotationChanged(SourceRotationEventData eventData); } } diff --git a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/IMixedRealityInputSystem.cs b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/IMixedRealityInputSystem.cs index 8ea3c62948b..36c73d4f91b 100644 --- a/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/IMixedRealityInputSystem.cs +++ b/Assets/MixedRealityToolkit/_Core/Interfaces/InputSystem/IMixedRealityInputSystem.cs @@ -104,76 +104,170 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem /// a new unique Id for the input source. uint GenerateNewSourceId(); - void RaiseSourceDetected(IMixedRealityInputSource source, object[] tags = null); - - void RaiseSourceLost(IMixedRealityInputSource source, object[] tags = null); - - void RaiseSourcePositionChanged(IMixedRealityInputSource source, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null); - - void RaiseSourcePositionChanged(IMixedRealityInputSource source, Handedness sourceHandedness, Vector3 pointerPosition, Vector3 gripPosition, object[] tags = null); - - void RaiseSourceRotationChanged(IMixedRealityInputSource source, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null); + /// + /// Raise the event that the Input Source was detected. + /// + /// The detected Input Source. + void RaiseSourceDetected(IMixedRealityInputSource source); - void RaiseSourceRotationChanged(IMixedRealityInputSource source, Handedness sourceHandedness, Quaternion pointerRotation, Quaternion gripRotation, object[] tags = null); + /// + /// Raise the event that the Input Source was lost. + /// + /// The lost Input Source. + void RaiseSourceLost(IMixedRealityInputSource source); + /// + /// Raise the pre-focus changed event. + /// This event is useful for doing logic before the focus changed event. + /// + /// The pointer that the focus change event is raised on. + /// The old focused object. + /// The new focused object. void RaisePreFocusChangedEvent(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject); + /// + /// Raise the focus changed event. + /// + /// The pointer that the focus change event is raised on. + /// The old focused object. + /// The new focused object. void OnFocusChangedEvent(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject); + /// + /// Raise the focus enter event. + /// + /// The pointer that has focus. + /// The that the pointer has entered focus on. void RaiseFocusEnter(IMixedRealityPointer pointer, GameObject focusedObject); + /// + /// Raise the focus exit event. + /// + /// The pointer that has lost focus. + /// The that the pointer has exited focus on. void RaiseFocusExit(IMixedRealityPointer pointer, GameObject unfocusedObject); - void RaisePointerDown(IMixedRealityPointer pointer, object[] tags = null); + /// + /// Raise the pointer down event. + /// + /// The pointer where the event originates. + void RaisePointerDown(IMixedRealityPointer pointer); - void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness, object[] tags = null); + /// + /// Raise the pointer down event. + /// + /// The pointer where the event originates. + /// The handedness of the event. + void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness); - void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, object[] tags = null); + /// + /// Raise the pointer down event. + /// + /// + /// + /// + void RaisePointerDown(IMixedRealityPointer pointer, Handedness handedness, InputType inputType); - void RaiseInputClicked(IMixedRealityPointer pointer, int tapCount, object[] tags = null); + /// + /// Raise the pointer clicked event. + /// + /// + /// + void RaiseInputClicked(IMixedRealityPointer pointer, int count); - void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, int count, object[] tags = null); + /// + /// Raise the pointer clicked event. + /// + /// + /// + /// + void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, int count); - void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, int count, object[] tags = null); + /// + /// Raise the pointer clicked event. + /// + /// + /// + /// + /// + void RaiseInputClicked(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, int count); - void RaisePointerUp(IMixedRealityPointer pointer, object[] tags = null); + /// + /// Raise the pointer up event. + /// + /// + void RaisePointerUp(IMixedRealityPointer pointer); - void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, object[] tags = null); + /// + /// Raise the pointer up event. + /// + /// + /// + void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness); - void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, InputType inputType, object[] tags = null); + /// + /// Raise the pointer up event. + /// + /// + /// + /// + void RaisePointerUp(IMixedRealityPointer pointer, Handedness handedness, InputType inputType); - void RaiseOnInputDown(IMixedRealityInputSource source, object[] tags = null); + /// + /// Raise the input down event. + /// + /// + void RaiseOnInputDown(IMixedRealityInputSource source); - void RaiseOnInputDown(IMixedRealityInputSource source, KeyCode keyCode, object[] tags = null); + /// + /// Raise the input down event. + /// + /// + /// + void RaiseOnInputDown(IMixedRealityInputSource source, KeyCode keyCode); - void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// Raise the input down event. + /// + /// + /// + void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness); - void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, object[] tags = null); + /// + /// Raise the input down event. + /// + /// + /// + /// + void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode); - void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, InputType inputType, object[] tags = null); + /// + /// Raise the input down event. + /// + /// + /// + /// + void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, InputType inputType); /// /// Raise Input Pressed. /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source); /// /// Raise Input Pressed. /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode); /// /// Raise Input Pressed. /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, double pressAmount, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, double pressAmount); /// /// Raise Input Pressed. @@ -181,8 +275,7 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, double pressAmount, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, double pressAmount); /// /// Raise Input Pressed. @@ -190,8 +283,7 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode, double pressAmount, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, KeyCode keyCode, double pressAmount); /// /// Raise Input Pressed. @@ -199,8 +291,7 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, InputType inputType, double pressAmount, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, InputType inputType, double pressAmount); /// /// Raise Input Pressed. @@ -209,8 +300,7 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, double pressAmount, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, double pressAmount); /// /// Raise Input Pressed. @@ -219,78 +309,307 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem /// /// /// - /// - void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, InputType inputType, float pressAmount, object[] tags = null); + void RaiseOnInputPressed(IMixedRealityInputSource source, Handedness handedness, InputType inputType, float pressAmount); + + /// + /// Raise the input up event. + /// + /// + void RaiseOnInputUp(IMixedRealityInputSource source); + + /// + /// Raise the input up event. + /// + /// + /// + void RaiseOnInputUp(IMixedRealityInputSource source, KeyCode keyCode); + + /// + /// Raise the input up event. + /// + /// + /// + void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness); + + /// + /// Raise the input up event. + /// + /// + /// + /// + void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode); - void RaiseOnInputUp(IMixedRealityInputSource source, object[] tags = null); + /// + /// Raise the input up event. + /// + /// + /// + /// + void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, InputType inputType); - void RaiseOnInputUp(IMixedRealityInputSource source, KeyCode keyCode, object[] tags = null); + /// + /// Raise the 2 degrees of freedom input event. + /// + /// + /// + /// + void Raise2DoFInputChanged(IMixedRealityInputSource source, InputType inputType, Vector2 position); - void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// Raise the 2 degrees of freedom input event. + /// + /// + /// + /// + /// + void Raise2DoFInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Vector2 position); - void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, KeyCode keyCode, object[] tags = null); + /// + /// Raise the 3 degrees of freedom input event. + /// + /// + /// + /// + void Raise3DoFInputChanged(IMixedRealityInputSource source, InputType inputType, Vector3 position); + + /// + /// Raise the 3 degrees of freedom input event. + /// + /// + /// + /// + /// + void Raise3DoFInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Vector3 position); + + /// + /// Raise the 3 degrees of freedom input event. + /// + /// + /// + /// + void Raise3DoFInputChanged(IMixedRealityInputSource source, InputType inputType, Quaternion rotation); - void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, InputType inputType, object[] tags = null); + /// + /// Raise the 3 degrees of freedom input event. + /// + /// + /// + /// + /// + void Raise3DoFInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Quaternion rotation); - void RaiseDualAxisInputChanged(IMixedRealityInputSource source, InputType inputType, Vector2 inputPosition, object[] tags = null); + /// + /// Raise the 6 degrees of freedom input event. + /// + /// + /// + /// + void Raise6DofInputChanged(IMixedRealityInputSource source, InputType inputType, Tuple inputData); - void RaiseDualAxisInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Vector2 inputPosition, object[] tags = null); + /// + /// Raise the 6 degrees of freedom input event. + /// + /// + /// + /// + /// + void Raise6DofInputChanged(IMixedRealityInputSource source, Handedness handedness, InputType inputType, Tuple inputData); - void RaiseHoldStarted(IMixedRealityInputSource source, object[] tags = null); + /// + /// Raise the hold started input event. + /// + /// + void RaiseHoldStarted(IMixedRealityInputSource source); - void RaiseHoldStarted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// Raise the hold started input event. + /// + /// + /// + void RaiseHoldStarted(IMixedRealityInputSource source, Handedness handedness); - void RaiseHoldCompleted(IMixedRealityInputSource source, object[] tags = null); + /// + /// Raise the hold completed input event. + /// + /// + void RaiseHoldCompleted(IMixedRealityInputSource source); - void RaiseHoldCompleted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// Raise the hold completed input event. + /// + /// + /// + void RaiseHoldCompleted(IMixedRealityInputSource source, Handedness handedness); - void RaiseHoldCanceled(IMixedRealityInputSource source, object[] tags = null); + /// + /// Raise the hold canceled input event. + /// + /// + void RaiseHoldCanceled(IMixedRealityInputSource source); - void RaiseHoldCanceled(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// Raise the hold canceled input event. + /// + /// + /// + void RaiseHoldCanceled(IMixedRealityInputSource source, Handedness handedness); - void RaiseNavigationStarted(IMixedRealityInputSource source, object[] tags = null); + /// + /// Raise the navigation started input event. + /// + /// + void RaiseNavigationStarted(IMixedRealityInputSource source); - void RaiseNavigationStarted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// Raise the navigation started input event. + /// + /// + /// + void RaiseNavigationStarted(IMixedRealityInputSource source, Handedness handedness); - void RaiseNavigationUpdated(IMixedRealityInputSource source, Vector3 normalizedOffset, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseNavigationUpdated(IMixedRealityInputSource source, Vector3 normalizedOffset); - void RaiseNavigationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseNavigationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset); - void RaiseNavigationCompleted(IMixedRealityInputSource source, Vector3 normalizedOffset, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseNavigationCompleted(IMixedRealityInputSource source, Vector3 normalizedOffset); - void RaiseNavigationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseNavigationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 normalizedOffset); - void RaiseNavigationCanceled(IMixedRealityInputSource source, object[] tags = null); + /// + /// + /// + /// + void RaiseNavigationCanceled(IMixedRealityInputSource source); - void RaiseNavigationCanceled(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseNavigationCanceled(IMixedRealityInputSource source, Handedness handedness); - void RaiseManipulationStarted(IMixedRealityInputSource source, object[] tags = null); + /// + /// + /// + /// + void RaiseManipulationStarted(IMixedRealityInputSource source); - void RaiseManipulationStarted(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseManipulationStarted(IMixedRealityInputSource source, Handedness handedness); - void RaiseManipulationUpdated(IMixedRealityInputSource source, Vector3 cumulativeDelta, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseManipulationUpdated(IMixedRealityInputSource source, Vector3 cumulativeDelta); - void RaiseManipulationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseManipulationUpdated(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta); - void RaiseManipulationCompleted(IMixedRealityInputSource source, Vector3 cumulativeDelta, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseManipulationCompleted(IMixedRealityInputSource source, Vector3 cumulativeDelta); - void RaiseManipulationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseManipulationCompleted(IMixedRealityInputSource source, Handedness handedness, Vector3 cumulativeDelta); - void RaiseManipulationCanceled(IMixedRealityInputSource source, object[] tags = null); + /// + /// + /// + /// + void RaiseManipulationCanceled(IMixedRealityInputSource source); - void RaiseManipulationCanceled(IMixedRealityInputSource source, Handedness handedness, object[] tags = null); + /// + /// + /// + /// + /// + void RaiseManipulationCanceled(IMixedRealityInputSource source, Handedness handedness); #if UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN - void RaiseSpeechKeywordPhraseRecognized(IMixedRealityInputSource source, UnityEngine.Windows.Speech.ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, UnityEngine.Windows.Speech.SemanticMeaning[] semanticMeanings, string text, object[] tags = null); + /// + /// + /// + /// + /// + /// + /// + /// + /// + void RaiseSpeechKeywordPhraseRecognized(IMixedRealityInputSource source, UnityEngine.Windows.Speech.ConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, UnityEngine.Windows.Speech.SemanticMeaning[] semanticMeanings, string text); - void RaiseDictationHypothesis(IMixedRealityInputSource source, string dictationHypothesis, AudioClip dictationAudioClip = null, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseDictationHypothesis(IMixedRealityInputSource source, string dictationHypothesis, AudioClip dictationAudioClip = null); - void RaiseDictationResult(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseDictationResult(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null); - void RaiseDictationComplete(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseDictationComplete(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip); - void RaiseDictationError(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null, object[] tags = null); + /// + /// + /// + /// + /// + /// + void RaiseDictationError(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null); #endif // UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_EDITOR_WIN }