forked from mirror/DotRecast
Replaced arrays with spans in query. Replaced array allocation with buffer rent in query.
This commit is contained in:
parent
a6db4344e4
commit
1315de063f
|
@ -11,7 +11,7 @@ namespace DotRecast.Detour
|
||||||
_callback = callback;
|
_callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Process(DtMeshTile tile, DtPoly[] poly, Span<long> refs, int count)
|
public void Process(DtMeshTile tile, Span<DtPoly> poly, Span<long> refs, int count)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace DotRecast.Detour
|
||||||
return m_overflow;
|
return m_overflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Process(DtMeshTile tile, DtPoly[] poly, Span<long> refs, int count)
|
public void Process(DtMeshTile tile, Span<DtPoly> poly, Span<long> refs, int count)
|
||||||
{
|
{
|
||||||
int numLeft = m_maxPolys - m_numCollected;
|
int numLeft = m_maxPolys - m_numCollected;
|
||||||
int toCopy = count;
|
int toCopy = count;
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace DotRecast.Detour
|
||||||
_overPoly = default;
|
_overPoly = default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Process(DtMeshTile tile, DtPoly[] poly, Span<long> refs, int count)
|
public void Process(DtMeshTile tile, Span<DtPoly> poly, Span<long> refs, int count)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,6 @@ namespace DotRecast.Detour
|
||||||
{
|
{
|
||||||
/// Called for each batch of unique polygons touched by the search area in dtNavMeshQuery::queryPolygons.
|
/// Called for each batch of unique polygons touched by the search area in dtNavMeshQuery::queryPolygons.
|
||||||
/// This can be called multiple times for a single query.
|
/// This can be called multiple times for a single query.
|
||||||
void Process(DtMeshTile tile, DtPoly[] poly, Span<long> refs, int count);
|
void Process(DtMeshTile tile, Span<DtPoly> poly, Span<long> refs, int count);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue