seta hud_panel_strafehud_timeout_air "0.1" "time after take off before changing to air strafe physics when not jumping (visually more consistent hud while on slick downwards ramps)"
seta hud_panel_strafehud_timeout_ground "0.03333333" "time after landing before changing to non-air strafe physics (visually more consistent hud while strafe turning when touching the floor after every hop)"
seta hud_panel_strafehud_timeout_turn "0.1" "time after releasing the strafe keys before changing mode (visually more consistent hud while switching between left/right strafe turning)"
-seta hud_panel_strafehud_timeout_direction "0.5" "time it takes until direction changes (forward or backward movement) are applied"
+seta hud_panel_strafehud_timeout_direction "0.5" "time it takes until direction changes (forward or backward movement) are applied (set to zero if you intend to sideways strafe)"
seta hud_panel_strafehud_antiflicker_angle "0.01" "how many degrees from 0° to 180° the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)"
seta hud_panel_strafehud_antiflicker_speed "0.0001" "how many qu/s the hud ignores if it could cause visual disturbances otherwise (and to counter rounding errors)"
int autocvar_hud_panel_strafehud_style = 1;
vector autocvar_hud_panel_strafehud_bar_neutral_color = '1 1 1';
float autocvar_hud_panel_strafehud_bar_neutral_alpha = 0.3;
-vector autocvar_hud_panel_strafehud_bar_accel_color = '0 1 1';
+vector autocvar_hud_panel_strafehud_bar_accel_color = '0 1 0';
float autocvar_hud_panel_strafehud_bar_accel_alpha = 0.3;
vector autocvar_hud_panel_strafehud_bar_overturn_color = '1 0 1';
float autocvar_hud_panel_strafehud_bar_overturn_alpha = 0.3;
float maxspeed_phys = onground ? PHYS_MAXSPEED(strafeplayer) : PHYS_MAXAIRSPEED(strafeplayer);
float maxspeed = !autocvar__hud_configure ? maxspeed_phys * maxspeed_crouch_mod * maxspeed_water_mod : 320;
float vel_angle = vectoangles(strafeplayer.velocity).y;
- float view_angle = view_angles.y + 180;
+ float view_angle = PHYS_INPUT_ANGLES(strafeplayer).y + 180;
float angle;
vector movement = PHYS_INPUT_MOVEVALUES(strafeplayer);
int keys = STAT(PRESSED_KEYS);
}
else // simulate turning for HUD setup
{
+ fwd = true;
if(autocvar__hud_panel_strafehud_demo && ((time - demo_time) >= .025))
{
demo_time = time;
if(autocvar_hud_panel_strafehud_slickdetector_range > 0 && autocvar_hud_panel_strafehud_slickdetector_alpha > 0 && slickdetector_height > 0 && panel_size.x > 0) // dunno if slick detection works in spectate
{
float slicksteps = 90 / pow(2, bound(0, autocvar_hud_panel_strafehud_slickdetector_granularity, 4));
- vector slickoffset;
bool slickdetected = false;
slickdetected = IS_ONSLICK(strafeplayer); // don't need to traceline if already touching slick
trace_dphitq3surfaceflags = 0;
for(float i = 0; i < 360 && !slickdetected; i += slicksteps)
{
+ vector slickoffset;
float slickrotate;
slickoffset.z = -cos(i * DEG2RAD) * autocvar_hud_panel_strafehud_slickdetector_range;
slickrotate = sin(i * DEG2RAD) * autocvar_hud_panel_strafehud_slickdetector_range;
}
}
- // if one traceline hit a slick surface
+ // if a traceline hit a slick surface
if(slickdetected)
{
vector slickdetector_size = panel_size;
if(fabs(moveangle) > 90)
{
strafe_ratio = -((fabs(moveangle) - 90) / 90);
- if(strafe_ratio < -1) strafe_ratio = -1 - strafe_ratio%1;
+ if(strafe_ratio < -1) strafe_ratio = -2 - strafe_ratio;
}
else
{