From 3c4362376944c0e9ae192b7f3a2d5464a2b80ba5 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 4 May 2024 09:34:22 +0900 Subject: [PATCH] SOH in DrawPolyBoundaries --- src/DotRecast.Recast.Demo/Draw/RecastDebugDraw.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DotRecast.Recast.Demo/Draw/RecastDebugDraw.cs b/src/DotRecast.Recast.Demo/Draw/RecastDebugDraw.cs index 62ff866..5ce784d 100644 --- a/src/DotRecast.Recast.Demo/Draw/RecastDebugDraw.cs +++ b/src/DotRecast.Recast.Demo/Draw/RecastDebugDraw.cs @@ -299,6 +299,7 @@ public class RecastDebugDraw : DebugDraw Begin(DebugDrawPrimitives.LINES, linew); + Span tv = stackalloc RcVec3f[3]; for (int i = 0; i < tile.data.header.polyCount; ++i) { DtPoly p = tile.data.polys[i]; @@ -370,14 +371,14 @@ public class RecastDebugDraw : DebugDraw for (int k = 0; k < pd.triCount; ++k) { int t = (pd.triBase + k) * 4; - RcVec3f[] tv = new RcVec3f[3]; for (int m = 0; m < 3; ++m) { int v = tile.data.detailTris[t + m]; if (v < p.vertCount) { tv[m] = new RcVec3f( - tile.data.verts[p.verts[v] * 3], tile.data.verts[p.verts[v] * 3 + 1], + tile.data.verts[p.verts[v] * 3], + tile.data.verts[p.verts[v] * 3 + 1], tile.data.verts[p.verts[v] * 3 + 2] ); }