183 {
184 Tile tile = Main.tile[x, y];
185 if (tile == null || !tile.nactive() || (!Main.tileSolid[tile.type] && !Main.tileSolidTop[tile.type]))
186 {
187 return false;
188 }
189 if (!Main.tileSolid[tile.type] && Main.tileSolidTop[tile.type] && tile.frameY != 0)
190 {
191 return false;
192 }
193 if (Main.tileSolidTop[tile.type])
194 {
195 edgesToTest &= TileEdges.Top | TileEdges.BottomLeftSlope |
TileEdges.BottomRightSlope;
196 }
197 Vector2 tilePosition =
new Vector2((
float)x * 16f, (
float)y * 16f);
198 bool flag = false;
200 if (
GetSlopeEdge(ref edgesToTest, tile, tilePosition, ref edge))
201 {
204 flag = true;
205 }
207 {
210 if (!flag || num < distanceSquaredOut)
211 {
212 distanceSquaredOut = num;
213 closestPointOut = vector;
214 }
215 flag = true;
216 }
218 {
221 if (!flag || num2 < distanceSquaredOut)
222 {
223 distanceSquaredOut = num2;
224 closestPointOut = vector2;
225 }
226 flag = true;
227 }
228 return flag;
229 }
static bool GetLeftOrRightEdge(TileEdges edgesToTest, int x, int y, Vector2 tilePosition, ref LineSegment edge)
static Vector2 ClosestPointOnLineSegment(Vector2 point, LineSegment lineSegment)
static bool GetSlopeEdge(ref TileEdges edgesToTest, Tile tile, Vector2 tilePosition, ref LineSegment edge)
static bool GetTopOrBottomEdge(TileEdges edgesToTest, int x, int y, Vector2 tilePosition, ref LineSegment edge)
static float DistanceSquared(Vector2 value1, Vector2 value2)