Skip to content

Commit fb9ec79

Browse files
committed
Guard the new articulated hand updates behind the UWP APIs being present
The new HandPose APIs will only work on V8 and beyond of the Windows SDK. We shouldn't try to invoke APIs/functionality unless the underlying platform actually supports that functionality.
1 parent f3e9870 commit fb9ec79

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityArticulatedHand.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Windows.Perception;
1616
using Windows.Perception.People;
1717
using Windows.UI.Input.Spatial;
18+
using Microsoft.MixedReality.Toolkit.Windows.Utilities;
1819
#endif
1920

2021
namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality.Input
@@ -220,6 +221,14 @@ protected override void UpdateControllerData(InteractionSourceState interactionS
220221
base.UpdateControllerData(interactionSourceState);
221222

222223
#if WINDOWS_UWP
224+
// The articulated hand support is only present in the 18361 version and beyond Windows
225+
// SDK (which contains the V8 drop of the Universal API Contract). In particular,
226+
// the HandPose related APIs are only present on this version and above.
227+
if (!WindowsApiChecker.UniversalApiContractV8_IsAvailable)
228+
{
229+
return;
230+
}
231+
223232
PerceptionTimestamp perceptionTimestamp = PerceptionTimestampHelper.FromHistoricalTargetTime(DateTimeOffset.Now);
224233
IReadOnlyList<SpatialInteractionSourceState> sources = spatialInteractionManager?.GetDetectedSourcesAtTimestamp(perceptionTimestamp);
225234
foreach (SpatialInteractionSourceState sourceState in sources)

0 commit comments

Comments
 (0)