Skip to content

Commit

Permalink
SOH in DrawPolyBoundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed May 4, 2024
1 parent 08c8db2 commit 3c43623
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DotRecast.Recast.Demo/Draw/RecastDebugDraw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ void DrawPolyBoundaries(DtMeshTile tile, int col, float linew, bool inner)

Begin(DebugDrawPrimitives.LINES, linew);

Span<RcVec3f> tv = stackalloc RcVec3f[3];
for (int i = 0; i < tile.data.header.polyCount; ++i)
{
DtPoly p = tile.data.polys[i];
Expand Down Expand Up @@ -370,14 +371,14 @@ void DrawPolyBoundaries(DtMeshTile tile, int col, float linew, bool inner)
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]
);
}
Expand Down

0 comments on commit 3c43623

Please sign in to comment.