* Fix for crash with new raytree
authorMatt Ebb <matt@mke3.net>
Tue, 6 Oct 2009 23:05:53 +0000 (23:05 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 6 Oct 2009 23:05:53 +0000 (23:05 +0000)
source/blender/render/intern/source/volumetric.c

index 91c13207da86ed0876483a7e5c02d27bab935fad..90ac45edb601fc67e434de75adf9048dc0c90462 100644 (file)
@@ -139,12 +139,16 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco,
        */
        
        isect->mode= RE_RAY_MIRROR;
-       isect->orig.ob = (void*)shi->obi;
        isect->last_hit = NULL;
        isect->lay= -1;
        
-       if (intersect_type == VOL_BOUNDS_DEPTH) isect->orig.face = (void*)shi->vlr;
-       else if (intersect_type == VOL_BOUNDS_SS) isect->orig.face= NULL;
+       if (intersect_type == VOL_BOUNDS_DEPTH) {
+               isect->orig.face = (void*)shi->vlr;
+               isect->orig.ob = (void*)shi->obi;
+       } else if (intersect_type == VOL_BOUNDS_SS) {
+               isect->orig.face= NULL;
+               isect->orig.ob = NULL;
+       }
        
        if(RE_rayobject_raycast(R.raytree, isect))
        {