Ejemplo n.º 1
0
 /// <summary>Get the nearest point between this <see cref="Box2i"/> and a <see cref="Vector2i"/>. If the <see cref="Vector2i"/> is inside this <see cref="Box2i"/>, it is returned untouched.</summary>
 public void NearestPointTo( ref  Vector2i point , out Vector2i result)
 {
     Containment containment = Intersect(ref point);
         if(containment != Containment.Disjoint)
             result = point;
         else
             point.Clamp(ref Min, ref Max, out result);
         return;
 }
Ejemplo n.º 2
0
 /// <summary>Get the nearest point between this <see cref="Box2i"/> and a <see cref="Vector2i"/>. If the <see cref="Vector2i"/> is inside this <see cref="Box2i"/>, it is returned untouched.</summary>
 public Vector2i NearestPointTo( Vector2i point )
 {
     Vector2i result;
         Containment containment = Intersect(ref point);
         if(containment != Containment.Disjoint)
             result = point;
         else
             point.Clamp(ref Min, ref Max, out result);
         return result;
 }