Effects of local density dependence on the scattering of heavy ions and alpha particles