18 using System.Collections.Generic;
22 #if UNITY_2019_1_OR_NEWER && INPUTSYSTEM_AVAILABLE
23 using UnityEngine.InputSystem;
24 using UnityEngine.InputSystem.Users;
25 using UnityEngine.InputSystem.Controls;
57 #region Private Fields
62 private Dictionary<GlassesHandle, WandPair>
wandCores =
new Dictionary<GlassesHandle, WandPair>();
89 private HashSet<GlassesHandle>
lostHandles =
new HashSet<GlassesHandle>();
91 private HashSet<WandCore>
lostWands =
new HashSet<WandCore>();
106 #endregion Private Fields
109 #region Private Structs
126 switch (controllerIndex)
141 wandCore =
this[controllerIndex];
142 return wandCore !=
null;
146 #endregion Private Structs
149 #region Public Functions
163 if(!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
164 || !
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
165 || !wandPair.TryGet(controllerIndex, out var wandCore))
170 switch (controllerPosition)
173 return wandCore.fingertipsPose_UnityWorldSpace.position;
175 return wandCore.aimPose_UnityWorldSpace.position;
177 return wandCore.Pose_UnityWorldSpace.position;
191 if (!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
192 || !
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
193 || !wandPair.TryGet(controllerIndex, out var wandCore))
195 return Quaternion.identity;
198 return wandCore.Pose_UnityWorldSpace.rotation;
203 if (!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
204 || !
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
205 || !wandPair.TryGet(controllerIndex, out var wandCore))
210 return wandCore.IsTracked;
222 if(!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
223 || !
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
224 || !wandPair.TryGet(controllerIndex, out var wandCore))
230 connected = wandCore.IsConnected;
234 #if UNITY_2019_1_OR_NEWER && INPUTSYSTEM_AVAILABLE
247 if(!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle) || !
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
248 || !wandPair.TryGet(controllerIndex, out var wandCore) || !(wandCore is WandDeviceCore wandDeviceCore))
254 wandDevice = wandDeviceCore.wandDevice;
269 if (!
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle)
270 || !
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
271 || !wandPair.TryGet(controllerIndex, out var wandCore))
278 if (
NativePlugin.SendImpulse(glassesHandle, controllerIndex, amplitude, (UInt16)(Mathf.Clamp(duration, 0.0f, 0.320f) * 1000)) == 0)
287 catch (DllNotFoundException e)
289 Log.
Info(
"Tilt Five library missing. Could not connect to wand: {0}", e.Message);
295 "Failed to send impulse to wand: {0}",
301 #region Deprecated Public Functions
304 [Obsolete(
"Converted to be an internal function.")]
307 Update(playerIndex, wandSettings, scaleSettings, gameBoardSettings);
310 [Obsolete(
"Converted to be an internal function.")]
316 #endregion Deprecated Public Functions
318 #endregion Public Functions
321 #region Internal Functions
326 if (
Player.TryGetGlassesHandle(playerIndex, out var glassesHandle))
328 Update(glassesHandle, wandSettings, scaleSettings, gameBoardSettings);
332 internal static void Update(GlassesHandle glassesHandle, WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings)
334 if (
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
335 && wandPair.TryGet(wandSettings.controllerIndex, out var wandCore))
337 wandCore.Update(wandSettings, scaleSettings, gameBoardSettings);
341 internal static void OnDisable()
343 foreach (var wandPair
in Instance.wandCores.Values)
345 wandPair.RightWand?.Dispose();
346 wandPair.LeftWand?.Dispose();
351 internal static void Scan()
357 var connectedGlassesHandles = Glasses.GetAllConnectedGlassesHandles();
371 for (
int i = 0; i < connectedGlassesHandles.Length; i++)
373 var glassesHandle = connectedGlassesHandles[i];
382 wandCores[glassesHandle] =
new WandPair(rightWandCore, leftWandCore);
386 foreach (var glassesHandle
in wandCores.Keys)
396 if (
wandCores.TryGetValue(glassesHandle, out var wandPair))
414 var lostWandPair =
wandCores[lostHandle];
434 internal static void GetLatestInputs()
445 foreach (var wandPair
in Instance.wandCores.Values)
447 wandPair.RightWand?.GetLatestInputs();
448 wandPair.LeftWand?.GetLatestInputs();
452 internal static bool GetButton(
WandButton button, GlassesHandle glassesHandle,
455 if(!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
456 || !wandPair.TryGet(controllerIndex, out var wandCore))
460 return wandCore.GetButton(button);
463 internal static bool TryGetButton(
WandButton button, out
bool pressed,
466 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
467 || !wandPair.TryGet(controllerIndex, out var wandCore))
473 return wandCore.TryGetButton(button, out pressed);
476 internal static bool GetButtonDown(
WandButton button,
479 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
480 || !wandPair.TryGet(controllerIndex, out var wandCore))
485 return wandCore.GetButtonDown(button);
488 internal static bool TryGetButtonDown(
WandButton button, out
bool buttonDown,
491 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
492 || !wandPair.TryGet(controllerIndex, out var wandCore))
498 return wandCore.TryGetButtonDown(button, out buttonDown);
501 internal static bool GetButtonUp(
WandButton button,
504 if (
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
505 || !wandPair.TryGet(controllerIndex, out var wandCore))
512 return wandCore.GetButtonUp(button);
515 internal static bool TryGetButtonUp(
WandButton button, out
bool buttonUp,
518 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
519 || !wandPair.TryGet(controllerIndex, out var wandCore))
527 return wandCore.TryGetButtonUp(button, out buttonUp);
532 if (
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
533 || !wandPair.TryGet(controllerIndex, out var wandCore))
538 return wandCore.GetStickTilt();
541 internal static bool TryGetStickTilt(out Vector2 stickTilt,
544 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
545 || !wandPair.TryGet(controllerIndex, out var wandCore))
547 stickTilt = Vector2.zero;
551 return wandCore.TryGetStickTilt(out stickTilt);
556 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
557 || !wandPair.TryGet(controllerIndex, out var wandCore))
562 return wandCore.GetTrigger();
565 internal static bool TryGetTrigger(out
float triggerDisplacement,
568 if (!
Instance.wandCores.TryGetValue(glassesHandle, out var wandPair)
569 || !wandPair.TryGet(controllerIndex, out var wandCore))
571 triggerDisplacement = 0f;
575 return wandCore.TryGetTrigger(out triggerDisplacement);
578 internal static bool TryGetWandControlsState(GlassesHandle glassesHandle, out T5_ControllerState? controllerState,
581 int result = NativePlugin.T5_RESULT_UNKNOWN_ERROR;
585 T5_ControllerState state =
new T5_ControllerState();
586 result = NativePlugin.GetControllerState(glassesHandle, controllerIndex, ref state);
587 controllerState = (result == NativePlugin.T5_RESULT_SUCCESS)
589 : (T5_ControllerState?)
null;
593 controllerState =
null;
597 return result == NativePlugin.T5_RESULT_SUCCESS;
600 #endregion Internal Functions
603 #region Private Functions
607 var currentTime = System.DateTime.Now;
619 catch (System.DllNotFoundException e)
622 "Could not connect to Tilt Five plugin to scan for wands: {0}",
643 T5_Bool wandAvailable =
false;
644 int result =
NativePlugin.GetWandAvailability(glassesHandle, ref wandAvailable, controllerIndex);
648 connected = wandAvailable;
652 catch (DllNotFoundException e)
654 Log.
Info(
"Could not connect to Tilt Five plugin for wand: {0}", e.Message);
660 "Failed to connect to Tilt Five plugin for wand availability: {0}",
673 var glassesAlreadyMonitored =
wandCores.TryGetValue(glassesHandle, out var wandPair);
679 if (!glassesAlreadyMonitored || !wandPair.TryGet(controllerIndex, out wandCore))
681 #if UNITY_2019_1_OR_NEWER && INPUTSYSTEM_AVAILABLE
682 wandCore =
new WandDeviceCore(glassesHandle, controllerIndex);
684 wandCore =
new WandCore(glassesHandle, controllerIndex);
690 else if(glassesAlreadyMonitored && wandPair.TryGet(controllerIndex, out var lostWandCore))
698 #endregion Private Functions
701 #region Private Classes
708 #region Public Fields
723 #endregion Public Fields
726 #region Public Functions
734 Log.
Info($
"Glasses {glassesHandle} (\"{friendlyName}\") {Enum.GetName(typeof(ControllerIndex), controllerIndex)} Wand connected");
743 T5_ControllerState state =
new T5_ControllerState();
749 : (T5_ControllerState?)
null;
781 var previouslyPressed =
previousState?.GetButton(button) ??
false;
789 return pressed && !previouslyPressed;
807 var previouslyPressed =
previousState?.GetButton(button) ??
false;
811 ? !pressed && previouslyPressed
847 #endregion Public Functions
854 base.Reset(wandSettings);
859 if (wandSettings ==
null)
861 Log.
Error(
"WandSettings configuration required for Wand tracking updates.");
865 base.Update(wandSettings, scaleSettings, gameBoardSettings);
898 T5_Bool wandAvailable =
false;
904 connected = wandAvailable;
908 catch (DllNotFoundException e)
910 Log.
Info(
"Could not connect to Tilt Five plugin for wand: {0}", e.Message);
916 "Failed to connect to Tilt Five plugin for wand availability: {0}",
932 controllerState =
new T5_ControllerState();
937 controllerState = controllerStateResult.Value;
966 rotation_UGBD, wandSettings, scaleSettings, gameboardSettings,
1002 Log.
Info($
"Glasses {glassesHandle} {controllerIndex} Wand disconnected");
1005 #endregion Overrides
1008 #region Private Helper Functions
1012 Quaternion rotToDW_GBD = Quaternion.AngleAxis(90f, Vector3.right);
1013 Quaternion rotToGBD_DW = Quaternion.Inverse(rotToDW_GBD);
1014 Quaternion rotToWND_DW = rotToWND_GBD * rotToGBD_DW;
1015 Quaternion rotToUGBD_UWND =
new Quaternion(rotToWND_DW.x, -rotToWND_DW.y, rotToWND_DW.z, rotToWND_DW.w);
1016 return rotToUGBD_UWND;
1019 protected void ProcessTrackingData(Vector3 gripPosition_UGBD, Vector3 fingertipsPosition_UGBD, Vector3 aimPosition_UGBD, Quaternion rotToUGBD_WND,
1021 out Pose gripPose_UGBD, out Pose fingertipsPose_UGBD, out Pose aimPose_UGBD)
1023 var incomingGripPose_UGBD =
new Pose(gripPosition_UGBD, rotToUGBD_WND);
1024 var incomingFingertipsPose_UGBD =
new Pose(fingertipsPosition_UGBD, rotToUGBD_WND);
1025 var incomingAimPose_UGBD =
new Pose(aimPosition_UGBD, rotToUGBD_WND);
1038 var gripPointOffsetDistance = 0f;
1039 var fingertipsPointOffsetDistance = Mathf.Max((fingertipsPosition_UGBD - gripPosition_UGBD).magnitude,
1040 (staleFingertipsPose_UGBD.position - staleGripPose_UGBD.position).magnitude);
1041 var aimPointOffsetDistance = Mathf.Max((aimPosition_UGBD - gripPosition_UGBD).magnitude,
1042 (staleAimPose_UGBD.position - staleGripPose_UGBD.position).magnitude);
1045 gripPose_UGBD =
FilterTrackingPointPose(staleGripPose_UGBD, staleGripPose_UGBD, incomingGripPose_UGBD, gripPointOffsetDistance, wandSettings);
1046 fingertipsPose_UGBD =
FilterTrackingPointPose(staleGripPose_UGBD, staleFingertipsPose_UGBD, incomingFingertipsPose_UGBD, fingertipsPointOffsetDistance, wandSettings);
1047 aimPose_UGBD =
FilterTrackingPointPose(staleGripPose_UGBD, staleAimPose_UGBD, incomingAimPose_UGBD, aimPointOffsetDistance, wandSettings);
1052 Pose newTrackingPointPose,
float trackingPointOffsetDistance,
WandSettings settings)
1064 var extrapolatedPosition = staleGripPointPose.position +
1065 Quaternion.Inverse(newTrackingPointPose.rotation) * Vector3.forward * trackingPointOffsetDistance;
1066 return new Pose(extrapolatedPosition, newTrackingPointPose.rotation);
1068 return staleTrackingPointPose;
1075 return newTrackingPointPose;
1079 #endregion Private Helper Functions
1082 #if UNITY_2019_1_OR_NEWER && INPUTSYSTEM_AVAILABLE
1083 private class WandDeviceCore : WandCore
1085 internal WandDevice wandDevice;
1087 private enum TrackingState :
int
1094 public WandDeviceCore(GlassesHandle glassesHandle,
ControllerIndex controllerIndex) : base(glassesHandle, controllerIndex)
1096 if(Glasses.TryGetGlassesDevice(glassesHandle, out var glassesDevice))
1099 Input.AddWandDevice(glassesDevice.PlayerIndex, controllerIndex);
1100 wandDevice = Input.GetWandDevice(glassesDevice.PlayerIndex, controllerIndex);
1101 InputSystem.QueueConfigChangeEvent(wandDevice);
1104 glassesDevice.RightWand = wandDevice;
1108 glassesDevice.LeftWand = wandDevice;
1110 if(TiltFiveManager2.IsInstantiated){
1111 TiltFiveManager2.Instance.RefreshInputDevicePairings();
1116 public override void Dispose()
1120 if (Player.TryGetPlayerIndex(glassesHandle, out var playerIndex))
1122 Input.RemoveWandDevice(playerIndex, controllerIndex);
1126 public override void GetLatestInputs()
1128 base.GetLatestInputs();
1132 if (!wandDevice.added || !wandDevice.enabled)
1137 InputSystem.QueueDeltaStateEvent(wandDevice.TiltFive, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.T5));
1138 InputSystem.QueueDeltaStateEvent(wandDevice.One, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.One));
1139 InputSystem.QueueDeltaStateEvent(wandDevice.Two, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.Two));
1140 InputSystem.QueueDeltaStateEvent(wandDevice.Three, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.Three));
1141 InputSystem.QueueDeltaStateEvent(wandDevice.A, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.A));
1142 InputSystem.QueueDeltaStateEvent(wandDevice.B, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.B));
1143 InputSystem.QueueDeltaStateEvent(wandDevice.X, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.X));
1144 InputSystem.QueueDeltaStateEvent(wandDevice.Y, currentState.HasValue && currentState.Value.TryGetButton(
WandButton.Y));
1146 InputSystem.QueueDeltaStateEvent(wandDevice.Stick, currentState.HasValue ? currentState.Value.TryGetStick() : Vector2.zero);
1147 InputSystem.QueueDeltaStateEvent(wandDevice.Trigger, currentState.HasValue ? currentState.Value.TryGetTrigger() : 0f);
1150 protected override void SetDrivenObjectTransform(WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings)
1152 base.SetDrivenObjectTransform(wandSettings, scaleSettings, gameBoardSettings);
1156 if (!wandDevice.added || !wandDevice.enabled)
1162 QueueDeltaStateEvent(wandDevice.devicePosition, pose_UWRLD.position);
1163 QueueDeltaStateEvent(wandDevice.FingertipsPosition, fingertipsPose_UnityWorldSpace.position);
1164 QueueDeltaStateEvent(wandDevice.AimPosition, aimPose_UnityWorldSpace.position);
1166 QueueDeltaStateEvent(wandDevice.RawGripPosition, pose_UGBD.position);
1167 QueueDeltaStateEvent(wandDevice.RawFingertipsPosition, fingertipsPose_GameboardSpace.position);
1168 QueueDeltaStateEvent(wandDevice.RawAimPosition, aimPose_GameboardSpace.position);
1170 QueueDeltaStateEvent(wandDevice.deviceRotation, pose_UWRLD.rotation);
1171 QueueDeltaStateEvent(wandDevice.RawRotation, pose_UGBD.rotation);
1173 InputSystem.QueueDeltaStateEvent(wandDevice.isTracked, isTracked);
1175 var trackingState = TrackingState.Tracking;
1178 trackingState = wandSettings.FailureMode == TrackableSettings.TrackingFailureMode.FreezePosition
1179 ? TrackingState.Limited
1180 : TrackingState.None;
1183 InputSystem.QueueDeltaStateEvent(wandDevice.trackingState, (
int)trackingState);
1186 private static void QueueDeltaStateEvent(Vector3Control vector3Control, Vector3 delta)
1188 InputSystem.QueueDeltaStateEvent(vector3Control.x, delta.x);
1189 InputSystem.QueueDeltaStateEvent(vector3Control.y, delta.y);
1190 InputSystem.QueueDeltaStateEvent(vector3Control.z, delta.z);
1195 private static void QueueDeltaStateEvent(QuaternionControl quaternionControl, Quaternion delta)
1197 InputSystem.QueueDeltaStateEvent(quaternionControl.w, delta.w);
1198 InputSystem.QueueDeltaStateEvent(quaternionControl.x, delta.x);
1199 InputSystem.QueueDeltaStateEvent(quaternionControl.y, delta.y);
1200 InputSystem.QueueDeltaStateEvent(quaternionControl.z, delta.z);
1205 #endregion Private Classes
1208 #region Public Classes
TiltFive.Input.WandButton WandButton
The Glasses API and runtime.
static bool IsTracked(PlayerIndex playerIndex=PlayerIndex.One)
Indicate if the specified glasses are tracked.
static bool TryGetFriendlyName(PlayerIndex playerIndex, out string friendlyName)
Gets the friendly name associated with the specified player's glasses in the Tilt Five Control Panel.
static void Info(string m, params object[] list)
INFO logging function call.
static void Error(string m, params object[] list)
ERROR logging function call.
Provides access to player settings and functionality.
static bool IsConnected(PlayerIndex playerIndex)
Determines whether the specified player has an associated pair of glasses connected.
ScaleSettings contains the scale data used to translate between Unity units and the user's physical s...
static Pose GameboardToWorldSpace(Pose pose_GameboardSpace, ScaleSettings scaleSettings, GameBoardSettings gameboardSettings)
static Vector3 ConvertPosGBDToUGBD(Vector3 pos_GBD)
bool RejectUntrackedPositionData
TrackingFailureMode FailureMode
Suspends coroutine execution until the provided player's wand has connected.
WaitUntilWandConnected(PlayerIndex playerIndex, ControllerIndex controllerIndex)
ControllerIndex controllerIndex
override bool keepWaiting
Internal Wand core runtime.
Pose FilterTrackingPointPose(Pose staleGripPointPose, Pose staleTrackingPointPose, Pose newTrackingPointPose, float trackingPointOffsetDistance, WandSettings settings)
bool TryGetButtonDown(WandButton button, out bool buttonDown)
Pose aimPose_UnityWorldSpace
bool TryGetStickTilt(out Vector2 stickTilt)
T5_ControllerState? currentState
T5_ControllerState? previousState
bool TryGetButtonUp(WandButton button, out bool buttonUp)
override void SetPoseUnityWorldSpace(ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings)
Sets the pose values of the tracked object in Unity World Space
new void Reset(WandSettings wandSettings)
bool TryGetButton(WandButton button, out bool pressed)
bool GetButton(WandButton button)
override bool TryCheckConnected(out bool connected)
Determines whether the tracked object is still connected.
override bool TryGetStateFromPlugin(out T5_ControllerState controllerState, out bool poseIsValid, GameBoardSettings gameBoardSettings)
bool TryGetTrigger(out float triggerDisplacement)
override void SetPoseGameboardSpace(in T5_ControllerState controllerState, WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameboardSettings)
void ProcessTrackingData(Vector3 gripPosition_UGBD, Vector3 fingertipsPosition_UGBD, Vector3 aimPosition_UGBD, Quaternion rotToUGBD_WND, WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings, out Pose gripPose_UGBD, out Pose fingertipsPose_UGBD, out Pose aimPose_UGBD)
Pose fingertipsPose_UnityWorldSpace
readonly GlassesHandle glassesHandle
Pose aimPose_GameboardSpace
WandCore(GlassesHandle glassesHandle, ControllerIndex controllerIndex)
Pose fingertipsPose_GameboardSpace
override void SetInvalidPoseGameboardSpace(in T5_ControllerState t5_ControllerState, WandSettings settings, ScaleSettings scaleSettings, GameBoardSettings gameboardSettings)
Handle setting the wand pose when we know the controller state isn't valid.
bool GetButtonDown(WandButton button)
bool GetButtonUp(WandButton button)
virtual new void Update(WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings)
override void SetDefaultPoseGameboardSpace(WandSettings settings)
Pose gripPose_UnityWorldSpace
override void SetDrivenObjectTransform(WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings)
readonly ControllerIndex controllerIndex
Quaternion CalculateRotation(Quaternion rotToWND_GBD)
static Pose GetDefaultPoseGameboardSpace(WandSettings settings)
virtual void GetLatestInputs()
The Wand API and runtime.
static bool IsTracked(ControllerIndex controllerIndex=ControllerIndex.Right, PlayerIndex playerIndex=PlayerIndex.One)
static bool TryCheckConnected(out bool connected, PlayerIndex playerIndex, ControllerIndex controllerIndex=ControllerIndex.Right)
Gets the connection status of the indicated wand.
static readonly Vector3 DEFAULT_WAND_HANDEDNESS_OFFSET_GAME_BOARD_SPACE
A left/right offset to the default wand position, depending on handedness.
HashSet< GlassesHandle > incomingHandles
static readonly Quaternion DEFAULT_WAND_ROTATION_GAME_BOARD_SPACE
The default rotation of the wand relative to the board.
static readonly double wandScanInterval
static void ScanForWands()
static readonly Vector3 DEFAULT_WAND_POSITION_GAME_BOARD_SPACE
The default position of the wand relative to the board.
static bool TryScanForWands()
static void Update(WandSettings wandSettings, ScaleSettings scaleSettings, GameBoardSettings gameBoardSettings, PlayerIndex playerIndex=PlayerIndex.One)
static bool wandAvailabilityErroredOnce
static bool TryGetWandAvailability(out bool connected, GlassesHandle glassesHandle, ControllerIndex controllerIndex)
WandCore ObtainWandCore(GlassesHandle glassesHandle, ControllerIndex controllerIndex)
static DateTime lastScanAttempt
Dictionary< GlassesHandle, WandPair > wandCores
The collection of WandCores. GlassesHandles are mapped to pairs of right/left WandCores.
static Quaternion GetRotation(ControllerIndex controllerIndex=ControllerIndex.Right, PlayerIndex playerIndex=PlayerIndex.One)
Gets the rotation of the wand in world space.
static bool TrySendImpulse(float amplitude, float duration, PlayerIndex playerIndex=PlayerIndex.One, ControllerIndex controllerIndex=ControllerIndex.Right)
Try to send a haptics impulse to the specified wand
HashSet< GlassesHandle > lostHandles
static Vector3 GetPosition(ControllerIndex controllerIndex=ControllerIndex.Right, ControllerPosition controllerPosition=ControllerPosition.Grip, PlayerIndex playerIndex=PlayerIndex.One)
Gets the position of the wand in world space.
HashSet< WandCore > lostWands
Wand Settings encapsulates all configuration data used by the Wand's tracking runtime to compute the ...
ControllerIndex controllerIndex
GameObject FingertipPoint
ControllerPosition
Points of interest along the wand controller, such as the handle position or wand tip.
ControllerIndex
Since wands are all physically identical (they have no "handedness"), it doesn't make sense to addres...
PlayerIndex
The Player index (e.g. Player One, Player Two, etc)
bool TryGet(ControllerIndex controllerIndex, out WandCore wandCore)
WandPair(WandCore right, WandCore left)