Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Calculate blast intensity at all locations.
We define the blast intensity as the square of the tnt_radius, divided by the square of the distance to the explosion center, where distance is limited to 1 at the lower end. When destroying nodes, we calculate the intensity for each node, and only destroy the nodes when the intensity is 1.0 or larger. To avoid perfectly spherical explosions, we make sure to retain a randomness factor of 20%. This will make explosion edges jagged and not smooth, but not too much. We pass the calculated intensity to on_blast() functions as well, except we take the jitter here out and make sure it's always 1.0 or larger.
- Loading branch information