diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2013-01-20 04:19:57 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2013-01-20 04:19:57 +0400 |
commit | 4256ad75666a119bdcea3726c3d524ff92870ae0 (patch) | |
tree | 27f335ba8996fb4d50e356c55359bbf934c096ae /source/blender/blenkernel/intern/pbvh.c | |
parent | 383987560b764cc8dd43820628b022614a3f2563 (diff) |
Update object bounding box during sculpt
Fixes the sculpt object being incorrectly clipped during drawing due
to an out-of-date bounding box making it seem that the object had gone
outside the view.
Added a BKE_pbvh function to get the top-level bounding box. In
sculpt_flush_update(), where the PBVH bounds are updated, the result
is copied to the object's bounding box.
Fixes bug [#33790]
projects.blender.org/tracker/?func=detail&aid=33790&group_id=9&atid=498
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 2df2dd631d5..f72bcded9ad 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1238,6 +1238,19 @@ PBVHType BKE_pbvh_type(const PBVH *bvh) return bvh->type; } +void BKE_pbvh_bounding_box(const PBVH *bvh, float min[3], float max[3]) +{ + if (bvh->totnode) { + const BB *bb = &bvh->nodes[0].vb; + copy_v3_v3(min, bb->bmin); + copy_v3_v3(max, bb->bmax); + } + else { + zero_v3(min); + zero_v3(max); + } +} + BLI_bitmap *BKE_pbvh_grid_hidden(const PBVH *bvh) { BLI_assert(bvh->type == PBVH_GRIDS); |