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

@ -192,8 +192,16 @@ private:
static constexpr float MAX_DISTANCE_INTERIOR = 12.0f; // Max zoom inside WMOs
bool extendedZoom_ = false;
static constexpr float ZOOM_SMOOTH_SPEED = 15.0f; // How fast zoom eases
static constexpr float CAM_SMOOTH_SPEED = 20.0f; // How fast camera position smooths
static constexpr float PIVOT_HEIGHT = 1.8f; // Pivot at head height
static constexpr float CAM_SMOOTH_SPEED_DEFAULT = 20.0f;
float camSmoothSpeed_ = CAM_SMOOTH_SPEED_DEFAULT; // User-configurable camera smoothing (higher = tighter)
public:
void setCameraSmoothSpeed(float speed) { camSmoothSpeed_ = std::clamp(speed, 5.0f, 100.0f); }
float getCameraSmoothSpeed() const { return camSmoothSpeed_; }
void setPivotHeight(float h) { pivotHeight_ = std::clamp(h, 0.0f, 3.0f); }
float getPivotHeight() const { return pivotHeight_; }
private:
static constexpr float PIVOT_HEIGHT_DEFAULT = 1.8f;
float pivotHeight_ = PIVOT_HEIGHT_DEFAULT; // User-configurable pivot height
static constexpr float CAM_SPHERE_RADIUS = 0.32f; // Keep camera farther from geometry to avoid clipping-through surfaces
static constexpr float CAM_EPSILON = 0.22f; // Extra wall offset to avoid near-plane clipping artifacts
static constexpr float COLLISION_FOCUS_RADIUS_THIRD_PERSON = 20.0f; // Reduced for performance