Reimplemented distance attenuation formula.