By Lawrence
5 minutes
5 minutes
Pump the Hole
The hole's mass and its horizon are two numbers in the file, set by hand to agree. We want the mass on the mouse wheel, and the horizon to follow it.
A horizon in proportion to the mass
Schwarzschild's radius, r = 2M/c², grows in step with the mass. With this game's c of 30.15, that is the mass times 0.0022, BlackHole's horizonScale:
The physics takes a new horizon at once, and only the picture eases. Each frame the drawn radius closes 1 − e^(−3·dt/τ) of the gap, a fraction built from that frame's own dt, so every frame rate draws the same curve. A fixed fraction per frame does not:
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.
$9one-time
=