refactor: support .netstandard2.1 vector3

This commit is contained in:
ikpil 2023-10-28 13:22:02 +09:00
parent ffdbdb7ed8
commit 0924b82f62
4 changed files with 13 additions and 13 deletions

View File

@ -86,7 +86,7 @@ public class NavMeshRenderer
int tw = (gw + settings.tileSize - 1) / settings.tileSize;
int th = (gh + settings.tileSize - 1) / settings.tileSize;
float s = settings.tileSize * settings.cellSize;
_debugDraw.DebugDrawGridXZ(bmin[0], bmin[1], bmin[2], tw, th, s, DebugDraw.DuRGBA(0, 0, 0, 64), 1.0f);
_debugDraw.DebugDrawGridXZ(bmin.X, bmin.Y, bmin.Z, tw, th, s, DebugDraw.DuRGBA(0, 0, 0, 64), 1.0f);
}
if (navMesh != null && navQuery != null

View File

@ -43,8 +43,8 @@ public static class GizmoRenderer
RcVec3f normal = new RcVec3f();
for (int j = 0; j < 3; ++j)
{
e0[j] = vertices[v1 + j] - vertices[v0 + j];
e1[j] = vertices[v2 + j] - vertices[v0 + j];
e0 = RcVecUtils.Subtract(vertices, v1, v0);
e1 = RcVecUtils.Subtract(vertices, v2, v0);
}
normal.X = e0.Y * e1.Z - e0.Z * e1.Y;

View File

@ -79,8 +79,8 @@ public class ObstacleSampleTool : ISampleTool
else if (ob.state == DtObstacleState.DT_OBSTACLE_REMOVING)
col = DebugDraw.DuRGBA(220, 0, 0, 128);
dd.DebugDrawCylinder(bmin[0], bmin[1], bmin[2], bmax[0], bmax[1], bmax[2], col);
dd.DebugDrawCylinderWire(bmin[0], bmin[1], bmin[2], bmax[0], bmax[1], bmax[2], DebugDraw.DuDarkenCol(col), 2);
dd.DebugDrawCylinder(bmin.X, bmin.Y, bmin.Z, bmax.X, bmax.Y, bmax.Z, col);
dd.DebugDrawCylinderWire(bmin.X, bmin.Y, bmin.Z, bmax.X, bmax.Y, bmax.Z, DebugDraw.DuDarkenCol(col), 2);
}
}

View File

@ -59,19 +59,19 @@ public class TileSampleTool : ISampleTool
var s = settings.agentRadius;
float ts = settings.tileSize * settings.cellSize;
int tx = (int)((_hitPos.X - bmin[0]) / ts);
int ty = (int)((_hitPos.Z - bmin[2]) / ts);
int tx = (int)((_hitPos.X - bmin.X) / ts);
int ty = (int)((_hitPos.Z - bmin.Z) / ts);
RcVec3f lastBuiltTileBmin = RcVec3f.Zero;
RcVec3f lastBuiltTileBmax = RcVec3f.Zero;
lastBuiltTileBmin[0] = bmin[0] + tx * ts;
lastBuiltTileBmin[1] = bmin[1];
lastBuiltTileBmin[2] = bmin[2] + ty * ts;
lastBuiltTileBmin.X = bmin.X + tx * ts;
lastBuiltTileBmin.Y = bmin.Y;
lastBuiltTileBmin.Z = bmin.Z + ty * ts;
lastBuiltTileBmax[0] = bmin[0] + (tx + 1) * ts;
lastBuiltTileBmax[1] = bmax[1];
lastBuiltTileBmax[2] = bmin[2] + (ty + 1) * ts;
lastBuiltTileBmax.X = bmin.X + (tx + 1) * ts;
lastBuiltTileBmax.Y = bmax.Y;
lastBuiltTileBmax.Z = bmin.Z + (ty + 1) * ts;
dd.DebugDrawCross(_hitPos.X, _hitPos.Y + 0.1f, _hitPos.Z, s, DuRGBA(0, 0, 0, 128), 2.0f);
dd.DebugDrawBoxWire(