refactor: support netstandard2.1 vector3

This commit is contained in:
ikpil 2023-10-28 13:04:06 +09:00
parent b4c9773b27
commit ffdbdb7ed8
1 changed files with 2 additions and 7 deletions

View File

@ -90,13 +90,8 @@ namespace DotRecast.Recast.Toolset.Geom
int v0 = faces[i] * 3; int v0 = faces[i] * 3;
int v1 = faces[i + 1] * 3; int v1 = faces[i + 1] * 3;
int v2 = faces[i + 2] * 3; int v2 = faces[i + 2] * 3;
RcVec3f e0 = new RcVec3f(); var e0 = RcVecUtils.Subtract(vertices, v1, v0);
RcVec3f e1 = new RcVec3f(); var e1 = RcVecUtils.Subtract(vertices, v2, v0);
for (int j = 0; j < 3; ++j)
{
e0[j] = vertices[v1 + j] - vertices[v0 + j];
e1[j] = vertices[v2 + j] - vertices[v0 + j];
}
normals[i] = e0.Y * e1.Z - e0.Z * e1.Y; normals[i] = e0.Y * e1.Z - e0.Z * e1.Y;
normals[i + 1] = e0.Z * e1.X - e0.X * e1.Z; normals[i + 1] = e0.Z * e1.X - e0.X * e1.Z;