From 36747794ab981e5d1cc085075979ef981e783b55 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 23 Apr 2013 23:19:36 +0300 Subject: [PATCH] Disable fall bobbing by default; enable using fall_bobbing_amount = 1.0 --- minetest.conf.example | 2 ++ src/camera.cpp | 2 ++ src/defaultsettings.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/minetest.conf.example b/minetest.conf.example index 838987c33..36ef31459 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -136,6 +136,8 @@ #screenshot_path = . # Amount of view bobbing (0 = no view bobbing, 1.0 = normal, 2.0 = double) #view_bobbing_amount = 1.0 +# Amount of fall bobbing (0 = no fall bobbing, 1.0 = normal, 2.0 = double) +#fall_bobbing_amount = 0.0 # Anaglyph stereo #anaglyph = false #anaglyph_strength = 0.1 diff --git a/src/camera.cpp b/src/camera.cpp index 211ecfd70..6224a2b8e 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -263,6 +263,8 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize, fall_bobbing = sin(fall_bobbing * 0.5 * M_PI) * -1; // Amplify according to the intensity of the impact fall_bobbing *= (1 - rangelim(50 / player->camera_impact, 0, 1)) * 5; + + fall_bobbing *= g_settings->getFloat("fall_bobbing_amount"); } // Set head node transformation diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 9875c6ecb..09ec45697 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -107,6 +107,7 @@ void set_default_settings(Settings *settings) settings->setDefault("enable_clouds", "true"); settings->setDefault("screenshot_path", "."); settings->setDefault("view_bobbing_amount", "1.0"); + settings->setDefault("fall_bobbing_amount", "0.0"); settings->setDefault("enable_3d_clouds", "true"); settings->setDefault("cloud_height", "120"); settings->setDefault("menu_clouds", "true"); -- 2.25.1