mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Expect the orb's float air drag in the flowing-water test
ExperienceOrb.tick multiplies by 0.98F, so the velocity after one tick is 0.014 * 0.99 * (double) 0.98F, about 2.6e-10 away from the double 0.98. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f975439f55
commit
d6bb00a14d
1 file changed
+3
-2
@@ -378,9 +378,10 @@ mod tests {
|
||||
None,
|
||||
&fluids,
|
||||
));
|
||||
// Current pushes the orb, underwater drag damps before motion, then air drag (0.98).
|
||||
// Current pushes the orb, underwater drag damps before motion, then air
|
||||
// drag: `ExperienceOrb.tick`'s `0.98F`, a float widened to double.
|
||||
assert!((carried.position.x - at.x - 0.014 * 0.99).abs() < 1e-12);
|
||||
assert!((carried.velocity.x - (0.014 * 0.99 * 0.98)).abs() < 1e-12);
|
||||
assert!((carried.velocity.x - 0.014 * 0.99 * f64::from(0.98_f32)).abs() < 1e-12);
|
||||
for _ in 0..20 {
|
||||
carried.tick(
|
||||
&world,
|
||||
|
||||
Reference in new issue
Block a user