Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-09-16 09:41:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-09-16 09:41:17 +0400
commit775a54485b09526b806f6a327c2737dc4bde80a8 (patch)
tree9496fa43798ee9b6ac801213fbfc92e637df2976 /source/blender/blenlib/intern
parent8b87b2473ae83c0a64115ce19ef1599513ce8acb (diff)
Math Lib: add mul_v3_project_m4_v3
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/math_matrix.c10
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);