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

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

private searchForOutstandingVertex ( Vertices hullArea, Vector2 &outstanding ) : bool
hullArea Vertices
outstanding Vector2
Результат bool
		bool searchForOutstandingVertex( Vertices hullArea, out Vector2 outstanding )
		{
			Vector2 outstandingResult = Vector2.Zero;
			bool found = false;

			if( hullArea.Count > 2 )
			{
				int hullAreaLastPoint = hullArea.Count - 1;

				Vector2 tempVector1;
				Vector2 tempVector2 = hullArea[0];
				Vector2 tempVector3 = hullArea[hullAreaLastPoint];

				// Search between the first and last hull point.
				for( int i = 1; i < hullAreaLastPoint; i++ )
				{
					tempVector1 = hullArea[i];

					// Check if the distance is over the one that's tolerable.
					if( LineTools.distanceBetweenPointAndLineSegment( ref tempVector1, ref tempVector2, ref tempVector3 ) >= _hullTolerance )
					{
						outstandingResult = hullArea[i];
						found = true;
						break;
					}
				}
			}

			outstanding = outstandingResult;
			return found;
		}