createCraterInTerrain and all four flattenTerrain loops calculate iMin.y, then ignore it and start at j = 0. The shape checks reject those rows, so the terrain result is correct, but the wasted work increases with the object's Y position.
Reproduction:
- Spawn
BlastCraterGenerator at a high Y coordinate.
- Profile
createCraterInTerrain.
- It scans each column from row 0 instead of
iMin.y.
createCraterInTerrainand all fourflattenTerrainloops calculateiMin.y, then ignore it and start atj = 0. The shape checks reject those rows, so the terrain result is correct, but the wasted work increases with the object's Y position.Reproduction:
BlastCraterGeneratorat a high Y coordinate.createCraterInTerrain.iMin.y.