diff --git a/code/math/vecmat.cpp b/code/math/vecmat.cpp index afe7c691488..dc878e33f9a 100644 --- a/code/math/vecmat.cpp +++ b/code/math/vecmat.cpp @@ -855,7 +855,7 @@ void vm_vector_2_matrix_gen_vectors_uvec(matrix* m) } else { //not straight up or down - xvec->xyz.x = yvec->xyz.y; + xvec->xyz.x = yvec->xyz.z; xvec->xyz.y = 0.0f; xvec->xyz.z = -yvec->xyz.x; @@ -973,6 +973,8 @@ matrix* vm_vector_2_matrix_uvec_norm(matrix* m, const vec3d* fvec, const vec3d* *zvec = *fvec; if (rvec != nullptr) { // use rvec + *xvec = *rvec; + vm_vec_cross(yvec, zvec, xvec); //normalize new perpendicular vector