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>2013-04-17 09:49:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-17 09:49:06 +0400
commitb0752f1b89f237b65cfcad233b56859038927987 (patch)
tree0121d3359ed3da220c0307bc1f10ea9c2a3607a8 /source/blender/blenlib/intern/math_vector.c
parent8ee1de2de3418ce66dde97c0aedbacc8a23d1698 (diff)
add interp_v3_v3v3v3_uv() to use for use with uv value from isect_ray_tri_v3(), rename tree -> bmtree for BMBVHTree.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r--source/blender/blenlib/intern/math_vector.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 572bc4526af..24b5d2af3db 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -102,6 +102,13 @@ void interp_v4_v4v4v4v4(float p[4], const float v1[4], const float v2[4], const
p[3] = v1[3] * w[0] + v2[3] * w[1] + v3[3] * w[2] + v4[3] * w[3];
}
+void interp_v3_v3v3v3_uv(float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2])
+{
+ p[0] = v1[0] + ((v2[0] - v1[0]) * uv[0]) + ((v3[0] - v1[0]) * uv[1]);
+ p[1] = v1[1] + ((v2[1] - v1[1]) * uv[0]) + ((v3[1] - v1[1]) * uv[1]);
+ p[2] = v1[2] + ((v2[2] - v1[2]) * uv[0]) + ((v3[2] - v1[2]) * uv[1]);
+}
+
void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3])
{
v[0] = 0.5f * (v1[0] + v2[0]);