草庐IT

c# - 如何在不搜索整个列表的情况下搜索列表中距离小于 F 到 P 的项目?

我必须为XZPos更接近Vector2(或PointF)P的每个项目搜索结构列表。该列表按XZPos的x和y排序。它看起来像这样:Item1(XZPos:0,0)Item2(XZPos:0,1)Item3(XZPos:0,2)...Item12(XZPos:1,0)Item13(XZPos:1,1)Item14(XZPos:1,2)...2.249.984elementslater...NowIhaveapointP(4,4)andIwantalistofstructsintheabovelistofeveryitemclosertoPthan5,66f.Myalgorithmsear