diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/spatial_editor_gizmos.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 43010ed985..f785b3e198 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -2971,10 +2971,10 @@ void SliderJointSpatialGizmo::redraw() { float ll = p3d->get_param(SliderJoint::PARAM_ANGULAR_LIMIT_LOWER); float ul = p3d->get_param(SliderJoint::PARAM_ANGULAR_LIMIT_UPPER); - float lll = -p3d->get_param(SliderJoint::PARAM_LINEAR_LIMIT_LOWER); - float lul = -p3d->get_param(SliderJoint::PARAM_LINEAR_LIMIT_UPPER); + float lll = p3d->get_param(SliderJoint::PARAM_LINEAR_LIMIT_LOWER); + float lul = p3d->get_param(SliderJoint::PARAM_LINEAR_LIMIT_UPPER); - if (lll > lul) { + if (lll <= lul) { cursor_points.push_back(Vector3(lul, 0, 0)); cursor_points.push_back(Vector3(lll, 0, 0)); @@ -3167,8 +3167,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; @@ -3178,25 +3178,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; } @@ -3218,7 +3219,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); |