Пример #1
0
 /// <summary>
 /// Calculates the distance between a point and a solid axis-aligned box.
 /// </summary>
 /// <param name="point">A <see cref="Vector2"/> 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 double Distance(Vector2 point, AxisAlignedBox aabb)
 {
     return((double)System.Math.Sqrt(SquaredDistance(point, aabb)));
 }
Пример #2
0
 /// <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;
 }