Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-06-17 22:38:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-06-17 22:38:10 +0300
commit49be79693c6d2e3be20b2cd0ecf81e76a7121b2f (patch)
treeec7913671e48abc263c95ef323186f3b57daead7 /source/blender/editors/manipulator_library/primitive3d_manipulator.c
parent83c28ff96a5745c7f5713665890211657b45a35f (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/primitive3d_manipulator.c')
-rw-r--r--source/blender/editors/manipulator_library/primitive3d_manipulator.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/manipulator_library/primitive3d_manipulator.c b/source/blender/editors/manipulator_library/primitive3d_manipulator.c
index 743927c4147..d8dbf4a52d6 100644
--- a/source/blender/editors/manipulator_library/primitive3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/primitive3d_manipulator.c
@@ -118,7 +118,7 @@ static void manipulator_primitive_draw_intern(
}
copy_m4_m3(mat, rot);
- copy_v3_v3(mat[3], prim->manipulator.origin);
+ copy_v3_v3(mat[3], prim->manipulator.matrix[3]);
mul_mat3_m4_fl(mat, prim->manipulator.scale);
gpuPushMatrix();
@@ -129,7 +129,7 @@ static void manipulator_primitive_draw_intern(
col_inner[3] *= 0.5f;
glEnable(GL_BLEND);
- gpuTranslate3fv(prim->manipulator.offset);
+ gpuMultMatrix(prim->manipulator.matrix_offset);
manipulator_primitive_draw_geom(col_inner, col_outer, prim->style);
glDisable(GL_BLEND);
@@ -143,14 +143,14 @@ static void manipulator_primitive_draw_intern(
col_outer[3] = 0.8f;
copy_m4_m3(mat, rot);
- copy_v3_v3(mat[3], inter->init_origin);
+ copy_v3_v3(mat[3], inter->init_matrix[3]);
mul_mat3_m4_fl(mat, inter->init_scale);
gpuPushMatrix();
gpuMultMatrix(mat);
glEnable(GL_BLEND);
- gpuTranslate3fv(prim->manipulator.offset);
+ gpuMultMatrix(prim->manipulator.matrix_offset);
manipulator_primitive_draw_geom(col_inner, col_outer, prim->style);
glDisable(GL_BLEND);
@@ -191,7 +191,7 @@ static void manipulator_primitive_invoke(
{
ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
- copy_v3_v3(inter->init_origin, mpr->origin);
+ copy_m4_m4(inter->init_matrix, mpr->matrix);
inter->init_scale = mpr->scale;
mpr->interaction_data = inter;