diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-16 09:41:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-16 09:41:17 +0400 |
commit | 775a54485b09526b806f6a327c2737dc4bde80a8 (patch) | |
tree | 9496fa43798ee9b6ac801213fbfc92e637df2976 /source/blender/blenlib/intern/math_matrix.c | |
parent | 8b87b2473ae83c0a64115ce19ef1599513ce8acb (diff) |
Math Lib: add mul_v3_project_m4_v3
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 888587e055c..af42af88582 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -514,6 +514,16 @@ void mul_project_m4_v3(float mat[4][4], float vec[3]) vec[2] /= w; } +void mul_v3_project_m4_v3(float r[3], float mat[4][4], const float vec[3]) +{ + const float w = mul_project_m4_v3_zfac(mat, vec); + mul_v3_m4v3(r, mat, vec); + + r[0] /= w; + r[1] /= w; + r[2] /= w; +} + void mul_v2_project_m4_v3(float r[2], float mat[4][4], const float vec[3]) { const float w = mul_project_m4_v3_zfac(mat, vec); |