Revision: 48413
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48413
Author:   miikah
Date:     2012-06-29 17:36:34 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
Fix: Smoke obstacles were sometimes processed in wrong location when adaptive 
domain was enabled.

Modified Paths:
--------------
    branches/soc-2012-fried_chicken/source/blender/blenkernel/intern/smoke.c
    
branches/soc-2012-fried_chicken/source/blender/editors/space_view3d/drawobject.c

Modified: 
branches/soc-2012-fried_chicken/source/blender/blenkernel/intern/smoke.c
===================================================================
--- branches/soc-2012-fried_chicken/source/blender/blenkernel/intern/smoke.c    
2012-06-29 14:39:38 UTC (rev 48412)
+++ branches/soc-2012-fried_chicken/source/blender/blenkernel/intern/smoke.c    
2012-06-29 17:36:34 UTC (rev 48413)
@@ -705,11 +705,11 @@
 
                if (bvhtree_from_mesh_faces(&treeData, dm, 0.0f, 4, 6)) {
                        #pragma omp parallel for schedule(static)
-                       for (z = 0; z < res[2]; z++) {
+                       for (z = sds->res_min[2]; z < sds->res_max[2]; z++) {
                                int x,y;
-                               for (x = 0; x < res[0]; x++)
-                               for (y = 0; y < res[1]; y++) {
-                                       int index = x + y*res[0] + 
z*res[0]*res[1];
+                               for (x = sds->res_min[0]; x < sds->res_max[0]; 
x++)
+                               for (y = sds->res_min[1]; y < sds->res_max[1]; 
y++) {
+                                       int index = 
smoke_get_index(x-sds->res_min[0], sds->res[0], y-sds->res_min[1], sds->res[1], 
z-sds->res_min[2]);
 
                                        float ray_start[3] = {(float)x + 0.5f, 
(float)y + 0.5f, (float)z + 0.5f};
                                        BVHTreeNearest nearest = {0};

Modified: 
branches/soc-2012-fried_chicken/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- 
branches/soc-2012-fried_chicken/source/blender/editors/space_view3d/drawobject.c
    2012-06-29 14:39:38 UTC (rev 48412)
+++ 
branches/soc-2012-fried_chicken/source/blender/editors/space_view3d/drawobject.c
    2012-06-29 17:36:34 UTC (rev 48413)
@@ -7010,15 +7010,17 @@
                                normalize_v3(viewnormal);
 
                                
-                               /* draw domain max bounds */
-                               VECSUBFAC(p0, sds->p0, sds->cell_size, 
sds->adapt_res);
-                               VECADDFAC(p1, sds->p1, sds->cell_size, 
sds->adapt_res);
-                               BKE_boundbox_init_from_minmax(&bb, p0, p1);
-                               draw_box(bb.vec);
+                               if (sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN) {
+                                       /* draw domain max bounds */
+                                       VECSUBFAC(p0, sds->p0, sds->cell_size, 
sds->adapt_res);
+                                       VECADDFAC(p1, sds->p1, sds->cell_size, 
sds->adapt_res);
+                                       BKE_boundbox_init_from_minmax(&bb, p0, 
p1);
+                                       draw_box(bb.vec);
 
-                               /* draw base resolution bounds */
-                               /*BKE_boundbox_init_from_minmax(&bb, sds->p0, 
sds->p1);
-                               draw_box(bb.vec);*/
+                                       /* draw base resolution bounds */
+                                       /*BKE_boundbox_init_from_minmax(&bb, 
sds->p0, sds->p1);
+                                       draw_box(bb.vec);*/
+                               }
 
                                /* set dynamic boundaries to draw the volume */
                                p0[0] = sds->p0[0] + 
sds->cell_size[0]*sds->res_min[0] + sds->obj_shift_f[0];

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to