diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-21 17:55:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-22 14:29:05 +0300 |
commit | 742848843dd04df530f25ac5111cfc2f16237f51 (patch) | |
tree | 66a135625015608516bcf28c366744d772c8bafe /source/blender/draw/intern/draw_manager_exec.c | |
parent | 925b5823ccbc4fb3f7f90b29950e3d7bb0d5c90e (diff) |
DRW: Add view param to DRW_culling_* functions
Diffstat (limited to 'source/blender/draw/intern/draw_manager_exec.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index f6d18aeed3d..36e9244df06 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -479,24 +479,26 @@ static bool draw_culling_plane_test(const BoundBox *corners, const float plane[4 /* Return True if the given BoundSphere intersect the current view frustum. * bsphere must be in world space. */ -bool DRW_culling_sphere_test(const BoundSphere *bsphere) +bool DRW_culling_sphere_test(const DRWView *view, const BoundSphere *bsphere) { - return draw_culling_sphere_test( - &DST.view_active->frustum_bsphere, DST.view_active->frustum_planes, bsphere); + view = view ? view : DST.view_default; + return draw_culling_sphere_test(&view->frustum_bsphere, view->frustum_planes, bsphere); } /* Return True if the given BoundBox intersect the current view frustum. * bbox must be in world space. */ -bool DRW_culling_box_test(const BoundBox *bbox) +bool DRW_culling_box_test(const DRWView *view, const BoundBox *bbox) { - return draw_culling_box_test(DST.view_active->frustum_planes, bbox); + view = view ? view : DST.view_default; + return draw_culling_box_test(view->frustum_planes, bbox); } /* Return True if the view frustum is inside or intersect the given plane. * plane must be in world space. */ -bool DRW_culling_plane_test(const float plane[4]) +bool DRW_culling_plane_test(const DRWView *view, const float plane[4]) { - return draw_culling_plane_test(&DST.view_active->frustum_corners, plane); + view = view ? view : DST.view_default; + return draw_culling_plane_test(&view->frustum_corners, plane); } void DRW_culling_frustum_corners_get(BoundBox *corners) |