From 780bb88a7a5b30eaf8a62b999a30ac7bb4153ebf Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 3 Jan 2015 12:05:16 +0100 Subject: Refactor 'fit in camera view' code, and expose it to RNA. This changes BKE's fitting code to use `BKE_camera_params_compute_viewplane` instead of `BKE_camera_view_frame`. This allows that code to work with orthographic projection too. Also, two funcs were added to rna's Object, to resp. get the projection matrix of that object (mostly useful for cameras and lamps objects), and return position this object should be to see all (to fit) a given set of points. Reviewers: campbellbarton Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D961 --- source/blender/blenlib/BLI_math_geom.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenlib/BLI_math_geom.h') diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 95ab3185d1f..ee99f860a97 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -265,6 +265,9 @@ void orthographic_m4(float mat[4][4], const float left, const float right, void window_translate_m4(float winmat[4][4], float perspmat[4][4], const float x, const float y); +void planes_from_projmat(float mat[4][4], float left[4], float right[4], float top[4], float bottom[4], + float front[4], float back[4]); + int box_clip_bounds_m4(float boundbox[2][3], const float bounds[4], float winmat[4][4]); void box_minmax_bounds_m4(float min[3], float max[3], -- cgit v1.2.3