From: havoc Date: Sun, 13 Jul 2003 04:09:47 +0000 (+0000) Subject: fixed a severe bug in texcoord2f[] reading in Mod_BuildTextureVectorsAndNormals X-Git-Tag: xonotic-v0.1.0preview~6538 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e40625431dffbdd685f2803b53bf2dea67f326ca;p=xonotic%2Fdarkplaces.git fixed a severe bug in texcoord2f[] reading in Mod_BuildTextureVectorsAndNormals git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3262 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_shared.c b/model_shared.c index d600269b..c715e95b 100644 --- a/model_shared.c +++ b/model_shared.c @@ -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