From abd1748e486e0948df26fb7a0cf42bce67f861ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Mar 2013 11:40:42 +0000 Subject: code cleanup: move runtime var zfac out of RegionView3D. rename initgrabz() -> ED_view3d_calc_zfac() and have it return the zfac to use. --- source/blender/blenlib/intern/math_matrix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib/intern/math_matrix.c') diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 9d9e3e611e1..e8d0a434e7f 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -367,7 +367,9 @@ void mul_mat3_m4_v3(float mat[4][4], float vec[3]) void mul_project_m4_v3(float mat[4][4], float vec[3]) { - const float w = vec[0] * mat[0][3] + vec[1] * mat[1][3] + vec[2] * mat[2][3] + mat[3][3]; + const float w = (mat[0][3] * vec[0]) + + (mat[1][3] * vec[1]) + + (mat[2][3] * vec[2]) + mat[3][3]; mul_m4_v3(mat, vec); vec[0] /= w; -- cgit v1.2.3