fix(physics): gate dynamic impulse on capture age

Match records 174/175 by transferring normal impulse only when the other slot capture age is nonpositive. A held slot now keeps its velocity and the moving ball resolves with the full normal velocity; successful transfer retains the original normal_velocity-1000 response.

Test Plan:
- cargo test --all-targets
- cargo clippy --all-targets --all-features -- -D warnings
- rumdl check CHANGELOG.md RECONSTRUCTION.md README.md
- git diff --check
This commit is contained in:
2026-08-23 19:32:23 +02:00
parent 6c879a3f91
commit 06d1010431
4 changed files with 47 additions and 13 deletions
+3
View File
@@ -749,6 +749,7 @@ impl Game {
ball.spin,
other_position,
MilliVec::from_velocity_per_second(secondary.velocity),
secondary.capture_age <= 0,
);
if predicted.x >= other_position.x.wrapping_sub(21_000)
&& predicted.x <= other_position.x.wrapping_add(21_000)
@@ -1140,6 +1141,7 @@ impl Game {
};
let primary_position = self.ball.position;
let primary_velocity = self.ball.velocity;
let primary_capture_age = self.ball.capture_age;
let old_position = MilliVec::from_position(ball.position);
let mut velocity = MilliVec::from_velocity_per_second(ball.velocity);
velocity.y += GRAVITY_MILLI_PER_STEP;
@@ -1173,6 +1175,7 @@ impl Game {
ball.spin,
other_position,
MilliVec::from_velocity_per_second(primary_velocity),
primary_capture_age <= 0,
)
&& best_collision.is_none()
{