Improve readability of tangent computing

This commit is contained in:
SirLynix 2022-06-28 08:58:08 +02:00
parent 622b89b0f5
commit 4f08e7d848
1 changed files with 4 additions and 4 deletions

View File

@ -90,9 +90,9 @@ namespace Nz
float coef = 1.f / (duv[0].x * duv[1].y - duv[1].x * duv[0].y);
Vector3f tangent;
tangent.x = coef * (dv[0].x*duv[1].y + dv[1].x*(-duv[0].y));
tangent.y = coef * (dv[0].y*duv[1].y + dv[1].y*(-duv[0].y));
tangent.z = coef * (dv[0].z*duv[1].y + dv[1].z*(-duv[0].y));
tangent.x = coef * (dv[0].x * duv[1].y - dv[1].x * duv[0].y);
tangent.y = coef * (dv[0].y * duv[1].y - dv[1].y * duv[0].y);
tangent.z = coef * (dv[0].z * duv[1].y - dv[1].z * duv[0].y);
for (unsigned int i = 0; i < 3; ++i)
{