fix for crashes running some operators in background mode and some divide by zero errors.

This commit is contained in:
2013-02-06 02:48:03 +00:00
parent 6ff014a7fe
commit 441c7fb79a
8 changed files with 52 additions and 25 deletions

View File

@@ -433,14 +433,18 @@ void makeraytree(Render *re)
* This is ONLY needed to kept a bogus behavior of SUN and HEMI lights */
INIT_MINMAX(min, max);
RE_rayobject_merge_bb(re->raytree, min, max);
if (min[0] > max[0]) { /* empty raytree */
zero_v3(min);
zero_v3(max);
}
for (i=0; i<3; i++) {
/* TODO: explain why add top both min and max??? */
min[i] += 0.01f;
max[i] += 0.01f;
sub[i] = max[i]-min[i];
}
re->maxdist = dot_v3v3(sub, sub);
if (re->maxdist > 0.0f) re->maxdist= sqrt(re->maxdist);
re->maxdist = len_v3(sub);
re->i.infostr= "Raytree finished";
re->stats_draw(re->sdh, &re->i);