Commit 29de0c28 authored by BlackAngle233's avatar BlackAngle233
Browse files

10.19 learned

parent 912976bb
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Provides eye tracking information.
/// </summary>
public interface IMixedRealityEyeGazeDataProvider : IMixedRealityInputDeviceManager
{
IMixedRealityEyeSaccadeProvider SaccadeProvider { get; }
bool SmoothEyeTracking { get; set; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Implements the Gaze Provider for an Input Source.
/// </summary>
public interface IMixedRealityEyeGazeProvider : IMixedRealityGazeProvider
{
/// <summary>
/// Whether eye tracking data is currently been used for gaze rather then head pose. Eye Tracking must be both enabled and have valid data.
/// </summary>
bool IsEyeTrackingEnabledAndValid { get; }
/// <summary>
/// Whether eye tracking data is available. It may be unavailable due to timeout or lack of tracking hardware or permissions.
/// </summary>
bool IsEyeTrackingDataValid { get; }
/// <summary>
/// Whether the user is eye calibrated. It returns 'null', if the value has not yet received data from the eye tracking system.
/// </summary>
bool? IsEyeCalibrationValid { get; }
/// <summary>
/// The most recent eye tracking ray
/// </summary>
Ray LatestEyeGaze { get; }
/// <summary>
/// If true, eye-based tracking will be used when available.
/// </summary>
/// <remarks>
/// The usage of eye-based tracking depends on having the Gaze Input permission set
/// and user approved, along with proper device eye calibration. This will fallback to head-based
/// gaze when eye-based tracking is not available.
/// </remarks>
bool IsEyeTrackingEnabled { get; set; }
/// <summary>
/// DateTime in UTC when the signal was last updated.
/// </summary>
DateTime Timestamp { get; }
/// <summary>
/// Tells the eye gaze provider that eye gaze has updated.
/// </summary>
/// <param name="provider">The provider raising the event.</param>
/// <remarks>
/// This method is to be called by implementations of the <see cref="IMixedRealityEyeGazeDataProvider"/> interface, not by application code.
/// </remarks>
void UpdateEyeGaze(IMixedRealityEyeGazeDataProvider provider, Ray eyeRay, DateTime timestamp);
/// <summary>
/// Tells the eye gaze provider about the eye tracking status (e.g., whether the user is calibrated);
/// </summary>
/// <param name="provider">The provider raising the event.</param>
/// <param name="userIsEyeCalibrated">Boolean whether the user is eye calibrated or not.</param>
/// <remarks>
/// Note that this function is not invoked when eye tracking is lost - use IsEyeTrackingAvailable
/// to detect when eye tracking is lost.
/// </remarks>
void UpdateEyeTrackingStatus(IMixedRealityEyeGazeDataProvider provider, bool userIsEyeCalibrated);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Provides eye tracking saccade events.
/// </summary>
public interface IMixedRealityEyeSaccadeProvider : IMixedRealityDataProvider
{
/// <summary>
/// Triggered when user is saccading across the view (jumping quickly with their eye gaze above a certain threshold in visual angles).
/// </summary>
event Action OnSaccade;
/// <summary>
/// Triggered when user is saccading horizontally across the view (jumping quickly with their eye gaze above a certain threshold in visual angles).
/// </summary>
event Action OnSaccadeX;
/// <summary>
/// Triggered when user is saccading vertically across the view (jumping quickly with their eye gaze above a certain threshold in visual angles).
/// </summary>
event Action OnSaccadeY;
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Physics;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Delegate type used to handle primary pointer changes.
/// Old and new pointer values can be null to indicate transition from or to no primary pointer, but they won't both be null simultaneously.
/// </summary>
public delegate void PrimaryPointerChangedHandler(IMixedRealityPointer oldPointer, IMixedRealityPointer newPointer);
/// <summary>
/// Implements the Focus Provider for handling focus of pointers.
/// </summary>
public interface IMixedRealityFocusProvider : IMixedRealityService, IMixedRealitySourceStateHandler, IMixedRealitySpeechHandler
{
/// <summary>
/// Maximum distance at which all pointers can collide with a <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>, unless it has an override extent.
/// </summary>
float GlobalPointingExtent { get; }
/// <summary>
/// The layer masks for the focus pointers to raycast against.
/// </summary>
LayerMask[] FocusLayerMasks { get; }
/// <summary>
/// The Camera the <see href="https://docs.unity3d.com/ScriptReference/EventSystems.EventSystem.html">EventSystem</see> uses to raycast against.
/// </summary>
/// <remarks>Every uGUI canvas in your scene should use this camera as its event camera.</remarks>
Camera UIRaycastCamera { get; }
/// <summary>
/// Current primary pointer. Determined by the primary pointer selector in use (see MixedRealityPointerProfile.PrimaryPointerSelector).
/// </summary>
IMixedRealityPointer PrimaryPointer { get; }
/// <summary>
/// Gets the currently focused object for the pointing source.
/// </summary>
/// <remarks>If the pointing source is not registered, then the Gaze's Focused <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> is returned.</remarks>
/// <returns>Currently Focused Object.</returns>
GameObject GetFocusedObject(IMixedRealityPointer pointingSource);
/// <summary>
/// Gets the currently focused object for the pointing source.
/// </summary>
bool TryGetFocusDetails(IMixedRealityPointer pointer, out FocusDetails focusDetails);
/// <summary>
/// Sets the FocusDetails of the specified pointer, overriding the focus point that was currently set. This can be used to change
/// the FocusDetails of a specific pointer even if focus is locked.
/// </summary>
/// <returns>
/// True if the FocusDetails were set successfully. False if the pointer is not associated with the FocusProvider.
/// </returns>
bool TryOverrideFocusDetails(IMixedRealityPointer pointer, FocusDetails focusDetails);
/// <summary>
/// Generate a new unique pointer id.
/// </summary>
uint GenerateNewPointerId();
/// <summary>
/// Checks if the pointer is registered with the Focus Manager.
/// </summary>
/// <returns>True, if registered, otherwise false.</returns>
bool IsPointerRegistered(IMixedRealityPointer pointer);
/// <summary>
/// Registers the pointer with the Focus Manager.
/// </summary>
/// <returns>True, if the pointer was registered, false if the pointer was previously registered.</returns>
bool RegisterPointer(IMixedRealityPointer pointer);
/// <summary>
/// Unregisters the pointer with the Focus Manager.
/// </summary>
/// <returns>True, if the pointer was unregistered, false if the pointer was not registered.</returns>
bool UnregisterPointer(IMixedRealityPointer pointer);
/// <summary>
/// Provides access to all registered pointers of a specified type.
/// </summary>
/// <typeparam name="T">The type of pointers to request. Use IMixedRealityPointer to access all pointers.</typeparam>
IEnumerable<T> GetPointers<T>() where T : class, IMixedRealityPointer;
/// <summary>
/// Subscribes to primary pointer changes.
/// </summary>
/// <param name="handler">Handler to be called when the primary pointer changes</param>
/// <param name="invokeHandlerWithCurrentPointer">When true, the passed in handler will be invoked immediately with the current primary pointer
/// before subscribing. This is useful to avoid having to manually poll the current value.</param>
void SubscribeToPrimaryPointerChanged(PrimaryPointerChangedHandler handler, bool invokeHandlerWithCurrentPointer);
/// <summary>
/// Unsubscribes from primary pointer changes.
/// </summary>
/// <param name="handler">Handler to unsubscribe</param>
void UnsubscribeFromPrimaryPointerChanged(PrimaryPointerChangedHandler handler);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Implements the Gaze Provider for an Input Source.
/// </summary>
public interface IMixedRealityGazeProvider
{
/// <summary>
/// Enable or disable the <see href="https://docs.unity3d.com/ScriptReference/Component.html">Component</see> attached to the <see cref="GameObjectReference"/>
/// </summary>
bool Enabled { get; set; }
/// <summary>
/// The Gaze Input Source for the provider.
/// </summary>
IMixedRealityInputSource GazeInputSource { get; }
/// <summary>
/// The Gaze Pointer for the provider.
/// </summary>
IMixedRealityPointer GazePointer { get; }
/// <summary>
/// The prefab to be instantiated as the gaze cursor.
/// </summary>
GameObject GazeCursorPrefab { set; }
/// <summary>
/// The Gaze Cursor for the provider.
/// </summary>
IMixedRealityCursor GazeCursor { get; }
/// <summary>
/// The game object that is currently being gazed at, if any.
/// </summary>
GameObject GazeTarget { get; }
/// <summary>
/// HitInfo property gives access to information at the object being gazed at, if any.
/// </summary>
MixedRealityRaycastHit HitInfo { get; }
/// <summary>
/// Position at which the gaze manager hit an object.
/// If no object is currently being hit, this will use the last hit distance.
/// </summary>
Vector3 HitPosition { get; }
/// <summary>
/// Normal of the point at which the gaze manager hit an object.
/// If no object is currently being hit, this will return the previous normal.
/// </summary>
Vector3 HitNormal { get; }
/// <summary>
/// Origin of the gaze.
/// </summary>
Vector3 GazeOrigin { get; }
/// <summary>
/// Normal of the gaze.
/// </summary>
Vector3 GazeDirection { get; }
/// <summary>
/// The current head velocity.
/// </summary>
Vector3 HeadVelocity { get; }
/// <summary>
/// The current head movement direction.
/// </summary>
Vector3 HeadMovementDirection { get; }
/// <summary>
/// Get the GameObject reference for this Gaze Provider.
/// </summary>
GameObject GameObjectReference { get; }
/// <summary>
/// Notifies this gaze provider of its new hit details.
/// </summary>
/// <remarks>
/// For components that care where the user's looking, we need
/// to separately update the gaze info even if gaze isn't used for focus.
/// </remarks>
void UpdateGazeInfoFromHit(MixedRealityRaycastHit raycastHit);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Adds ability to override head gaze on a gaze provider.
/// </summary>
public interface IMixedRealityGazeProviderHeadOverride
{
/// <summary>
/// If true, platform-specific head gaze override is used, when available. Otherwise, the center of the camera frame is used by default.
/// </summary>
bool UseHeadGazeOverride { get; set; }
/// <summary>
/// Allows head gaze to be overridden, typically by platform-specific values.
/// </summary>
void OverrideHeadGaze(Vector3 position, Vector3 forward);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for an input source.
/// An input source is the origin of user input and generally comes from a physical controller, sensor, or other hardware device.
/// </summary>
public interface IMixedRealityInputSource : IMixedRealityEventSource
{
/// <summary>
/// Array of pointers associated with this input source.
/// </summary>
IMixedRealityPointer[] Pointers { get; }
/// <summary>
/// The type of input source this object represents.
/// </summary>
InputSourceType SourceType { get; }
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Manager interface for a Input system in the Mixed Reality Toolkit
/// All replacement systems for providing Input System functionality should derive from this interface
/// </summary>
public interface IMixedRealityInputSystem : IMixedRealityEventSystem
{
/// <summary>
/// Event that's raised when the Input is enabled.
/// </summary>
event Action InputEnabled;
/// <summary>
/// Event that's raised when the Input is disabled.
/// </summary>
event Action InputDisabled;
/// <summary>
/// List of the Interaction Input Sources as detected by the input manager like hands or motion controllers.
/// </summary>
HashSet<IMixedRealityInputSource> DetectedInputSources { get; }
/// <summary>
/// List of <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityController"/>s currently detected by the input manager.
/// </summary>
/// <remarks>
/// This property is similar to <see cref="DetectedInputSources"/>, as this is a subset of those <see cref="IMixedRealityInputSource"/>s in that list.
/// </remarks>
HashSet<IMixedRealityController> DetectedControllers { get; }
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
MixedRealityInputSystemProfile InputSystemProfile { get; }
/// <summary>
/// The current Focus Provider that's been implemented by this Input System.
/// </summary>
IMixedRealityFocusProvider FocusProvider { get; }
/// <summary>
/// The current Raycast Provider that's been implemented by this Input System.
/// </summary>
IMixedRealityRaycastProvider RaycastProvider { get; }
/// <summary>
/// The current Gaze Provider that's been implemented by this Input System.
/// </summary>
IMixedRealityGazeProvider GazeProvider { get; }
/// <summary>
/// The current Eye Gaze Provider that's been implemented by this Input System.
/// </summary>
IMixedRealityEyeGazeProvider EyeGazeProvider { get; }
/// <summary>
/// Indicates if input is currently enabled or not.
/// </summary>
bool IsInputEnabled { get; }
/// <summary>
/// Push a disabled input state onto the Input System.
/// While input is disabled no events will be sent out and the cursor displays
/// a waiting animation.
/// </summary>
void PushInputDisable();
/// <summary>
/// Pop disabled input state. When the last disabled state is
/// popped off the stack input will be re-enabled.
/// </summary>
void PopInputDisable();
/// <summary>
/// Clear the input disable stack, which will immediately re-enable input.
/// </summary>
void ClearInputDisableStack();
/// <summary>
/// Push a game object into the modal input stack. Any input handlers
/// on the game object are given priority to input events before any focused objects.
/// </summary>
/// <param name="inputHandler">The input handler to push</param>
void PushModalInputHandler(GameObject inputHandler);
/// <summary>
/// Remove the last game object from the modal input stack.
/// </summary>
void PopModalInputHandler();
/// <summary>
/// Clear all modal input handlers off the stack.
/// </summary>
void ClearModalInputStack();
/// <summary>
/// Push a game object into the fallback input stack. Any input handlers on
/// the game object are given input events when no modal or focused objects consume the event.
/// </summary>
/// <param name="inputHandler">The input handler to push</param>
void PushFallbackInputHandler(GameObject inputHandler);
/// <summary>
/// Remove the last game object from the fallback input stack.
/// </summary>
void PopFallbackInputHandler();
/// <summary>
/// Clear all fallback input handlers off the stack.
/// </summary>
void ClearFallbackInputStack();
#region Input Events
#region Input Source Events
/// <summary>
/// Generates a new unique input source id.<para/>
/// </summary>
/// <remarks>All Input Sources are required to call this method in their constructor or initialization.</remarks>
/// <returns>a new unique Id for the input source.</returns>
uint GenerateNewSourceId();
IMixedRealityInputSource RequestNewGenericInputSource(string name, IMixedRealityPointer[] pointers = null, InputSourceType sourceType = InputSourceType.Other);
/// <summary>
/// Raise the event that the Input Source was detected.
/// </summary>
/// <param name="source">The detected Input Source.</param>
void RaiseSourceDetected(IMixedRealityInputSource source, IMixedRealityController controller = null);
/// <summary>
/// Raise the event that the Input Source was lost.
/// </summary>
/// <param name="source">The lost Input Source.</param>
void RaiseSourceLost(IMixedRealityInputSource source, IMixedRealityController controller = null);
/// <summary>
/// Raise the event that the Input Source's tracking state has changed.
/// </summary>
void RaiseSourceTrackingStateChanged(IMixedRealityInputSource source, IMixedRealityController controller, TrackingState state);
/// <summary>
/// Raise the event that the Input Source position was changed.
/// </summary>
void RaiseSourcePositionChanged(IMixedRealityInputSource source, IMixedRealityController controller, Vector2 position);
/// <summary>
/// Raise the event that the Input Source position was changed.
/// </summary>
void RaiseSourcePositionChanged(IMixedRealityInputSource source, IMixedRealityController controller, Vector3 position);
/// <summary>
/// Raise the event that the Input Source position was changed.
/// </summary>
void RaiseSourceRotationChanged(IMixedRealityInputSource source, IMixedRealityController controller, Quaternion rotation);
/// <summary>
/// Raise the event that the Input Source position was changed.
/// </summary>
void RaiseSourcePoseChanged(IMixedRealityInputSource source, IMixedRealityController controller, MixedRealityPose position);
#endregion Input Source Events
#region Focus Events
/// <summary>
/// Raise the pre-focus changed event.
/// </summary>
/// <remarks>This event is useful for doing logic before the focus changed event.</remarks>
/// <param name="pointer">The pointer that the focus change event is raised on.</param>
/// <param name="oldFocusedObject">The old focused object.</param>
/// <param name="newFocusedObject">The new focused object.</param>
void RaisePreFocusChanged(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject);
/// <summary>
/// Raise the focus changed event.
/// </summary>
/// <param name="pointer">The pointer that the focus change event is raised on.</param>
/// <param name="oldFocusedObject">The old focused object.</param>
/// <param name="newFocusedObject">The new focused object.</param>
void RaiseFocusChanged(IMixedRealityPointer pointer, GameObject oldFocusedObject, GameObject newFocusedObject);
/// <summary>
/// Raise the focus enter event.
/// </summary>
/// <param name="pointer">The pointer that has focus.</param>
/// <param name="focusedObject">The <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that the pointer has entered focus on.</param>
void RaiseFocusEnter(IMixedRealityPointer pointer, GameObject focusedObject);
/// <summary>
/// Raise the focus exit event.
/// </summary>
/// <param name="pointer">The pointer that has lost focus.</param>
/// <param name="unfocusedObject">The <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that the pointer has exited focus on.</param>
void RaiseFocusExit(IMixedRealityPointer pointer, GameObject unfocusedObject);
#endregion Focus Events
#region Pointers
#region Pointer Down
/// <summary>
/// Raise the pointer down event.
/// </summary>
/// <param name="pointer">The pointer where the event originates.</param>
void RaisePointerDown(IMixedRealityPointer pointer, MixedRealityInputAction inputAction, Handedness handedness = Handedness.None, IMixedRealityInputSource inputSource = null);
#endregion Pointer Down
#region Pointer Dragged
/// <summary>
/// Raise the pointer dragged event.
/// </summary>
/// <param name="pointer">The pointer where the event originates.</param>
void RaisePointerDragged(IMixedRealityPointer pointer, MixedRealityInputAction inputAction, Handedness handedness = Handedness.None, IMixedRealityInputSource inputSource = null);
#endregion Pointer Dragged
#region Pointer Click
/// <summary>
/// Raise the pointer clicked event.
/// </summary>
void RaisePointerClicked(IMixedRealityPointer pointer, MixedRealityInputAction inputAction, int count, Handedness handedness = Handedness.None, IMixedRealityInputSource inputSource = null);
#endregion Pointer Click
#region Pointer Up
/// <summary>
/// Raise the pointer up event.
/// </summary>
void RaisePointerUp(IMixedRealityPointer pointer, MixedRealityInputAction inputAction, Handedness handedness = Handedness.None, IMixedRealityInputSource inputSource = null);
#endregion Pointer Up
#endregion Pointers
#region Generic Input Events
#region Input Down
/// <summary>
/// Raise the input down event.
/// </summary>
void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction);
#endregion Input Down
#region Input Up
/// <summary>
/// Raise the input up event.
/// </summary>
void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction);
#endregion Input Up
#region Float Input Changed
/// <summary>
/// Raise Float Input Changed.
/// </summary>
void RaiseFloatInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, float inputValue);
#endregion Float Input Changed
#region Input Position Changed
/// <summary>
/// Raise the 2 degrees of freedom input event.
/// </summary>
void RaisePositionInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Vector2 position);
/// <summary>
/// Raise the 3 degrees of freedom input event.
/// </summary>
void RaisePositionInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Vector3 position);
#endregion Input Position Changed
#region Input Rotation Changed
/// <summary>
/// Raise the 3 degrees of freedom input event.
/// </summary>
void RaiseRotationInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Quaternion rotation);
#endregion Input Rotation Changed
#region Input Pose Changed
/// <summary>
/// Raise the 6 degrees of freedom input event.
/// </summary>
void RaisePoseInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, MixedRealityPose inputData);
#endregion Input Pose Changed
#endregion Generic Input Events
#region Generic Gesture Events
/// <summary>
/// Raise the Gesture Started Event.
/// </summary>
void RaiseGestureStarted(IMixedRealityController controller, MixedRealityInputAction action);
/// <summary>
/// Raise the Gesture Updated Event.
/// </summary>
void RaiseGestureUpdated(IMixedRealityController controller, MixedRealityInputAction action);
/// <summary>
/// Raise the Gesture Updated Event.
/// </summary>
void RaiseGestureUpdated(IMixedRealityController controller, MixedRealityInputAction action, Vector2 inputData);
/// <summary>
/// Raise the Gesture Updated Event.
/// </summary>
void RaiseGestureUpdated(IMixedRealityController controller, MixedRealityInputAction action, Vector3 inputData);
/// <summary>
/// Raise the Gesture Updated Event.
/// </summary>
void RaiseGestureUpdated(IMixedRealityController controller, MixedRealityInputAction action, Quaternion inputData);
/// <summary>
/// Raise the Gesture Updated Event.
/// </summary>
void RaiseGestureUpdated(IMixedRealityController controller, MixedRealityInputAction action, MixedRealityPose inputData);
/// <summary>
/// Raise the Gesture Completed Event.
/// </summary>
void RaiseGestureCompleted(IMixedRealityController controller, MixedRealityInputAction action);
/// <summary>
/// Raise the Gesture Completed Event.
/// </summary>
void RaiseGestureCompleted(IMixedRealityController controller, MixedRealityInputAction action, Vector2 inputData);
/// <summary>
/// Raise the Gesture Completed Event.
/// </summary>
void RaiseGestureCompleted(IMixedRealityController controller, MixedRealityInputAction action, Vector3 inputData);
/// <summary>
/// Raise the Gesture Completed Event.
/// </summary>
void RaiseGestureCompleted(IMixedRealityController controller, MixedRealityInputAction action, Quaternion inputData);
/// <summary>
/// Raise the Gesture Completed Event.
/// </summary>
void RaiseGestureCompleted(IMixedRealityController controller, MixedRealityInputAction action, MixedRealityPose inputData);
/// <summary>
/// Raise the Gesture Canceled Event.
/// </summary>
void RaiseGestureCanceled(IMixedRealityController controller, MixedRealityInputAction action);
#endregion
#region Speech Keyword Events
/// <summary>
///
/// </summary>
void RaiseSpeechCommandRecognized(IMixedRealityInputSource source, RecognitionConfidenceLevel confidence, TimeSpan phraseDuration, DateTime phraseStartTime, SpeechCommands command);
#endregion Speech Keyword Events
#region Dictation Events
/// <summary>
///
/// </summary>
void RaiseDictationHypothesis(IMixedRealityInputSource source, string dictationHypothesis, AudioClip dictationAudioClip = null);
/// <summary>
///
/// </summary>
void RaiseDictationResult(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null);
/// <summary>
///
/// </summary>
void RaiseDictationComplete(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip);
/// <summary>
///
/// </summary>
void RaiseDictationError(IMixedRealityInputSource source, string dictationResult, AudioClip dictationAudioClip = null);
#endregion Dictation Events
#region Hand Events
/// <summary>
/// Notify system that articulated hand joint info has been updated
/// </summary>
void RaiseHandJointsUpdated(IMixedRealityInputSource source, Handedness handedness, IDictionary<TrackedHandJoint, MixedRealityPose> jointPoses);
/// <summary>
/// Notify system that articulated hand mesh has been updated
/// </summary>
void RaiseHandMeshUpdated(IMixedRealityInputSource source, Handedness handedness, HandMeshInfo handMeshInfo);
void RaiseOnTouchStarted(IMixedRealityInputSource source, IMixedRealityController controller, Handedness handedness, Vector3 touchPoint);
void RaiseOnTouchUpdated(IMixedRealityInputSource source, IMixedRealityController controller, Handedness handedness, Vector3 touchPoint);
void RaiseOnTouchCompleted(IMixedRealityInputSource source, IMixedRealityController controller, Handedness handedness, Vector3 touchPoint);
#endregion Hand Events
#endregion Input Events
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface defining a mouse input device manager.
/// </summary>
public interface IMixedRealityMouseDeviceManager : IMixedRealityInputDeviceManager
{
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
[ObsoleteAttribute("The MouseInputProfile property has been deprecated and will be removed in a future version of MRTK.")]
MixedRealityMouseInputProfile MouseInputProfile { get; }
/// <summary>
/// Gets or sets a multiplier value used to adjust the speed of the mouse cursor.
/// </summary>
float CursorSpeed { get; set; }
/// <summary>
/// Gets or sets a multiplier value used to adjust the speed of the mouse wheel.
/// </summary>
float WheelSpeed { get; set; }
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for handling mouse pointers.
/// </summary>
public interface IMixedRealityMousePointer : IMixedRealityPointer
{
/// <summary>
/// Should the mouse cursor be hidden when no active input is received?
/// </summary>
bool HideCursorWhenInactive { get; }
/// <summary>
/// What is the movement threshold to reach before un-hiding mouse cursor?
/// </summary>
float MovementThresholdToUnHide { get; }
/// <summary>
/// How long should it take before the mouse cursor is hidden?
/// </summary>
float HideTimeout { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
public interface IMixedRealityNearPointer : IMixedRealityPointer
{
/// <summary>
/// Returns true if the hand is near anything that's grabbable
/// Currently performs a sphere cast in the direction of the hand ray.
/// Currently anything that has a collider is considered "Grabbable"
/// Eventually we need to filter based on things that can respond
/// to grab events.
/// </summary>
bool IsNearObject { get; }
/// <summary>
/// For near pointer we may want to draw a tether between the pointer
/// and the object.
///
/// The visual grasp point (average of index and thumb) may actually be different from the pointer
/// position (the palm).
///
/// This method provides a mechanism to get the visual grasp point.
///
/// NOTE: Not all near pointers have a grasp point (for example a poke pointer).
/// </summary>
/// <param name="position">Out parameter filled with the grasp position if available, otherwise <see href="https://docs.unity3d.com/ScriptReference/Vector3-zero.html">Vector3.zero</see>.</param>
/// <returns>True if a grasp point was retrieved, false if not.</returns>
bool TryGetNearGraspPoint(out Vector3 position);
/// <summary>
/// Near pointers often interact with surfaces.
///
/// This method provides a mechanism to get the distance to the closest surface the near pointer is interacting with.
///
/// </summary>
/// <param name="distance">Out parameter filled with the distance along the surface normal from the surface to the pointer if available, otherwise 0.0f.</param>
/// <returns>True if a distance was retrieved, false if not.</returns>
bool TryGetDistanceToNearestSurface(out float distance);
/// <summary>
/// Near pointers often interact with surfaces.
///
/// This method provides a mechanism to get the normal of the closest surface the near pointer is interacting with.
///
/// </summary>
/// <param name="normal">Out parameter filled with the surface normal if available, otherwise <see href="https://docs.unity3d.com/ScriptReference/Vector3-zero.html">Vector3.zero</see>.</param>
/// <returns>True if a normal was retrieved, false if not.</returns>
bool TryGetNormalToNearestSurface(out Vector3 normal);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Physics;
using System.Collections;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for handling pointers.
/// </summary>
public interface IMixedRealityPointer : IEqualityComparer
{
/// <summary>
/// The pointer's current controller reference.
/// </summary>
IMixedRealityController Controller { get; set; }
/// <summary>
/// This pointer's id.
/// </summary>
uint PointerId { get; }
/// <summary>
/// This pointer's name.
/// </summary>
string PointerName { get; set; }
/// <summary>
/// This pointer's input source parent.
/// </summary>
IMixedRealityInputSource InputSourceParent { get; }
/// <summary>
/// The pointer's cursor.
/// </summary>
IMixedRealityCursor BaseCursor { get; set; }
/// <summary>
/// The currently active cursor modifier.
/// </summary>
ICursorModifier CursorModifier { get; set; }
/// <summary>
/// Is the pointer active and have the conditions for the interaction been satisfied to enable the interaction?
/// </summary>
bool IsInteractionEnabled { get; }
/// <summary>
/// Controls whether the pointer dispatches input..
/// </summary>
bool IsActive { get; set; }
/// <summary>
/// Is the focus for this pointer currently locked?
/// </summary>
bool IsFocusLocked { get; set; }
/// <summary>
/// Specifies whether the pointer's target position (cursor) is locked to the target object when focus is locked.
/// </summary>
bool IsTargetPositionLockedOnFocusLock { get; set; }
/// <summary>
/// The scene query rays.
/// </summary>
RayStep[] Rays { get; }
/// <summary>
/// The physics layers to use when performing scene queries.
/// </summary>
/// <remarks>If set, will override the <see cref="IMixedRealityInputSystem"/>'s default scene query layer mask array.</remarks>
/// <example>
/// Allow the pointer to hit SR, but first prioritize any DefaultRaycastLayers (potentially behind SR)
/// <code language="csharp"><![CDATA[
/// int sr = LayerMask.GetMask("SR");
/// int nonSR = Physics.DefaultRaycastLayers &amp; ~sr;
/// IMixedRealityPointer.PrioritizedLayerMasksOverride = new LayerMask[] { nonSR, sr };
/// ]]></code>
/// </example>
LayerMask[] PrioritizedLayerMasksOverride { get; set; }
/// <summary>
/// The currently focused target.
/// </summary>
IMixedRealityFocusHandler FocusTarget { get; set; }
/// <summary>
/// The scene query pointer result.
/// </summary>
IPointerResult Result { get; set; }
/// <summary>
/// The type of physics scene query to use.
/// </summary>
SceneQueryType SceneQueryType { get; set; }
/// <summary>
/// The radius to use when <see cref="SceneQueryType"/> is set to Sphere or SphereColliders.
/// </summary>
float SphereCastRadius { get; set; }
/// <summary>
/// Pointer position.
/// </summary>
Vector3 Position { get; }
/// <summary>
/// Pointer rotation.
/// </summary>
Quaternion Rotation { get; }
/// <summary>
/// Called before performing the scene query.
/// </summary>
void OnPreSceneQuery();
/// <summary>
/// Called after performing the scene query.
/// </summary>
void OnPostSceneQuery();
/// <summary>
/// Called during the scene query just before the current pointer target changes.
/// </summary>
void OnPreCurrentPointerTargetChange();
/// <summary>
/// Resets pointer to initial state. After invoked pointer should be functional and ready for re-use.
/// </summary>
/// <remarks>
/// Useful for caching and recycling of pointers
/// </remarks>
void Reset();
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for handling groups of pointers resolving conflicts between them.
/// E.g., ensuring that far pointers are disabled when a near pointer is active.
/// </summary>
public interface IMixedRealityPointerMediator
{
void RegisterPointers(IMixedRealityPointer[] pointers);
void UnregisterPointers(IMixedRealityPointer[] pointers);
void UpdatePointers();
/// <summary>
/// Called to set the pointer preferences of the current input and focus
/// configuration.
/// </summary>
/// <remarks>
/// These preferences can be used by the pointer mediator to determine runtime
/// preferences set by the caller (for example, the caller could request to turn
/// off all hand rays). It's possible that some of these preferences may not be
/// honored (for example, current input system is set up to not have hand rays
/// at all, and a request comes in to turn on/off hand rays).
/// </remarks>
void SetPointerPreferences(IPointerPreferences pointerPreferences);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface used by the focus provider to select the pointer that will be considered as primary.
/// The current primary pointer can we obtained via <see cref="IMixedRealityFocusProvider.PrimaryPointer"/> or
/// subscribing to the primary pointer changed event via <see cref="IMixedRealityFocusProvider.SubscribeToPrimaryPointerChanged"/>.
/// </summary>
public interface IMixedRealityPrimaryPointerSelector
{
/// <summary>
/// Called on initialization of the focus provider to initialize the selector.
/// </summary>
void Initialize();
/// <summary>
/// Called on destruction of the focus provider to destroy the selector.
/// </summary>
void Destroy();
/// <summary>
/// Registers a pointer with the selector.
/// </summary>
void RegisterPointer(IMixedRealityPointer pointer);
/// <summary>
/// Unregisters a pointer with the selector.
/// </summary>
void UnregisterPointer(IMixedRealityPointer pointer);
/// <summary>
/// Called from the focus provider after updating pointers to obtain the new primary pointer.
/// </summary>
/// <returns>The new primary pointer or null if none.</returns>
IMixedRealityPointer Update();
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Physics;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to handle raycasts into the scene. Used by FocusProvider to perform ray and sphere cast queries for pointers.
/// </summary>
/// <remarks>
/// Implementations of IMixedRealityRaycastProvider would likely use Unity's physics system to get hit results from Colliders. However,
/// in a custom implementation, the raycast does not have to rely only on Unity-based Colliders to provide hit results, e.g. a
/// GameObject may use a different mechanism for raycasting, and with a custom implementation, it could be included in the hit result.
/// </remarks>
public interface IMixedRealityRaycastProvider : IMixedRealityService
{
/// <summary>
/// Performs a raycast using the specified <see cref="Microsoft.MixedReality.Toolkit.Physics.RayStep"/>.
/// </summary>
/// <returns>Whether or not the raycast hit something.</returns>
bool Raycast(RayStep step, LayerMask[] prioritizedLayerMasks, bool focusIndividualCompoundCollider, out MixedRealityRaycastHit hitInfo);
/// <summary>
/// Performs a sphere cast with the specified <see cref="Microsoft.MixedReality.Toolkit.Physics.RayStep"/> and radius.
/// </summary>
/// <returns>Whether or not the SphereCast hit something.</returns>
bool SphereCast(RayStep step, float radius, LayerMask[] prioritizedLayerMasks, bool focusIndividualCompoundCollider, out MixedRealityRaycastHit hitInfo);
/// <summary>
/// Performs a graphics raycast against the specified layerMasks.
/// </summary>
/// <returns>The RaycastResult of the raycast.</returns>
RaycastResult GraphicsRaycast(EventSystem eventSystem, PointerEventData pointerEventData, LayerMask[] layerMasks);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Teleport;
namespace Microsoft.MixedReality.Toolkit.Input
{
public interface IMixedRealityTeleportPointer : IMixedRealityPointer
{
/// <summary>
/// True when teleport pointer has raised a request with the teleport manager.
/// </summary>
bool TeleportRequestRaised { get; }
/// <summary>
/// The currently active teleport hotspot.
/// </summary>
IMixedRealityTeleportHotSpot TeleportHotSpot { get; set; }
/// <summary>
/// The Y orientation of the pointer - used for touchpad rotation and navigation
/// </summary>
float PointerOrientation { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for handling touch pointers.
/// </summary>
public interface IMixedRealityTouchPointer : IMixedRealityPointer
{
/// <summary>
/// Current finger id of the touch.
/// </summary>
int FingerId { get; set; }
/// <summary>
/// Current touch ray.
/// </summary>
Ray TouchRay { get; set; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Provides interface for getting and setting behaviors and
/// possible other settings for pointers in the input system.
/// Behaviors are described based on pointer type and input type,
/// not per pointer. This is to ensure that new pointers that appear
/// maintain consistent behavior.
/// </summary>
public interface IPointerPreferences
{
/// <summary>
/// Gets the <seealso cref="MixedReality.Toolkit.Input.PointerBehavior"/> for a given pointer
/// </summary>
PointerBehavior GetPointerBehavior(IMixedRealityPointer pointer);
/// <summary>
/// Gets the <seealso cref="PointerBehavior"/> for a given pointer type,
/// handedness, and input type
/// </summary>
/// <typeparam name="T">All pointers that are of this type, or a subclass of this type, will have the given behavior</typeparam>
/// <param name="handedness">Specify Handedness.Any to apply to all handedness, or specify a specific handedness to just disable, right, left.</param>
/// <param name="sourceType">Allows specification of pointer behavior per input source, so that pointers can be disabled for hands but not controllers, and vice versa.</param>
PointerBehavior GetPointerBehavior<T>(
Handedness handedness,
InputSourceType sourceType) where T : class, IMixedRealityPointer;
/// <summary>
/// Sets the <seealso cref="PointerBehavior"/> for a given pointer type,
/// handedness, and input type
/// </summary>
/// <typeparam name="T">All pointers that are of this type, or a subclass of this type, will have the given behavior</typeparam>
/// <param name="handedness">Specify Handedness.Any to apply to all handedness, or specify a specific handedness to just disable, right, left.</param>
/// <param name="sourceType">Allows specification of pointer behavior per input source, so that pointers can be disabled for hands but not controllers, and vice versa.</param>
void SetPointerBehavior<T>(Handedness handedness, InputSourceType inputType, PointerBehavior pointerBehavior) where T : class, IMixedRealityPointer;
/// <summary>
/// Pointer behavior for the gaze pointer.
/// We make gaze pointer unique because the internal
/// gaze pointer actually cannot be referenced from here
/// since it's an internal class.
/// </summary>
PointerBehavior GazePointerBehavior { get; set; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Physics;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface defining a pointer result.
/// </summary>
public interface IPointerResult
{
/// <summary>
/// The starting point of the Pointer RaySteps.
/// </summary>
Vector3 StartPoint { get; }
/// <summary>
/// Details about the currently focused <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>.
/// </summary>
FocusDetails Details { get; }
/// <summary>
/// The current pointer's target <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>
/// </summary>
GameObject CurrentPointerTarget { get; }
/// <summary>
/// The previous pointer target.
/// </summary>
GameObject PreviousPointerTarget { get; }
/// <summary>
/// The index of the step that produced the last raycast hit, 0 when no raycast hit.
/// </summary>
int RayStepIndex { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Physics
{
public interface IBaseRayStabilizer
{
Vector3 StablePosition { get; }
Quaternion StableRotation { get; }
Ray StableRay { get; }
void UpdateStability(Vector3 position, Quaternion rotation);
void UpdateStability(Vector3 position, Vector3 direction);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment