コード例 #1
0
ファイル: Box1.cs プロジェクト: Burton-Radons/Alexandria
 /// <summary>Get the nearest point between this <see cref="Box2"/> and a <see cref="Vector2"/>. If the <see cref="Vector2"/> is inside this <see cref="Box2"/>, it is returned untouched.</summary>
 public void NearestPointTo( ref  Vector2 point , out Vector2 result)
 {
     Containment containment = Intersect(ref point);
         if(containment != Containment.Disjoint)
             result = point;
         else
             point.Clamp(ref Min, ref Max, out result);
         return;
 }
コード例 #2
0
ファイル: Box1.cs プロジェクト: Burton-Radons/Alexandria
 /// <summary>Get the nearest point between this <see cref="Box2"/> and a <see cref="Vector2"/>. If the <see cref="Vector2"/> is inside this <see cref="Box2"/>, it is returned untouched.</summary>
 public Vector2 NearestPointTo( Vector2 point )
 {
     Vector2 result;
         Containment containment = Intersect(ref point);
         if(containment != Containment.Disjoint)
             result = point;
         else
             point.Clamp(ref Min, ref Max, out result);
         return result;
 }
コード例 #3
0
 public static Vector2 Clamp(Vector2 value, Vector2 min, Vector2 max) => Vector2.Clamp(value, min, max);
コード例 #4
0
 public static Vector2 Clamp(Vector2 v1, float min, float max)
 {
     v1.Clamp(min, max);
     return(v1);
 }
コード例 #5
0
 public static Vector2 Clamp(Vector2 v1, float min, float max)
 {
     v1.Clamp(min, max); return v1;
 }