its a tragedy, but you have to look at the bigger picture.
cop knew that he already has shot at 3 cops at one time, officer knew there is a gun in the vehicle. so if i know the offender to already be violent and theres a gun in the car...at that point i would be thinking there is a high possibilty that there is another gun in car or on person. so when he tries to get out of the car when he's obviously being told to put his hands up, the officer is more than likely spooked about the suspect pulling a gun out of his waistband to try to harm him.
it comes down to the fact that police officers will ALWAYS 100% take your life if they think you are an immediate hazard to their health. they are trained to shoot to kill.
if suspect does what he is told and then not obviously ignore an officers orders and try to get out of the car when the officer knows his past and there is at least one firearm present.....then the guy would still be walking among us.