示例#1
0
        public static ApiPose GetAnchorPose(
            IntPtr sessionHandle,
            IntPtr anchorHandle)
        {
            IntPtr poseHandle = PoseApi.Create(sessionHandle);

            ExternApi.ArAnchor_getPose(sessionHandle, anchorHandle, poseHandle);
            ApiPose apiPose = PoseApi.ExtractPoseValue(sessionHandle, poseHandle);

            PoseApi.Destroy(poseHandle);
            return(apiPose);
        }
示例#2
0
        public static FeatureMapQuality EstimateFeatureMapQualityForHosting(
            IntPtr sessionHandle, Pose pose)
        {
            IntPtr poseHandle        = PoseApi.Create(sessionHandle, pose);
            int    featureMapQuality = (int)FeatureMapQuality.Insufficient;
            var    status            = ExternApi.ArSession_estimateFeatureMapQualityForHosting(
                sessionHandle, poseHandle, ref featureMapQuality);

            PoseApi.Destroy(poseHandle);
            if (status != ApiArStatus.Success)
            {
                Debug.LogErrorFormat("Failed to estimate feature map quality with status '{0}'.",
                                     status);
            }

            return((FeatureMapQuality)featureMapQuality);
        }
示例#3
0
        public static FeatureMapQuality EstimateFeatureMapQualityForHosting(
            IntPtr sessionHandle, Pose pose)
        {
            #if UNITY_EDITOR
            if (Application.isEditor)
            {
                return(ARCoreCloudAnchorsEditorDelegate.Instance.EstimateFeatureMapQualityForHosting(sessionHandle, pose));
            }
            #endif

            int featureMapQuality = (int)FeatureMapQuality.Insufficient;
#if !UNITY_IOS || CLOUDANCHOR_IOS_SUPPORT
            IntPtr poseHandle = PoseApi.Create(sessionHandle, pose);
            var    status     = ExternApi.ArSession_estimateFeatureMapQualityForHosting(
                sessionHandle, poseHandle, ref featureMapQuality);
            PoseApi.Destroy(poseHandle);
            if (status != ApiArStatus.Success)
            {
                Debug.LogErrorFormat("Failed to estimate feature map quality with status '{0}'.",
                                     status);
            }
#endif
            return((FeatureMapQuality)featureMapQuality);
        }