diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-03 14:05:16 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-03 14:05:23 +0300 |
commit | 780bb88a7a5b30eaf8a62b999a30ac7bb4153ebf (patch) | |
tree | 621e1c05f686c3c522c31b0061202671fdc32139 /source/blender/blenlib/BLI_math_geom.h | |
parent | 16ed20ff3cc68589a5fe48075d2b80692d3c90ea (diff) |
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
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 3 |
1 files changed, 3 insertions, 0 deletions
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], |