mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-15 06:01:50 +08:00
Increased 3D connexion translation speed maximum to 30 (#3385)
This commit is contained in:
parent
83fb066c64
commit
4c89a9ed43
@ -375,7 +375,7 @@ void Mouse3DController::load_config(const AppConfig &appconfig)
|
|||||||
appconfig.get_mouse_device_swap_yz(device_name, swap_yz);
|
appconfig.get_mouse_device_swap_yz(device_name, swap_yz);
|
||||||
// clamp to valid values
|
// clamp to valid values
|
||||||
Params params;
|
Params params;
|
||||||
params.translation.scale = Params::DefaultTranslationScale * std::clamp(translation_speed, 0.1, 10.0);
|
params.translation.scale = Params::DefaultTranslationScale * std::clamp(translation_speed, Params::MinTranslationScale, Params::MaxTranslationScale);
|
||||||
params.translation.deadzone = std::clamp(translation_deadzone, 0.0, Params::MaxTranslationDeadzone);
|
params.translation.deadzone = std::clamp(translation_deadzone, 0.0, Params::MaxTranslationDeadzone);
|
||||||
params.rotation.scale = Params::DefaultRotationScale * std::clamp(rotation_speed, 0.1f, 10.0f);
|
params.rotation.scale = Params::DefaultRotationScale * std::clamp(rotation_speed, 0.1f, 10.0f);
|
||||||
params.rotation.deadzone = std::clamp(rotation_deadzone, 0.0f, Params::MaxRotationDeadzone);
|
params.rotation.deadzone = std::clamp(rotation_deadzone, 0.0f, Params::MaxRotationDeadzone);
|
||||||
@ -469,7 +469,7 @@ void Mouse3DController::render_settings_dialog(GLCanvas3D& canvas) const
|
|||||||
imgui.text_colored(color, _L("Speed:"));
|
imgui.text_colored(color, _L("Speed:"));
|
||||||
|
|
||||||
float translation_scale = (float)params_copy.translation.scale / Params::DefaultTranslationScale;
|
float translation_scale = (float)params_copy.translation.scale / Params::DefaultTranslationScale;
|
||||||
if (imgui.slider_float(_L("Translation") + "##1", &translation_scale, 0.1f, 10.0f, "%.1f")) {
|
if (imgui.slider_float(_L("Translation") + "##1", &translation_scale, Params::MinTranslationScale, Params::MaxTranslationScale, "%.1f")) {
|
||||||
params_copy.translation.scale = Params::DefaultTranslationScale * (double)translation_scale;
|
params_copy.translation.scale = Params::DefaultTranslationScale * (double)translation_scale;
|
||||||
params_changed = true;
|
params_changed = true;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ class Mouse3DController
|
|||||||
// to copy the parameters.
|
// to copy the parameters.
|
||||||
struct Params
|
struct Params
|
||||||
{
|
{
|
||||||
|
static constexpr double MinTranslationScale = 0.1;
|
||||||
|
static constexpr double MaxTranslationScale = 30.;
|
||||||
static constexpr double DefaultTranslationScale = 2.5;
|
static constexpr double DefaultTranslationScale = 2.5;
|
||||||
static constexpr double MaxTranslationDeadzone = 0.2;
|
static constexpr double MaxTranslationDeadzone = 0.2;
|
||||||
static constexpr double DefaultTranslationDeadzone = 0.0;
|
static constexpr double DefaultTranslationDeadzone = 0.0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user