cellGem: expose rotation cone to settings

This commit is contained in:
Megamouse 2024-12-18 00:11:59 +01:00
parent f3ef4f3658
commit e18ae5abd6
5 changed files with 7 additions and 3 deletions

View File

@ -956,9 +956,9 @@ static inline void pos_to_gem_state(u32 gem_num, gem_config::gem_controller& con
static constexpr f32 PI = 3.14159265f;
const auto degree_to_rad = [](f32 degree) -> f32 { return degree * PI / 180.0f; };
static constexpr f32 CONE = 10.0f / 2.0f;
const f32 roll = -degree_to_rad((image_y - half_height) / half_height * CONE); // This is actually the pitch
const f32 pitch = -degree_to_rad((image_x - half_width) / half_width * CONE); // This is actually the yaw
const f32 max_angle_per_side = g_cfg.io.fake_move_rotation_cone / 2.0f;
const f32 roll = -degree_to_rad((image_y - half_height) / half_height * max_angle_per_side); // This is actually the pitch
const f32 pitch = -degree_to_rad((image_x - half_width) / half_width * max_angle_per_side); // This is actually the yaw
const f32 yaw = degree_to_rad(0.0f);
const f32 cr = std::cos(roll * 0.5f);
const f32 sr = std::sin(roll * 0.5f);

View File

@ -83,6 +83,7 @@ namespace rsx
add_dropdown(&g_cfg.io.pad_mode, localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_MODE);
add_unsigned_slider(&g_cfg.io.pad_sleep, localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_SLEEP, " µs", 100);
add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE, "°", 1);
apply_layout();
}

View File

@ -223,6 +223,7 @@ enum class localized_string_id
HOME_MENU_SETTINGS_INPUT_CAMERA_FLIP,
HOME_MENU_SETTINGS_INPUT_PAD_MODE,
HOME_MENU_SETTINGS_INPUT_PAD_SLEEP,
HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE,
HOME_MENU_SETTINGS_ADVANCED,
HOME_MENU_SETTINGS_ADVANCED_PREFERRED_SPU_THREADS,
HOME_MENU_SETTINGS_ADVANCED_MAX_CPU_PREEMPTIONS,

View File

@ -283,6 +283,7 @@ struct cfg_root : cfg::node
cfg::string midi_devices{this, "Emulated Midi devices", "ßßß@@@ßßß@@@ßßß@@@"};
cfg::_bool load_sdl_mappings{ this, "Load SDL GameController Mappings", true };
cfg::_bool debug_overlay{ this, "IO Debug overlay", false, true };
cfg::uint<1, 180> fake_move_rotation_cone{ this, "Fake Move Rotation Cone", 10, true };
} io{ this };

View File

@ -244,6 +244,7 @@ private:
case localized_string_id::HOME_MENU_SETTINGS_INPUT_CAMERA_FLIP: return tr("Camera Flip", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_MODE: return tr("Pad Handler Mode", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_SLEEP: return tr("Pad Handler Sleep", "Input");
case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE: return tr("Fake PS Move Rotation Cone", "Input");
case localized_string_id::HOME_MENU_SETTINGS_ADVANCED: return tr("Advanced");
case localized_string_id::HOME_MENU_SETTINGS_ADVANCED_PREFERRED_SPU_THREADS: return tr("Preferred SPU Threads", "Advanced");
case localized_string_id::HOME_MENU_SETTINGS_ADVANCED_MAX_CPU_PREEMPTIONS: return tr("Max Power Saving CPU-Preemptions", "Advanced");