diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-27 15:44:45 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-27 15:59:41 +0300 |
commit | 770e91703d1196751432ef4a2db5ca7afed02aee (patch) | |
tree | 893865b32f87ccd1d6c04b442bd8c9bccad93ea2 /source/blender/editors/sculpt_paint/paint_hide.c | |
parent | d3a98b2c3b44244bff3b0386f33a277286b26f59 (diff) |
Fix part of T70295: sculpt drawing not clipping PBVH behind the camera
Use all 6 clipping planes for drawing.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_hide.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_hide.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index 3463ceb7341..3e55a5d1b36 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -323,17 +323,18 @@ static void get_pbvh_nodes( /* select search callback */ switch (mode) { case PARTIALVIS_INSIDE: - cb = BKE_pbvh_node_planes_contain_AABB; + cb = BKE_pbvh_node_frustum_contain_AABB; break; case PARTIALVIS_OUTSIDE: - cb = BKE_pbvh_node_planes_exclude_AABB; + cb = BKE_pbvh_node_frustum_exclude_AABB; break; case PARTIALVIS_ALL: case PARTIALVIS_MASKED: break; } - BKE_pbvh_search_gather(pbvh, cb, clip_planes, nodes, totnode); + PBVHFrustumPlanes frustum = {.planes = clip_planes, .num_planes = 4}; + BKE_pbvh_search_gather(pbvh, cb, &frustum, nodes, totnode); } static int hide_show_exec(bContext *C, wmOperator *op) @@ -364,6 +365,8 @@ static int hide_show_exec(bContext *C, wmOperator *op) get_pbvh_nodes(pbvh, &nodes, &totnode, clip_planes, area); pbvh_type = BKE_pbvh_type(pbvh); + negate_m4(clip_planes); + /* start undo */ switch (action) { case PARTIALVIS_HIDE: |