Skip to content

Commit

Permalink
SOH allocation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed May 3, 2024
1 parent bef346a commit a5a101c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DotRecast.Detour/DtNavMeshQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public class DtNavMeshQuery
public DtNavMeshQuery(DtNavMesh nav)
{
m_nav = nav;
m_tinyNodePool = new DtNodePool();
m_nodePool = new DtNodePool();
m_openList = new DtNodeQueue();
m_tinyNodePool = new DtNodePool();
}

/// Returns random location on navmesh.
Expand Down Expand Up @@ -386,7 +386,7 @@ public DtStatus FindRandomPointAroundCircle(long startRef, RcVec3f centerPos, fl
float s = frand.Next();
float t = frand.Next();

float[] areas = new float[randomPolyVerts.Length / 3];
Span<float> areas = stackalloc float[randomPolyVerts.Length / 3];
RcVec3f pt = DtUtils.RandomPointInConvexPoly(randomPolyVerts, randomPolyVerts.Length / 3, areas, s, t);
ClosestPointOnPoly(randomPolyRef, pt, out var closest, out var _);

Expand Down

0 comments on commit a5a101c

Please sign in to comment.