diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-09-25 22:45:09 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-09-25 22:45:09 +0300 |
commit | 584288a97c2b1f28dc0e29b2bd986830df233947 (patch) | |
tree | 955e38ff9451b432a15d93a19aeb3bdc023090e3 /source/blender/editors/space_view3d/drawvolume.c | |
parent | ae69986b70611f358491759f39fd91efd015dab9 (diff) |
Smoke debug draw: take adaptive domain position into account.
Eventually the various functions that deals with adaptive domain
bounding box shall de-duplicated.
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawvolume.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index d743ff9239a..b0e21601b9c 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -680,8 +680,11 @@ void draw_smoke_velocity(SmokeDomainSettings *domain, float viewnormal[3]) if (xyz[1] < res_min[1]) xyz[1] += step_size; if (xyz[2] < res_min[2]) xyz[2] += step_size; - float min[3]; - add_v3_v3v3(min, domain->p0, domain->obj_shift_f); + float min[3] = { + domain->p0[0] - domain->cell_size[0] * domain->adapt_res, + domain->p0[1] - domain->cell_size[1] * domain->adapt_res, + domain->p0[2] - domain->cell_size[2] * domain->adapt_res, + }; int num_points_v[3] = { ((float)(res_max[0] - floor(xyz[0])) / step_size) + 0.5f, @@ -695,7 +698,7 @@ void draw_smoke_velocity(SmokeDomainSettings *domain, float viewnormal[3]) const int axis = (domain->slice_axis == SLICE_AXIS_AUTO) ? axis_dominant_v3_single(viewnormal) : domain->slice_axis - 1; - xyz[axis] = (float)res[axis] * domain->slice_depth; + xyz[axis] = (float)base_res[axis] * domain->slice_depth; num_points_v[axis] = 1; res_max[axis] = xyz[axis] + 1; } |