Glare.Box2d.NearestPointTo C# (CSharp) Method

NearestPointTo() public method

Get the nearest point between this Box2d and a Vector2d. If the Vector2d is inside this Box2d, it is returned untouched.
public NearestPointTo ( Vector2d point ) : Vector2d
point Vector2d
return Vector2d
        public Vector2d NearestPointTo( Vector2d point )
        {
            Vector2d 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

Box2d::NearestPointTo ( Vector2d &point, Vector2d &result ) : void