Beispiel #1
0
 public static Vector2 NormalizedToPoint(RectInt rectangle, Vector2 normalizedRectCoordinates)
 {
     return(new Vector2(Mathf.Lerp(rectangle.x, rectangle.xMax, normalizedRectCoordinates.x),
                        Mathf.Lerp(rectangle.y, rectangle.yMax, normalizedRectCoordinates.y)));
 }
Beispiel #2
0
 public static Vector2 PointToNormalized(RectInt rectangle, Vector2 point)
 {
     return(new Vector2(Mathf.InverseLerp(rectangle.x, rectangle.xMax, point.x),
                        Mathf.InverseLerp(rectangle.y, rectangle.yMax, point.y)));
 }
Beispiel #3
0
 public bool Overlaps(RectInt other)
 {
     return(other.xMax > xMin && other.xMin < xMax && other.yMax > yMin && other.yMin < yMax);
 }