Make view bobbing amount configurable
authorPerttu Ahola <celeron55@gmail.com>
Sat, 15 Oct 2011 13:32:24 +0000 (16:32 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 15 Oct 2011 13:32:24 +0000 (16:32 +0300)
minetest.conf.example
src/camera.cpp
src/defaultsettings.cpp

index 13015825418cdd0b850c2cc9198214fe3f91f318..440a26903c81dc500cf29d7a3c44a602ee5f3592 100644 (file)
@@ -103,6 +103,8 @@ screenH# = 600
 #invisible_stone = false
 # Path for screenshots
 #screenshot_path = .
+# Amount of view bobbing (0 = no view bobbing, 1.0 = normal, 2.0 = double)
+#view_bobbing_amount = 1.0
 
 #
 # Server stuff
index 6fc7c16cd81a09513082dbd63db0ce56ca801a2a..634a7cc9f7f63eb5ab3023e454a11a9ca1e071ba 100644 (file)
@@ -221,6 +221,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize)
                //rel_cam_target += 0.03 * bobvec;
                //rel_cam_up.rotateXYBy(0.02 * bobdir * bobtmp * PI);
                float f = 1.0;
+               f *= g_settings->getFloat("view_bobbing_amount");
                rel_cam_pos += bobvec * f;
                //rel_cam_target += 0.995 * bobvec * f;
                rel_cam_target += bobvec * f;
index 2f4147a99c7b97966d412ff61894b9fcd1dddc83..be787dd6bbc77da0cb3d0a444a058ec6d5455578 100644 (file)
@@ -74,6 +74,7 @@ void set_default_settings(Settings *settings)
        settings->setDefault("enable_clouds", "true");
        settings->setDefault("invisible_stone", "false");
        settings->setDefault("screenshot_path", ".");
+       settings->setDefault("view_bobbing_amount", "1.0");
 
        // Server stuff
        // "map-dir" doesn't exist by default.