Shouldn't this be `terrainHeight` since `terrain.height` could be `NaN`