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

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

Searches for the next shape.
private searchNextHullEntrance ( List detectedPolygons, Vector2 start, Vector2 &entrance ) : bool
detectedPolygons List Already detected polygons.
start Vector2 Search start coordinate.
entrance Vector2 Returns the found entrance coordinate. Null if no other shapes found.
Результат bool
		bool searchNextHullEntrance( List<Vertices> detectedPolygons, Vector2 start, out Vector2? entrance )
		{
			int x;

			bool foundTransparent = false;
			bool isInPolygon = false;

			for( int i = (int)start.X + (int)start.Y * _width; i <= _dataLength; i++ )
			{
				if( isSolid( ref i ) )
				{
					if( foundTransparent )
					{
						x = i % _width;
						entrance = new Vector2( x, ( i - x ) / (float)_width );

						isInPolygon = false;
						for( int polygonIdx = 0; polygonIdx < detectedPolygons.Count; polygonIdx++ )
						{
							if( inPolygon( detectedPolygons[polygonIdx], entrance.Value ) )
							{
								isInPolygon = true;
								break;
							}
						}

						if( isInPolygon )
							foundTransparent = false;
						else
							return true;
					}
				}
				else
					foundTransparent = true;
			}

			entrance = null;
			return false;
		}