forked from bit/DotRecastNetSim
fix : SOH issue (#41)
- https://github.com/ikpil/DotRecast/issues/41#issuecomment-1908359895
This commit is contained in:
parent
2f2d68c29f
commit
b0644a70b7
|
@ -21,6 +21,7 @@ freely, subject to the following restrictions:
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DotRecast.Core;
|
||||
using DotRecast.Core.Buffers;
|
||||
using DotRecast.Core.Numerics;
|
||||
|
||||
namespace DotRecast.Detour
|
||||
|
@ -1246,14 +1247,14 @@ namespace DotRecast.Detour
|
|||
|
||||
int ip = poly.index;
|
||||
|
||||
float[] verts = new float[m_maxVertPerPoly * 3];
|
||||
using var verts = RcRentedArray.RentDisposableArray<float>(m_maxVertPerPoly * 3);
|
||||
int nv = poly.vertCount;
|
||||
for (int i = 0; i < nv; ++i)
|
||||
{
|
||||
RcArrays.Copy(tile.data.verts, poly.verts[i] * 3, verts, i * 3, 3);
|
||||
RcArrays.Copy(tile.data.verts, poly.verts[i] * 3, verts.AsRentedArray(), i * 3, 3);
|
||||
}
|
||||
|
||||
if (!DtUtils.PointInPolygon(pos, verts, nv))
|
||||
if (!DtUtils.PointInPolygon(pos, verts.AsRentedArray(), nv))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue