The replay's close camera now finds a clear line to the ball
When the ball is stolen, stripped or charged into, the replay cuts in close so the hands can be seen. Until now the close camera always sat on the same side of the play, and every so often another player stood between it and the ball, so the frame showed a back instead of the steal. The camera now checks for that and turns round the play to a side where nothing is in the way.
Turning as little as it can
For each close-up the camera first tries the place it would have stood anyway. If no other body is near the line from the camera to the ball, it stays there, so every close-up that was already clear looks exactly as before. If someone is in the way, it tries turning round the ball by 30 degrees one way, then the other, then 60, and takes the first turn that leaves the line clear. It never turns further than that, so it stays on its own side of the court.
export function clearTurn(at, dir, bodies) {
let best = 0, room = -1;
for (const turn of TURNS) {
const r = clearance(at, dir, turn, bodies);
if (r >= CLEAR_M) return turn;
if (r > room) { best = turn; room = r; }
}
return best;
}
The players in the play itself, those within an arm's reach of the ball, never count as being in the way: they are what the shot is for. Anyone else within 0.4 metres of the line, about half a body's width, does. If every turn is blocked, the camera takes the one with the most room.
The bodies the game put there
The camera does not guess where people are. It reads where the simulation placed every player at the moment of the steal, once for each close-up, so the camera holds still while it is in close, and a paused replay, a scrub and normal play all choose the same side.
Checked on every close-up, not one
The fix was checked on every steal, strip and charge of two whole games: 18 moments, each cut to by both of the replay's cameras, so 36 close-ups. In 5 of them someone stood within about a third of a metre of the line to the ball. Those five now turn, and in each the nearest bystander is 0.7 to 1.5 metres from the line. The other 31 were already clear and did not move at all.