]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.c
more q3bsp work (and no it still doesn't work right)
[xonotic/darkplaces.git] / mathlib.c
index 83f39a823a48836dd4a09534b224ae556fcdf802..3fe396b83b826d45a310b98088860efdd6d0662c 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -215,9 +215,7 @@ void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up)
        right[2] = forward[1];
 
        d = DotProduct(forward, right);
-       right[0] -= d * forward[0];
-       right[1] -= d * forward[1];
-       right[2] -= d * forward[2];
+       VectorMA(right, -d, forward, right);
        VectorNormalizeFast(right);
        CrossProduct(right, forward, up);
 }
@@ -231,9 +229,7 @@ void VectorVectorsDouble(const double *forward, double *right, double *up)
        right[2] = forward[1];
 
        d = DotProduct(forward, right);
-       right[0] -= d * forward[0];
-       right[1] -= d * forward[1];
-       right[2] -= d * forward[2];
+       VectorMA(right, -d, forward, right);
        VectorNormalize(right);
        CrossProduct(right, forward, up);
 }