feat: add Camera Stiffness and Pivot Height settings for motion comfort

Camera Stiffness (default 20, range 5-100): controls how tightly the
camera follows the player. Higher values = less sway/lag. Users who
experience motion sickness can increase this to reduce floaty camera.

Camera Pivot Height (default 1.8, range 0-3): height of the camera
orbit point above the player's feet. Lower values reduce the
"detached/floating" feel that can cause nausea. Setting to 0 puts the
pivot at foot level (ground-locked camera).

Both settings saved to settings file and applied via sliders in the
Gameplay tab of the Settings window.
This commit is contained in:
Kelsi 2026-03-28 11:39:37 -07:00
parent 5a8ab87a78
commit 416e091498
4 changed files with 42 additions and 10 deletions

View file

@ -18447,6 +18447,24 @@ if (ImGui::Checkbox("Extended Camera Zoom", &pendingExtendedZoom)) {
}
saveSettings();
}
if (ImGui::SliderFloat("Camera Stiffness", &pendingCameraStiffness, 5.0f, 100.0f, "%.0f")) {
if (renderer) {
if (auto* cameraController = renderer->getCameraController()) {
cameraController->setCameraSmoothSpeed(pendingCameraStiffness);
}
}
saveSettings();
}
ImGui::SetItemTooltip("Higher = tighter camera with less sway. Default: 20");
if (ImGui::SliderFloat("Camera Pivot Height", &pendingPivotHeight, 0.0f, 3.0f, "%.1f")) {
if (renderer) {
if (auto* cameraController = renderer->getCameraController()) {
cameraController->setPivotHeight(pendingPivotHeight);
}
}
saveSettings();
}
ImGui::SetItemTooltip("Height of camera orbit point above feet. Lower = less detached feel. Default: 1.8");
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Allow the camera to zoom out further than normal");
@ -21294,6 +21312,8 @@ void GameScreen::saveSettings() {
out << "mouse_sensitivity=" << pendingMouseSensitivity << "\n";
out << "invert_mouse=" << (pendingInvertMouse ? 1 : 0) << "\n";
out << "extended_zoom=" << (pendingExtendedZoom ? 1 : 0) << "\n";
out << "camera_stiffness=" << pendingCameraStiffness << "\n";
out << "camera_pivot_height=" << pendingPivotHeight << "\n";
out << "fov=" << pendingFov << "\n";
// Quest tracker position/size
@ -21452,6 +21472,8 @@ void GameScreen::loadSettings() {
else if (key == "mouse_sensitivity") pendingMouseSensitivity = std::clamp(std::stof(val), 0.05f, 1.0f);
else if (key == "invert_mouse") pendingInvertMouse = (std::stoi(val) != 0);
else if (key == "extended_zoom") pendingExtendedZoom = (std::stoi(val) != 0);
else if (key == "camera_stiffness") pendingCameraStiffness = std::clamp(std::stof(val), 5.0f, 100.0f);
else if (key == "camera_pivot_height") pendingPivotHeight = std::clamp(std::stof(val), 0.0f, 3.0f);
else if (key == "fov") {
pendingFov = std::clamp(std::stof(val), 45.0f, 110.0f);
if (auto* renderer = core::Application::getInstance().getRenderer()) {