summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreaCatania <info@andreacatania.com>2017-12-09 15:01:00 +0100
committerAndreaCatania <info@andreacatania.com>2017-12-09 15:01:00 +0100
commit0ea1c3bd538a702cacd8b6dfa473fb2e07ba9837 (patch)
treed676bfdc7b68353beff4e7b8d8b6536ade5b4b80
parent32408f3bfd60aa382a38e3f37fd56bda1dd428ed (diff)
Makes consistent 6DOF joint Gizmo
-rw-r--r--editor/spatial_editor_gizmos.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 3ffc61cb45..954f804577 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -3139,8 +3139,8 @@ void Generic6DOFJointSpatialGizmo::redraw() {
case 0:
ll = p3d->get_param_x(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT);
ul = p3d->get_param_x(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT);
- lll = -p3d->get_param_x(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT);
- lul = -p3d->get_param_x(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT);
+ lll = p3d->get_param_x(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT);
+ lul = p3d->get_param_x(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT);
enable_ang = p3d->get_flag_x(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT);
enable_lin = p3d->get_flag_x(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT);
a1 = 0;
@@ -3150,25 +3150,26 @@ void Generic6DOFJointSpatialGizmo::redraw() {
case 1:
ll = p3d->get_param_y(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT);
ul = p3d->get_param_y(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT);
- lll = -p3d->get_param_y(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT);
- lul = -p3d->get_param_y(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT);
+ lll = p3d->get_param_y(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT);
+ lul = p3d->get_param_y(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT);
enable_ang = p3d->get_flag_y(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT);
enable_lin = p3d->get_flag_y(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT);
- a1 = 2;
- a2 = 0;
- a3 = 1;
+
+ a1 = 1;
+ a2 = 2;
+ a3 = 0;
break;
case 2:
ll = p3d->get_param_z(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT);
ul = p3d->get_param_z(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT);
- lll = -p3d->get_param_z(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT);
- lul = -p3d->get_param_z(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT);
+ lll = p3d->get_param_z(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT);
+ lul = p3d->get_param_z(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT);
enable_ang = p3d->get_flag_z(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT);
enable_lin = p3d->get_flag_z(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT);
- a1 = 1;
- a2 = 2;
- a3 = 0;
+ a1 = 2;
+ a2 = 0;
+ a3 = 1;
break;
}
@@ -3190,7 +3191,7 @@ void Generic6DOFJointSpatialGizmo::redraw() {
what = v; \
}
- if (enable_lin && lll >= lul) {
+ if (enable_lin && lll <= lul) {
ADD_VTX(lul, 0, 0);
ADD_VTX(lll, 0, 0);