예제 #1
0
 public static bool TryGetGeometry(List <Vector3> geometry, [DefaultValue("Type.PlayArea")] Boundary.Type boundaryType)
 {
     if (geometry == null)
     {
         throw new ArgumentNullException("geometry");
     }
     geometry.Clear();
     return(Boundary.TryGetGeometryInternal(geometry, (int)boundaryType));
 }
예제 #2
0
        /// <inheritdoc/>
        public bool Contains(Vector3 location, Boundary.Type boundaryType = Boundary.Type.TrackedArea)
        {
            if (!EdgeUtilities.IsValidPoint(location))
            {
                // Invalid location.
                return(false);
            }

            if (!FloorHeight.HasValue)
            {
                // No floor.
                return(false);
            }

            // Handle the user teleporting (boundary moves with them).
            location = MixedRealityToolkit.Instance.MixedRealityPlayspace.InverseTransformPoint(location);

            if (FloorHeight.Value > location.y ||
                BoundaryHeight < location.y)
            {
                // Location below the floor or above the boundary height.
                return(false);
            }

            // Boundary coordinates are always "on the floor"
            Vector2 point = new Vector2(location.x, location.z);

            if (boundaryType == Boundary.Type.PlayArea)
            {
                // Check the inscribed rectangle.
                if (rectangularBounds != null)
                {
                    return(rectangularBounds.IsInsideBoundary(point));
                }
            }
            else if (boundaryType == Boundary.Type.TrackedArea)
            {
                // Check the geometry
                return(EdgeUtilities.IsInsideBoundary(Bounds, point));
            }

            // Not in either boundary type.
            return(false);
        }
예제 #3
0
 public static bool TryGetDimensions(out Vector3 dimensionsOut, [DefaultValue("Type.PlayArea")] Boundary.Type boundaryType)
 {
     return(Boundary.TryGetDimensionsInternal(out dimensionsOut, (int)boundaryType));
 }
예제 #4
0
 public static bool TryGetGeometry(List <Vector3> geometry)
 {
     Boundary.Type boundaryType = Boundary.Type.PlayArea;
     return(Boundary.TryGetGeometry(geometry, boundaryType));
 }
예제 #5
0
 public static bool TryGetDimensions(out Vector3 dimensionsOut)
 {
     Boundary.Type boundaryType = Boundary.Type.PlayArea;
     return(Boundary.TryGetDimensions(out dimensionsOut, boundaryType));
 }