diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-15 00:15:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-15 00:15:44 +0300 |
commit | bac9c2dc7db1861400f5b37758eb23cdb9fb7325 (patch) | |
tree | d7e06bda60f4ea83e541ebc525d222ed84e654a6 /source/blender/windowmanager | |
parent | e159ec8bc1871da8766b319fcda5c76eff1c0a48 (diff) |
Manipulator: utility to get matrix w/o offset
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/manipulators/WM_manipulator_api.h | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/manipulators/intern/wm_manipulator.c | 16 |
2 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_api.h b/source/blender/windowmanager/manipulators/WM_manipulator_api.h index 748cc18480f..b88956ac28d 100644 --- a/source/blender/windowmanager/manipulators/WM_manipulator_api.h +++ b/source/blender/windowmanager/manipulators/WM_manipulator_api.h @@ -125,8 +125,11 @@ struct WM_ManipulatorMatrixParams { void WM_manipulator_calc_matrix_final_params( const struct wmManipulator *mpr, const struct WM_ManipulatorMatrixParams *params, float r_mat[4][4]); +void WM_manipulator_calc_matrix_final_no_offset( + const struct wmManipulator *mpr, float r_mat[4][4]); -void WM_manipulator_calc_matrix_final(const struct wmManipulator *mpr, float r_mat[4][4]); +void WM_manipulator_calc_matrix_final( + const struct wmManipulator *mpr, float r_mat[4][4]); /* properties */ void WM_manipulator_properties_create_ptr(struct PointerRNA *ptr, struct wmManipulatorType *wt); diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c index 42232950cc4..f5a8746f807 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c @@ -598,6 +598,22 @@ void WM_manipulator_calc_matrix_final_params( mul_m4_m4m4(r_mat, matrix_space, final_matrix); } +void WM_manipulator_calc_matrix_final_no_offset(const wmManipulator *mpr, float r_mat[4][4]) +{ + float mat_identity[4][4]; + unit_m4(mat_identity); + + WM_manipulator_calc_matrix_final_params( + mpr, + &((struct WM_ManipulatorMatrixParams) { + .matrix_space = NULL, + .matrix_basis = NULL, + .matrix_offset = mat_identity, + .scale_final = NULL, + }), r_mat + ); +} + void WM_manipulator_calc_matrix_final(const wmManipulator *mpr, float r_mat[4][4]) { WM_manipulator_calc_matrix_final_params( |