]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
normalize after the CrossProduct
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 15 Jan 2005 02:08:45 +0000 (02:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 15 Jan 2005 02:08:45 +0000 (02:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4935 d7cf8633-e32d-0410-b094-e92efae38249

r_lightning.c

index 74b397bb4b7a8401c5bd52d8fdc5ae47f15f4994..1f5f90ce27718d98a9421975eeca26f8b2c5d01c 100644 (file)
@@ -253,11 +253,11 @@ void R_DrawLightningBeamCallback(const void *calldata1, int calldata2)
        // (this leaves only a vector pointing directly away from the beam)
        t1 = -DotProduct(up, beamdir);
        VectorMA(up, t1, beamdir, up);
-       // now we have a vector pointing away from the beam, now we need to normalize it
-       VectorNormalizeFast(up);
-       // generate right vector from forward and up, the result is already normalized
-       // (CrossProduct returns a vector of multiplied length of the two inputs)
+       // generate right vector from forward and up, the result is unnormalized
        CrossProduct(beamdir, up, right);
+       // now normalize the right vector and up vector
+       VectorNormalize(right);
+       VectorNormalize(up);
 
        // calculate T coordinate scrolling (start and end texcoord along the beam)
        t1 = r_refdef.time * -r_lightningbeam_scroll.value;// + beamrepeatscale * DotProduct(b->start, beamdir);