private IEnumerator LocalizeToSharedPCF() { _cfuid = SerializationUtilities.StringToCFUID(Transmission.GetGlobalString(_sharedPCFKey)); //find shared pcf: while (_sharedPCF == null) { //locate: MLPersistentCoordinateFrames.FindPCFByCFUID(_cfuid, out _sharedPCF); //keep looking: yield return(new WaitForSeconds(_pcfSearchTimeout)); } //we have our shared pcf! Reorient(); Localized = true; OnLocalized?.Invoke(); }
public static MLCoordinateFrameUID StringToCFUID(string cfuid) { Guid guid = Guid.Parse(cfuid); string guidString = guid.ToString("N"); ulong flippedFirst = ulong.Parse(guidString.Substring(0, 16), System.Globalization.NumberStyles.HexNumber); ulong flippedSecond = ulong.Parse(guidString.Substring(16, 16), System.Globalization.NumberStyles.HexNumber); byte[] bytes = BitConverter.GetBytes(flippedFirst); FlipGuidComponents(bytes); ulong first = BitConverter.ToUInt64(bytes, 0); bytes = BitConverter.GetBytes(flippedSecond); FlipGuidComponents(bytes); ulong second = BitConverter.ToUInt64(bytes, 0); MLCoordinateFrameUID outCfuid = new MLCoordinateFrameUID(); outCfuid.First = first; outCfuid.Second = second; return(outCfuid); }
public static extern bool UnityMagicLeap_TryGetPose(MLCoordinateFrameUID id, out UnityEngine.Pose pose);
public static extern MLResult.Code MLSnapshotGetTransform(IntPtr snap, ref MLCoordinateFrameUID id, ref MLTransform outTransform);