fix own error in r56649, caused normal calculation to fail, reported as [#35448], also quiet float/double warning.

This commit is contained in:
Campbell Barton
2013-05-24 06:50:15 +00:00
parent 8e6ce736c4
commit dfdb2eb9a8
2 changed files with 5 additions and 6 deletions

View File

@@ -1951,9 +1951,9 @@ static void mesh_calc_normals_poly_accum(MPoly *mp, MLoop *ml,
/* Polygon Normal and edge-vector */
/* inline version of #BKE_mesh_calc_poly_normal, also does edge-vectors */
{
float const *v_prev = mvert[ml[nverts - 1].v].co;
float const *v_curr;
int i_prev = nverts - 1;
float const *v_prev = mvert[ml[i_prev].v].co;
float const *v_curr;
zero_v3(polyno);
/* Newell's Method */
@@ -1979,14 +1979,13 @@ static void mesh_calc_normals_poly_accum(MPoly *mp, MLoop *ml,
for (i = 0; i < nverts; i++) {
const float *cur_edge = edgevecbuf[i];
unsigned int vindex = ml[i].v;
/* calculate angle between the two poly edges incident on
* this vertex */
const float fac = saacos(-dot_v3v3(cur_edge, prev_edge));
/* accumulate */
madd_v3_v3fl(tnorms[vindex], polyno, fac);
madd_v3_v3fl(tnorms[ml[i].v], polyno, fac);
prev_edge = cur_edge;
}
}

View File

@@ -3844,7 +3844,7 @@ static void *do_projectpaint_thread(void *ph_v)
if (ps->is_maskbrush) {
float texmask = BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
CLAMP(texmask, 0.0, 1.0);
CLAMP(texmask, 0.0f, 1.0f);
mask = mask_accum + (brush_alpha * texmask * 65535.0f - mask_accum) * mask;
}
else {
@@ -3865,7 +3865,7 @@ static void *do_projectpaint_thread(void *ph_v)
mask *= brush_alpha;
if (ps->is_maskbrush) {
float texmask = BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
CLAMP(texmask, 0.0, 1.0);
CLAMP(texmask, 0.0f, 1.0f);
mask *= texmask;
}
}