예제 #1
0
 /// <summary>Get the nearest point between this <see cref="Box4"/> and a <see cref="Vector4"/>. If the <see cref="Vector4"/> is inside this <see cref="Box4"/>, it is returned untouched.</summary>
 public Vector4 NearestPointTo( Vector4 point )
 {
     Vector4 result;
         Containment containment = Intersect(ref point);
         if(containment != Containment.Disjoint)
             result = point;
         else
             point.Clamp(ref Min, ref Max, out result);
         return result;
 }
예제 #2
0
 /// <summary>Get the nearest point between this <see cref="Box4"/> and a <see cref="Vector4"/>. If the <see cref="Vector4"/> is inside this <see cref="Box4"/>, it is returned untouched.</summary>
 public void NearestPointTo( ref  Vector4 point , out Vector4 result)
 {
     Containment containment = Intersect(ref point);
         if(containment != Containment.Disjoint)
             result = point;
         else
             point.Clamp(ref Min, ref Max, out result);
         return;
 }
예제 #3
0
 public static Vector4 Clamp(Vector4 value, Vector4 min, Vector4 max) => Vector4.Clamp(value, min, max);