AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
BaseInputSource.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 
6 namespace HoloToolkit.Unity.InputModule
7 {
11  public abstract class BaseInputSource : MonoBehaviour, IInputSource
12  {
13  public abstract SupportedInputInfo GetSupportedInputInfo(uint sourceId);
14 
15  public bool SupportsInputInfo(uint sourceId, SupportedInputInfo inputInfo)
16  {
17  return ((GetSupportedInputInfo(sourceId) & inputInfo) == inputInfo);
18  }
19 
20  public abstract bool TryGetSourceKind(uint sourceId, out InteractionSourceInfo sourceKind);
21 
22  public abstract bool TryGetPointerPosition(uint sourceId, out Vector3 position);
23 
24  public abstract bool TryGetPointerRotation(uint sourceId, out Quaternion rotation);
25 
26  public abstract bool TryGetPointingRay(uint sourceId, out Ray pointingRay);
27 
28  public abstract bool TryGetGripPosition(uint sourceId, out Vector3 position);
29 
30  public abstract bool TryGetGripRotation(uint sourceId, out Quaternion rotation);
31 
32  public abstract bool TryGetThumbstick(uint sourceId, out bool isPressed, out Vector2 position);
33 
34  public abstract bool TryGetTouchpad(uint sourceId, out bool isPressed, out bool isTouched, out Vector2 position);
35 
36  public abstract bool TryGetSelect(uint sourceId, out bool isPressed, out double pressedValue);
37 
38  public abstract bool TryGetGrasp(uint sourceId, out bool isPressed);
39 
40  public abstract bool TryGetMenu(uint sourceId, out bool isPressed);
41  }
42 }
SupportedInputInfo
Flags used to indicate which input information is supported by an input source.
bool SupportsInputInfo(uint sourceId, SupportedInputInfo inputInfo)
Returns whether the input source supports the specified input info type.
Interface for an input source. An input source can be anything that a user can use to interact with a...
Definition: IInputSource.cs:12
Base class for an input source.