Engines/FlatRedBallXNA/FlatRedBall/Math/Geometry/Polygon.cs
/// <summary>
/// Returns whether the argument vector is in this polygon.
/// </summary>
/// <param name="vector">The position of the point</param>
/// <returns>Whether the point is inside.</returns>
Returns whether the argument vector is in this polygon.
Returns whether the argument vector is in this polygon .
public bool IsPointInside(ref Vector3 vector)
        {
            bool b = false;
            for (int i = 0, j = mVertices.Length - 1; i < mVertices.Length; j = i++)
            {
                if ((((mVertices[i].Position.Y <= vector.Y) && (vector.Y < mVertices[j].Position.Y)) || ((mVertices[j].Position.Y <= vector.Y) && (vector.Y < mVertices[i].Position.Y))) &&
                    (vector.X < (mVertices[j].Position.X - mVertices[i].Position.X) * (vector.Y - mVertices[i].Position.Y) / (mVertices[j].Position.Y - mVertices[i].Position.Y) + mVertices[i].Position.X)) b = !b;
            }
            return b;
        }
public bool IsPointInside ( ref Vector3 vector ) { bool b = false ; for ( int i = 0 , j = mVertices . Length - 1 ; i < mVertices . Length ; j = i ++ ) { if ( ( ( ( mVertices [ i ] . Position . Y <= vector . Y ) && ( vector . Y < mVertices [ j ] . Position . Y ) ) || ( ( mVertices [ j ] . Position . Y <= vector . Y ) && ( vector . Y < mVertices [ i ] . Position . Y ) ) ) && ( vector . X < ( mVertices [ j ] . Position . X - mVertices [ i ] . Position . X ) * ( vector . Y - mVertices [ i ] . Position . Y ) / ( mVertices [ j ] . Position . Y - mVertices [ i ] . Position . Y ) + mVertices [ i ] . Position . X ) ) b = ! b ; } return b ; }
Returns whether the argument vector is in this polygon.
Returns whether the argument vector is in this polygon .
Whether the point is inside.
Whether the point is inside .
Vector3
ref
vector
The position of the point
The position of the point