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>2015-08-20 08:09:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-20 08:09:25 +0300
commit6b53b4afb9cb2f334ca4503f05b02e7acc5f68e5 (patch)
treee0da4bfb475765edcab926fc268b406addd6fa53 /source/blender/editors/armature/meshlaplacian.c
parenta2c9d87a99291be121c1850ce4c52e1d964360fb (diff)
Avoid redundant normal calculation in heat-weight
Diffstat (limited to 'source/blender/editors/armature/meshlaplacian.c')
-rw-r--r--source/blender/editors/armature/meshlaplacian.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 543874b44d0..da53d0a1005 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -386,18 +386,21 @@ static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray
const MLoop *mloop = data->sys->heat.mloop;
float (*verts)[3] = data->sys->heat.verts;
const float *vtri_co[3];
- float lambda, uv[2], n[3], dir[3];
+ float lambda, dir[3];
mul_v3_v3fl(dir, data->vec, hit->dist);
vtri_co[0] = verts[mloop[lt->tri[0]].v];
vtri_co[1] = verts[mloop[lt->tri[1]].v];
vtri_co[2] = verts[mloop[lt->tri[2]].v];
- if (isect_ray_tri_v3(data->start, dir, UNPACK3(vtri_co), &lambda, uv)) {
- normal_tri_v3(n, UNPACK3(vtri_co));
- if (lambda < 1.0f && dot_v3v3(n, data->vec) < -1e-5f) {
- hit->index = index;
- hit->dist *= lambda;
+ if (isect_ray_tri_v3(data->start, dir, UNPACK3(vtri_co), &lambda, NULL)) {
+ if (lambda < 1.0f) {
+ float n[3];
+ normal_tri_v3(n, UNPACK3(vtri_co));
+ if (dot_v3v3(n, data->vec) < -1e-5f) {
+ hit->index = index;
+ hit->dist *= lambda;
+ }
}
}
}