diff options
author | Joseph Eagar <joeedh@gmail.com> | 2011-04-15 05:19:13 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2011-04-15 05:19:13 +0400 |
commit | c98148a963d37fc2f25e125afeb4cf21df6fbf14 (patch) | |
tree | 691a051e27f08e35bf09d35b6fb9c88e4c37b8d2 /source/blender/editors/transform/transform_manipulator.c | |
parent | 0bba684d08952d0be822f3906ffb2a03b2674cc2 (diff) | |
parent | fa63c297753636c149fbb1a3877d9b3d93601357 (diff) |
=bmesh= merge from trunk at r36153
Diffstat (limited to 'source/blender/editors/transform/transform_manipulator.c')
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index a281b388084..607fd59e0ec 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/transform/transform_manipulator.c + * \ingroup edtransform + */ + + #include <stdlib.h> #include <string.h> #include <math.h> @@ -558,29 +563,29 @@ static void test_manipulator_axis(const bContext *C) viewvector(rv3d, rv3d->twmat[3], vec); angle = fabs(angle_v3v3(rv3d->twmat[0], vec)); - if (angle > M_PI / 2) { - angle = M_PI - angle; + if (angle > (float)M_PI / 2.0f) { + angle = (float)M_PI - angle; } - angle = rv3d->twangle[0] = 180.0f * angle / M_PI; - if (angle < 5) { + angle = rv3d->twangle[0] = RAD2DEGF(angle); + if (angle < 5.0f) { rv3d->twdrawflag &= ~(MAN_TRANS_X|MAN_SCALE_X); } angle = fabs(angle_v3v3(rv3d->twmat[1], vec)); - if (angle > M_PI / 2) { - angle = M_PI - angle; + if (angle > (float)M_PI / 2.0f) { + angle = (float)M_PI - angle; } - angle = rv3d->twangle[1] = 180.0f * angle / M_PI; - if (angle < 5) { + angle = rv3d->twangle[1] = RAD2DEGF(angle); + if (angle < 5.0f) { rv3d->twdrawflag &= ~(MAN_TRANS_Y|MAN_SCALE_Y); } angle = fabs(angle_v3v3(rv3d->twmat[2], vec)); - if (angle > M_PI / 2) { - angle = M_PI - angle; + if (angle > (float)M_PI / 2.0f) { + angle = (float)M_PI - angle; } - angle = rv3d->twangle[2] = 180.0f * angle / M_PI; - if (angle < 5) { + angle = rv3d->twangle[2] = RAD2DEGF(angle); + if (angle < 5.0f) { rv3d->twdrawflag &= ~(MAN_TRANS_Z|MAN_SCALE_Z); } } @@ -830,7 +835,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, if(arcs) { /* clipplane makes nice handles, calc here because of multmatrix but with translate! */ VECCOPY(plane, rv3d->viewinv[2]); - plane[3]= -0.02*size; // clip just a bit more + plane[3]= -0.02f*size; // clip just a bit more glClipPlane(GL_CLIP_PLANE0, plane); } /* sets view screen aligned */ @@ -1564,7 +1569,6 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float ho return 0; } -int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports); /* return 0; nothing happened */ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) @@ -1621,7 +1625,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL, FALSE); } else if (drawflags & MAN_SCALE_C) { switch(drawflags) { @@ -1652,11 +1656,11 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_resize", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL, FALSE); } else if (drawflags == MAN_ROT_T) { /* trackball need special case, init is different */ - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL); WM_operator_name_call(C, "TRANSFORM_OT_trackball", WM_OP_INVOKE_DEFAULT, op->ptr); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL, FALSE); } else if (drawflags & MAN_ROT_C) { switch(drawflags) { @@ -1672,7 +1676,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_rotate", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL, FALSE); } } /* after transform, restore drawflags */ |