public static UnityARUserAnchorData ToUnityArUserAnchorData(this ARHitTestResult arHitTestResult) { var transform = UnityARMatrixOps.GetMatrix(arHitTestResult.worldTransform); var anchorData = new UnityARUserAnchorData { transform = transform }; return(anchorData); }
public LayerMask collisionLayer = 1 << 10; //ARKitPlane layer void CreateEnvironmentProbe(Matrix4x4 worldTransform) { //note we have not converted to Unity coord system yet, so we can pass it in directly UnityAREnvironmentProbeAnchorData anchorData; anchorData.cubemapPtr = IntPtr.Zero; anchorData.ptrIdentifier = IntPtr.Zero; anchorData.probeExtent = Vector3.one; anchorData.transform = UnityARMatrixOps.GetMatrix(worldTransform); //this should be in ARKit coords anchorData = UnityARSessionNativeInterface.GetARSessionNativeInterface().AddEnvironmentProbeAnchor(anchorData); }
/// <summary> /// Converts a <see cref="UnityARMatrix4x4"/> to a <see cref="Matrix4x4"/>. /// </summary> /// <param name="input">The input matrix.</param> /// <returns><see cref="Matrix4x4"/>.</returns> public static Matrix4x4 ToMatrix4x4(this UnityARMatrix4x4 input) { return(UnityARMatrixOps.GetMatrix(input)); }