ikpil 2024-01-25 00:43:40 +09:00 committed by ikpil
parent 2f2d68c29f
commit b0644a70b7
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}