Skip to content

Commit f7656b9

Browse files
author
David Kline (ANALOG)
committed
simplify tracking state vs accuracy
1 parent 47ca607 commit f7656b9

File tree

7 files changed

+7
-88
lines changed

7 files changed

+7
-88
lines changed

Assets/MixedRealityToolkit/_Core/Definitions/Devices/Headset.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ public struct Headset
3131
/// </summary>
3232
public Vector3 Position { get; set; }
3333

34-
/// <summary>
35-
/// Indicates the accuracy of the position data being reported.
36-
/// </summary>
37-
public TrackingAccuracy PositionAccuracy { get; set; }
38-
3934
/// <summary>
4035
/// Indicates whether or not the headset is currently providing rotation data.
4136
/// </summary>
@@ -46,11 +41,6 @@ public struct Headset
4641
/// </summary>
4742
public Quaternion Rotation { get; set; }
4843

49-
/// <summary>
50-
/// Indicates the accuracy of the rotation data being reported.
51-
/// </summary>
52-
public TrackingAccuracy RotationAccuracy { get; set; }
53-
5444
/// <summary>
5545
/// Outputs the current state of the headset, whether it is tracked or not. As defined by the SDK / Unity.
5646
/// </summary>

Assets/MixedRealityToolkit/_Core/Definitions/Devices/TrackingAccuracy.cs

Lines changed: 0 additions & 43 deletions
This file was deleted.

Assets/MixedRealityToolkit/_Core/Definitions/Devices/TrackingAccuracy.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Assets/MixedRealityToolkit/_Core/Definitions/Devices/TrackingState.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ public enum TrackingState
1717
/// </summary>
1818
NotApplicable = 0,
1919
/// <summary>
20-
/// Reserved, for systems that provide alternate tracking.
21-
/// </summary>
22-
Other,
23-
/// <summary>
2420
/// The device is not tracked.
2521
/// </summary>
2622
NotTracked,

Assets/MixedRealityToolkit/_Core/Devices/BaseController.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ protected BaseController(TrackingState trackingState, Handedness controllerHande
3131
Interactions = interactions;
3232

3333
IsPositionAvailable = false;
34-
PositionAccuracy = TrackingAccuracy.None;
34+
IsPositionApproximate = false;
3535
IsRotationAvailable = false;
36-
RotationAccuracy = TrackingAccuracy.None;
3736
}
3837

3938
/// <summary>
@@ -67,14 +66,11 @@ protected IMixedRealityInputSystem InputSystem
6766
public bool IsPositionAvailable { get; protected set; }
6867

6968
/// <inheritdoc />
70-
public TrackingAccuracy PositionAccuracy { get; protected set; }
69+
public bool IsPositionApproximate { get; protected set; }
7170

7271
/// <inheritdoc />
7372
public bool IsRotationAvailable { get; protected set; }
7473

75-
/// <inheritdoc />
76-
public TrackingAccuracy RotationAccuracy { get; protected set; }
77-
7874
/// <inheritdoc />
7975
public MixedRealityInteractionMapping[] Interactions { get; private set; }
8076

Assets/MixedRealityToolkit/_Core/Devices/MixedReality/WindowsMixedRealityController.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,16 @@ private void UpdateControllerData(InteractionSourceState interactionSourceState)
114114
IsPositionAvailable = interactionSourceState.sourcePose.TryGetPosition(out currentControllerPosition);
115115
if (IsPositionAvailable)
116116
{
117-
PositionAccuracy = (interactionSourceState.sourcePose.positionAccuracy == InteractionSourcePositionAccuracy.High) ?
118-
TrackingAccuracy.High : TrackingAccuracy.Approximate;
117+
TrackingState = TrackingState.Tracked;
118+
IsPositionApproximate = (interactionSourceState.sourcePose.positionAccuracy == InteractionSourcePositionAccuracy.Approximate);
119119
}
120120
else
121121
{
122-
PositionAccuracy = TrackingAccuracy.None;
122+
TrackingState = TrackingState.NotTracked;
123+
IsPositionApproximate = true;
123124
}
124125

125126
IsRotationAvailable = interactionSourceState.sourcePose.TryGetRotation(out currentControllerRotation);
126-
// Windows Mixed Reality does not have a concept of rotation accuracy, therefore we return high accuracy
127-
RotationAccuracy = IsRotationAvailable ? TrackingAccuracy.High : TrackingAccuracy.None;
128-
129-
// Windows Mixed Reality controllers are tracked if we are receiving position or rotation data
130-
TrackingState = (IsPositionAvailable || IsRotationAvailable) ? TrackingState.Tracked : TrackingState.NotTracked;
131127

132128
if (lastState != TrackingState)
133129
{

Assets/MixedRealityToolkit/_Core/Interfaces/Devices/IMixedRealityController.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public interface IMixedRealityController
3939
/// <summary>
4040
/// Indicates the accuracy of the position data being reported.
4141
/// </summary>
42-
TrackingAccuracy PositionAccuracy { get; }
42+
bool IsPositionApproximate { get; }
4343

4444
/// <summary>
4545
/// Indicates that this controller is currently providing rotation data.
@@ -50,11 +50,6 @@ public interface IMixedRealityController
5050
/// </remarks>
5151
bool IsRotationAvailable { get; }
5252

53-
/// <summary>
54-
/// Indicates the accuracy of the rotation data being reported.
55-
/// </summary>
56-
TrackingAccuracy RotationAccuracy { get; }
57-
5853
/// <summary>
5954
/// Mapping definition for this controller, linking the Physical inputs to logical Input System Actions
6055
/// </summary>

0 commit comments

Comments
 (0)