]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use M_PI_2 constant instead of PI / 2
authorotta8634 <k9wolf@pm.me>
Thu, 5 Dec 2024 13:17:48 +0000 (21:17 +0800)
committerotta8634 <k9wolf@pm.me>
Thu, 5 Dec 2024 13:17:48 +0000 (21:17 +0800)
qcsrc/client/hud/panel/physics.qc

index de4c0813ab81baa20a22e6a74848e552a2f04070..67bbc17e7d59f08cad7f7c9b02dbfcf820a319ee 100644 (file)
@@ -188,7 +188,7 @@ void HUD_Physics()
                        prev_vel_z = vel_phys.z;
                        prev_speed2d = speed2d;
                        float time_frac = (time - jump_speed_time) / max(1, autocvar_hud_panel_physics_jumpspeed_time);
-                       jump_speed_f = time_frac > 1 ? 0 : cos(time_frac * PI / 2);
+                       jump_speed_f = time_frac > 1 ? 0 : cos(time_frac * M_PI_2);
                }
        }
 
@@ -216,7 +216,7 @@ void HUD_Physics()
                        else
                        {
                                float time_frac = (time - top_speed_time) / max(1, autocvar_hud_panel_physics_topspeed_time);
-                               top_speed_f = time_frac > 1 ? 0 : cos(time_frac * PI / 2);
+                               top_speed_f = time_frac > 1 ? 0 : cos(time_frac * M_PI_2);
                        }
                }
                // topspeed progressbar peak