]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_lightning.c
added a firstvertex parameter to R_Mesh_DrawMesh
[xonotic/darkplaces.git] / r_lightning.c
index 74b397bb4b7a8401c5bd52d8fdc5ae47f15f4994..639df83f4a18bee36c0806ce2ab89c5044e865d4 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);
@@ -321,7 +321,7 @@ void R_DrawLightningBeamCallback(const void *calldata1, int calldata2)
 
        // draw the 3 polygons as one batch of 6 triangles using the 12 vertices
        GL_LockArrays(0, 12);
-       R_Mesh_Draw(12, 6, r_lightningbeamelements);
+       R_Mesh_Draw(0, 12, 6, r_lightningbeamelements);
        GL_LockArrays(0, 0);
 }