]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge physics acceleration movingaverage cvars
authorotta8634 <k9wolf@pm.me>
Thu, 5 Dec 2024 02:22:59 +0000 (10:22 +0800)
committerotta8634 <k9wolf@pm.me>
Thu, 5 Dec 2024 02:22:59 +0000 (10:22 +0800)
Now hud_panel_physics_acceleration_movingaverage values...
- Non-positive result in acceleration updating immediately
- Closer to zero (positive) update more quickly, e.g. 0.3
- Further from zero update more slowly, e.g. 2
Having an extra _movingaverage_strength cvar didn't feel necessary
Default behaviour is still identical to prior to this commit/MR

_hud_common.cfg
qcsrc/client/hud/panel/physics.qc
qcsrc/client/hud/panel/physics.qh

index 865b7d9d8c1b9d80dd9b0cb14c1d173168139771..6692e4da04330454fb6f798094e4ca44770c3735 100644 (file)
@@ -106,8 +106,7 @@ seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_ch
 seta hud_panel_engineinfo_framecounter_decimals "0" "amount of decimals to show"
 seta hud_panel_engineinfo_framecounter_time "0.1" "time between framerate display updates"
 
-seta hud_panel_physics_acceleration_movingaverage "1" "use an averaging method for calculating acceleration instead of the real value"
-seta hud_panel_physics_acceleration_movingaverage_strength "10" "weighting given to the current value in the movingaverage averaging method"
+seta hud_panel_physics_acceleration_movingaverage "1" "use an averaging method for calculating acceleration instead of the real value. Lower (positive) values update the acceleration quicker"
 seta hud_panel_physics_acceleration_max_slick "-1" "acceleration progressbar gets completely filled up by this value (in g) while on slick, -1 = same as the normal max"
 seta hud_panel_physics_update_interval "0.015625" "how often (in seconds) numeric values get updated on screen"
 seta hud_panel_physics_jumpspeed "0" "also show jump speed, replacing the speed unit text (NOTE: ignores vertical speed)"
index 79759328fa963f63f77304dba8a2e0449ff1036c..eb87e4ffbfb84988386bb9ed8e25923193d6603c 100644 (file)
@@ -106,9 +106,9 @@ void HUD_Physics()
                acc_prev_vel  = vel_phys;
                acc_prev_time = time;
 
-               if (autocvar_hud_panel_physics_acceleration_movingaverage)
+               if (autocvar_hud_panel_physics_acceleration_movingaverage > 0)
                {
-                       f = bound(0, f * autocvar_hud_panel_physics_acceleration_movingaverage_strength, 1);
+                       f = bound(0, f * 10 / autocvar_hud_panel_physics_acceleration_movingaverage, 1);
                        acc_avg = acc_avg * (1 - f) + accel * f;
                        accel = acc_avg;
                }
index 6f647e1e104e1955286745c3ed6356609c7185db..c488f749a6bf7defc8ec71188857cd078c400c47 100644 (file)
@@ -3,7 +3,6 @@
 
 bool autocvar_hud_panel_physics;
 float autocvar_hud_panel_physics_acceleration_movingaverage = 1;
-float autocvar_hud_panel_physics_acceleration_movingaverage_strength = 10;
 float autocvar_hud_panel_physics_acceleration_progressbar_mode;
 float autocvar_hud_panel_physics_acceleration_progressbar_scale;
 float autocvar_hud_panel_physics_acceleration_progressbar_nonlinear;