]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fixed a severe bug in texcoord2f[] reading in Mod_BuildTextureVectorsAndNormals
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 13 Jul 2003 04:09:47 +0000 (04:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 13 Jul 2003 04:09:47 +0000 (04:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3262 d7cf8633-e32d-0410-b094-e92efae38249

model_shared.c

index d600269bd60f517be377e2fa503fb2ccd8ed04d5..c715e95b1cbfdf335fd291d1cd6aed4d8b47d52b 100644 (file)
@@ -531,9 +531,9 @@ void Mod_BuildTextureVectorsAndNormals(int numverts, int numtriangles, const flo
                        if (tvector3f || svector3f)
                        {
                                // 3 assignments, 15 subtracts, 6 multiplies
-                               tdir[0] = ((texcoord2f[e[1] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[2]*3+0] - vertex3f[e[0]*3+0]) - (texcoord2f[e[2] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[1]*3+0] - vertex3f[e[0]*3+0]));
-                               tdir[1] = ((texcoord2f[e[1] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[2]*3+1] - vertex3f[e[0]*3+1]) - (texcoord2f[e[2] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[1]*3+1] - vertex3f[e[0]*3+1]));
-                               tdir[2] = ((texcoord2f[e[1] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[2]*3+2] - vertex3f[e[0]*3+2]) - (texcoord2f[e[2] * 3] - texcoord2f[e[0] * 3]) * (vertex3f[e[1]*3+2] - vertex3f[e[0]*3+2]));
+                               tdir[0] = ((texcoord2f[e[1] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[2]*3+0] - vertex3f[e[0]*3+0]) - (texcoord2f[e[2] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[1]*3+0] - vertex3f[e[0]*3+0]));
+                               tdir[1] = ((texcoord2f[e[1] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[2]*3+1] - vertex3f[e[0]*3+1]) - (texcoord2f[e[2] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[1]*3+1] - vertex3f[e[0]*3+1]));
+                               tdir[2] = ((texcoord2f[e[1] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[2]*3+2] - vertex3f[e[0]*3+2]) - (texcoord2f[e[2] * 2] - texcoord2f[e[0] * 2]) * (vertex3f[e[1]*3+2] - vertex3f[e[0]*3+2]));
                                // 1 assignments, 1 negates, 2 adds, 3 multiplies
                                f = -DotProduct(tdir, normal);
                                // 3 assignments, 3 adds, 3 multiplies