diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-17 22:38:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-17 22:38:10 +0300 |
commit | 49be79693c6d2e3be20b2cd0ecf81e76a7121b2f (patch) | |
tree | ec7913671e48abc263c95ef323186f3b57daead7 /source/blender/editors/manipulator_library/grab3d_manipulator.c | |
parent | 83c28ff96a5745c7f5713665890211657b45a35f (diff) |
Manipulator: use matrix instead of origin
This avoids having to use manipulator-type specific functions
to set the orientation.
And will make it simpler to access transformation from Python.
Currently the matrix is still used as an offset in places.
Also per-type orientation values still need to be removed.
Diffstat (limited to 'source/blender/editors/manipulator_library/grab3d_manipulator.c')
-rw-r--r-- | source/blender/editors/manipulator_library/grab3d_manipulator.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/manipulator_library/grab3d_manipulator.c b/source/blender/editors/manipulator_library/grab3d_manipulator.c index 136613e22c2..e9c9f13cb19 100644 --- a/source/blender/editors/manipulator_library/grab3d_manipulator.c +++ b/source/blender/editors/manipulator_library/grab3d_manipulator.c @@ -87,7 +87,7 @@ static void grab_calc_matrix(const GrabManipulator *grab, float mat[4][4]) rotation_between_vecs_to_mat3(rot, up, grab->direction); copy_m4_m3(mat, rot); - copy_v3_v3(mat[3], grab->manipulator.origin); + copy_v3_v3(mat[3], grab->manipulator.matrix[3]); mul_mat3_m4_fl(mat, grab->manipulator.scale); } @@ -160,7 +160,7 @@ static void grab3d_draw_intern( gpuTranslate3fv(inter->output.co_ofs); } gpuMultMatrix(mat); - gpuTranslate3fv(grab->manipulator.offset); + gpuMultMatrix(grab->manipulator.matrix_offset); glEnable(GL_BLEND); grab_geom_draw(grab, col, select); glDisable(GL_BLEND); @@ -169,7 +169,7 @@ static void grab3d_draw_intern( if (grab->manipulator.interaction_data) { gpuPushMatrix(); gpuMultMatrix(mat); - gpuTranslate3fv(grab->manipulator.offset); + gpuMultMatrix(grab->manipulator.matrix_offset); glEnable(GL_BLEND); grab_geom_draw(grab, (const float [4]){0.5f, 0.5f, 0.5f, 0.5f}, select); glDisable(GL_BLEND); |