diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-17 09:49:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-17 09:49:06 +0400 |
commit | b0752f1b89f237b65cfcad233b56859038927987 (patch) | |
tree | 0121d3359ed3da220c0307bc1f10ea9c2a3607a8 /source/blender/blenlib | |
parent | 8ee1de2de3418ce66dde97c0aedbacc8a23d1698 (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')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index ee0a9db4f02..9b2d6a5ead6 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -176,6 +176,7 @@ void interp_v3_v3v3v3v3(float p[3], const float v1[3], const float v2[3], const void interp_v4_v4v4(float r[4], const float a[4], const float b[4], const float t); void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3]); void interp_v4_v4v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float v4[4], const float w[4]); +void interp_v3_v3v3v3_uv(float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2]); void mid_v3_v3v3(float r[3], const float a[3], const float b[3]); void mid_v2_v2v2(float r[2], const float a[2], const float b[2]); 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]); |