]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a cvar to allow disabling the averaging method used for calculating acceleration
authorterencehill <piuntn@gmail.com>
Fri, 19 Jun 2015 20:47:07 +0000 (22:47 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 21 Jun 2015 14:30:56 +0000 (16:30 +0200)
_hud_common.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc

index 5aa1bbfeea3203469aedb2a4b248d08951d12617..8558e84be1e83068f4fd848dad781e0d46d17fb3 100644 (file)
@@ -38,6 +38,8 @@ seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averag
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "threshold for fps change when to update instantly, to make big fps changes update faster"
 
+seta hud_panel_physics_acceleration_movingaverage 1 "use an averaging method for calculating acceleration instead of the real value"
+
 // hud panel aliases
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
 alias +hud_panel_radar_maximized "cl_cmd hud radar 1"
index e35bf82dd2759122afc2cf11d46707ef5fc1177b..f28bc552c49356f1e7320f836a406372937a4ac7 100644 (file)
@@ -282,6 +282,7 @@ float autocvar_hud_panel_notify_fontsize;
 float autocvar_hud_panel_notify_time;
 float autocvar_hud_panel_notify_icon_aspect;
 bool autocvar_hud_panel_physics;
+float autocvar_hud_panel_physics_acceleration_movingaverage = 1;
 float autocvar_hud_panel_physics_acceleration_progressbar_mode;
 float autocvar_hud_panel_physics_acceleration_progressbar_scale;
 float autocvar_hud_panel_physics_acceleration_progressbar_nonlinear;
index 2f828e27f4de2c6d61963db98bb6a5401ebcb641..0d7dce3f56eaf0492d47f389f8a256dc92fb9557 100644 (file)
@@ -3996,9 +3996,12 @@ void HUD_Physics(void)
                acc_prevspeed = vel;
                acc_prevtime = time;
 
-               f = bound(0, f * 10, 1);
-               acc_avg = acc_avg * (1 - f) + acceleration * f;
-               acceleration = acc_avg;
+               if(autocvar_hud_panel_physics_acceleration_movingaverage)
+               {
+                       f = bound(0, f * 10, 1);
+                       acc_avg = acc_avg * (1 - f) + acceleration * f;
+                       acceleration = acc_avg;
+               }
        }
 
        //compute layout