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
path: root/source
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
parenta2c9d87a99291be121c1850ce4c52e1d964360fb (diff)
Avoid redundant normal calculation in heat-weight
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c4
-rw-r--r--source/blender/editors/armature/meshlaplacian.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 50634460028..87bc355894d 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -545,7 +545,7 @@ static void distribute_from_volume_exec(ParticleTask *thread, ParticleData *pa,
v2=mvert[mface->v2].co;
v3=mvert[mface->v3].co;
- if (isect_ray_tri_v3(co, nor, v2, v3, v1, &cur_d, 0)) {
+ if (isect_ray_tri_v3(co, nor, v2, v3, v1, &cur_d, NULL)) {
if (cur_d<min_d) {
min_d=cur_d;
pa->foffset=cur_d*0.5f; /* to the middle of volume */
@@ -555,7 +555,7 @@ static void distribute_from_volume_exec(ParticleTask *thread, ParticleData *pa,
if (mface->v4) {
v4=mvert[mface->v4].co;
- if (isect_ray_tri_v3(co, nor, v4, v1, v3, &cur_d, 0)) {
+ if (isect_ray_tri_v3(co, nor, v4, v1, v3, &cur_d, NULL)) {
if (cur_d<min_d) {
min_d=cur_d;
pa->foffset=cur_d*0.5f; /* to the middle of volume */
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;
+ }
}
}
}