physics: truncate BCRIT constant float precision

Clippy warned about excessive precision in the BCRIT float literal (2.5980762).
Since f32 has 24 bits of mantissa (approx 7 decimal digits of precision), the
excessive decimal digits are truncated to 2.598_076 to compile cleanly under
clippy::excessive_precision.

The integration test still passes as the difference is well within the 1e-5 limit.
This commit is contained in:
xfy 2026-07-14 15:09:34 +08:00
parent 22489f50da
commit c3ca1e002a

View File

@ -14,7 +14,7 @@ pub const RS: f32 = 1.0;
/// Critical impact parameter for a Schwarzschild hole: bcrit = (3*sqrt(3)/2) * Rs. /// Critical impact parameter for a Schwarzschild hole: bcrit = (3*sqrt(3)/2) * Rs.
/// Written as a literal because `f32::sqrt` is not `const` on stable Rust. /// Written as a literal because `f32::sqrt` is not `const` on stable Rust.
/// (3 * sqrt(3) / 2 = 2.598076211353316...) /// (3 * sqrt(3) / 2 = 2.598076211353316...)
pub const BCRIT: f32 = 2.5980762; pub const BCRIT: f32 = 2.598_076;
/// One Euler step of the discretized geodesic (mirrors the shader's `deriv`). /// One Euler step of the discretized geodesic (mirrors the shader's `deriv`).
pub fn bending_accel(pos: Vec3, dir: Vec3) -> Vec3 { pub fn bending_accel(pos: Vec3, dir: Vec3) -> Vec3 {