376377378379380381382383384385386
vx = state.get($vx); vy = state.get($vy); assert !Double.isNaN(vx + vy); if (x > bounds.max(X) || x < bounds.min(X)) { x = min(x, bounds.max(X)); x = max(x, bounds.min(X)); vx = -vx * SPEED_BOUNCE_DAMPING; ax = 0; }
378379380381382383384385386387388
assert !Double.isNaN(vx + vy); if (x > bounds.max(X) || x < bounds.min(X)) { x = min(x, bounds.max(X)); x = max(x, bounds.min(X)); vx = -vx * SPEED_BOUNCE_DAMPING; ax = 0; } if (y > bounds.max(Y) || y < bounds.min(Y)) { y = min(y, bounds.max(Y));
382383384385386387388389390391392
x = min(x, bounds.max(X)); x = max(x, bounds.min(X)); vx = -vx * SPEED_BOUNCE_DAMPING; ax = 0; } if (y > bounds.max(Y) || y < bounds.min(Y)) { y = min(y, bounds.max(Y)); y = max(y, bounds.min(Y)); vy = -vy * SPEED_BOUNCE_DAMPING; ay = 0; }
384385386387388389390391392393394
vx = -vx * SPEED_BOUNCE_DAMPING; ax = 0; } if (y > bounds.max(Y) || y < bounds.min(Y)) { y = min(y, bounds.max(Y)); y = max(y, bounds.min(Y)); vy = -vy * SPEED_BOUNCE_DAMPING; ay = 0; } assert !Double.isNaN(x + y);