Beispiel #1
0
 /// <summary>
 /// Calculates the distance between a point and a solid axis-aligned box.
 /// </summary>
 /// <param name="point">A <see cref="Vector2F"/> instance.</param>
 /// <param name="aabb">An <see cref="AxisAlignedBox"/> instance.</param>
 /// <returns>The distance between a point and a solid axis-aligned box.</returns>
 /// <remarks>
 /// Treating the box as solid means that any point inside the box has
 /// distance zero from the box.
 /// </remarks>
 public static float Distance(Vector2F point, AxisAlignedBox aabb)
 {
     return((float)System.Math.Sqrt(SquaredDistance(point, aabb)));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AxisAlignedBox"/> class using given values from another box instance.
 /// </summary>
 /// <param name="box">A <see cref="AxisAlignedBox"/> instance to take values from.</param>
 public AxisAlignedBox(AxisAlignedBox box)
 {
     _min = box.Min;
     _max = box.Max;
 }