// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Runtime.InteropServices;
#if UNITY_WSA
using UnityEngine.XR.WSA;
#endif // UNITY_WSA
namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality
{
///
/// An implementation of for Unity's in-box XR pipeline.
///
public class WindowsMixedRealityUtilitiesProvider : IWindowsMixedRealityUtilitiesProvider
{
///
IntPtr IWindowsMixedRealityUtilitiesProvider.ISpatialCoordinateSystemPtr =>
#if UNITY_WSA
WorldManager.GetNativeISpatialCoordinateSystemPtr();
#else
IntPtr.Zero;
#endif
///
IntPtr IWindowsMixedRealityUtilitiesProvider.IHolographicFramePtr
{
get
{
IntPtr nativePtr = UnityEngine.XR.XRDevice.GetNativePtr();
HolographicFrameNativeData hfd = Marshal.PtrToStructure(nativePtr);
return hfd.IHolographicFramePtr;
}
}
}
}