コード例 #1
0
        public static PlaneDetectionMode ToPlaneDetectionMode(this MLPlanesQueryFlags mlPlanesQueryFlags)
        {
            var outDetectionMode = PlaneDetectionMode.None;

            if ((mlPlanesQueryFlags & MLPlanesQueryFlags.Horizontal) != 0)
            {
                outDetectionMode |= PlaneDetectionMode.Horizontal;
            }
            if ((mlPlanesQueryFlags & MLPlanesQueryFlags.Vertical) != 0)
            {
                outDetectionMode |= PlaneDetectionMode.Vertical;
            }
            return(outDetectionMode);
        }
コード例 #2
0
 PlaneAlignment ToUnityAlignment(MLPlanesQueryFlags flags, Quaternion rotation)
 {
     if ((flags & MLPlanesQueryFlags.Vertical) != 0)
     {
         return(PlaneAlignment.Vertical);
     }
     else if ((flags & MLPlanesQueryFlags.Horizontal) != 0)
     {
         var normal = rotation * Vector3.up;
         return((normal.y > 0f) ? PlaneAlignment.HorizontalUp : PlaneAlignment.HorizontalDown);
     }
     else
     {
         return(PlaneAlignment.NotAxisAligned);
     }
 }
コード例 #3
0
 PlaneClassification ToUnityClassification(MLPlanesQueryFlags flags)
 {
     if ((flags & MLPlanesQueryFlags.Semantic_Ceiling) != 0)
     {
         return(PlaneClassification.Ceiling);
     }
     else if ((flags & MLPlanesQueryFlags.Semantic_Floor) != 0)
     {
         return(PlaneClassification.Floor);
     }
     else if ((flags & MLPlanesQueryFlags.Semantic_Wall) != 0)
     {
         return(PlaneClassification.Wall);
     }
     else
     {
         return(PlaneClassification.None);
     }
 }