FarseerPhysics.Common.TextureTools.TextureConverter.inPolygon C# (CSharp) Метод

inPolygon() приватный Метод

private inPolygon ( Vertices polygon, Vector2 point ) : bool
polygon Vertices
point Vector2
Результат bool
		bool inPolygon( Vertices polygon, Vector2 point )
		{
			bool inPolygon = !distanceToHullAcceptableHoles( polygon, point, true );

			if( !inPolygon )
			{
				List<float> xCoords = searchCrossingEdgesHoles( polygon, (int)point.Y );

				if( xCoords.Count > 0 && xCoords.Count % 2 == 0 )
				{
					for( int i = 0; i < xCoords.Count; i += 2 )
					{
						if( xCoords[i] <= point.X && xCoords[i + 1] >= point.X )
							return true;
					}
				}

				return false;
			}

			return true;
		}