Ejemplo n.º 1
0
        /// <summary>
        /// Cache the coordinate system for the QR code's spatial node, and the root.
        /// </summary>
        /// <returns></returns>
        private bool CheckCoordinateSystem()
        {
#if WLT_LEGACY_WSA
            if (coordinateSystem == null)
            {
                SimpleConsole.AddLine(trace, $"Creating coord for {spatialNodeId}");
                coordinateSystem = global::Windows.Perception.Spatial.Preview.SpatialGraphInteropPreview.CreateCoordinateSystemForNode(SpatialNodeId);
                SimpleConsole.AddLine(trace, $"{spatialNodeId} create coord {(coordinateSystem == null ? "FAILED" : "success")}");
            }

            if (rootCoordinateSystem == null)
            {
                rootCoordinateSystem = System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(
                    UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr()
                    ) as SpatialCoordinateSystem;
                SimpleConsole.AddLine(trace, $"Getting Legacy root coordinate system {(rootCoordinateSystem == null ? "null" : "succeeded")}");
            }

            return(coordinateSystem != null);
#elif WLT_SPATIAL_GRAPH_NODE
            if (spatialGraphNode == null)
            {
                spatialGraphNode = SpatialGraphNode.FromStaticNodeId(SpatialNodeId);
            }
            return(spatialGraphNode != null);
#else // WINDOWS_UWP
            return(false);
#endif // WINDOWS_UWP
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Cache the coordinate system for the QR code's spatial node, and the root.
    /// </summary>
    /// <returns></returns>
    private bool CheckCoordinateSystem()
    {
#if WINDOWS_UWP
        if (spatialGraphNode == null)
        {
            spatialGraphNode = SpatialGraphNode.FromStaticNodeId(SpatialNodeId);
        }
        return(spatialGraphNode != null);
#else // WINDOWS_UWP
        return(false);
#endif // WINDOWS_UWP
    }