Glare.Box2.NearestPointTo C# (CSharp) Method

NearestPointTo() public method

Get the nearest point between this Box2 and a Vector2. If the Vector2 is inside this Box2, it is returned untouched.
public NearestPointTo ( System.Vector2 point ) : System.Vector2
point System.Vector2
return System.Vector2
        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;
        }

Same methods

Box2::NearestPointTo ( System.Vector2 &point, System.Vector2 &result ) : void