The Gemara (Bava Metzia 62a) talks about a case where two people are traveling in the desert. One man ran out of water and the other man has just enough water for himself to make it back to town. Should the man share his water with his friend, OR; should he use all the water for himself and let his friend die while saving his own life?
Ben Petura says that he should share the water rather than save himself and witness his friend's death. Rabbi Akiva says that the Torah commands VaYikra 25:36 "...your brother shall live with you...". Therefore the man with the water saves himself since his brother's life is subordinate to his own.
The Halachah follows R' Akiva (see Tur, Yoreh Deah, 251).
Since the car is already hurtling forward, then certainly letting the car continue would be permitted, to avoid slamming into another deadly obstacle. You are not obligated to swerve and kill yourself in order to save your friend. (The man who stepped into the road, thereby blocking escape, may even be considered a "rodef". (an attacker who may be killed to save an innocent life)).
If the person about to be hit is a greater tzadik and Torah scholar, or someone who the Jewish people rely upon, or saving them will save many lives etc. there are opinions that one may sacrifice themselves to save that person (and it might even be the better choice). However, it is not an obligation. (I have seen Poskim that reject this based on a teshuvas Radbaz. Some support it based on a Yad Eliyahu, and see further.)
The Gemara in Horayos 13a says that the life of the Cohen annointed for war takes precedence. This is because the war effort depends on him.
The Gemara Ta'anis 18b (see Rashi there) praises Papus and Lolinus who falsely admitted to a murder of a princess in order to save the Jewish people from death.
Sefer Chassidim 698 rules that it is a mitzvah for an unlearned person to sacrifice himself to save a Torah scholar. (Rebbe Reuven ben Itztraboli offered to die instead of R' Akiva)
Mishneh Halachos (9:17) brings a case of a holy martyr who pretended to be the Belzer Rebbe and handed himself in to the Nazis in order to save the real Rebbe.
Rav Yaakov Emden (Migdal Oz Even HaBochein 1:85) holds that one is not allowed to sacrifice himself for love of a friend or even a son. (see Gemara Pesachim 25b..."why is his blood redder than yours?!") But he may do so for someone who he knows is a greater tzadik and Torah scholar than he is; his father or Rebbe, or one who's life certainly has much greater value. For instance, he considers if a father who is old may sacrifice himself to save a young son?
I am not clear how one would know someone else is more valuable, even in Torah or righteousness??
Rav Zilberstein did send a response to a man who wanted to take the job as a bodyguard for a high Israeli official. He was told that if he was sure the lives of many people depended on the official, then he could accept the job which involves jumping in front of him to take a potential bullet.
However, in the case of the OP, I wonder if you are allowed to sacrifice yourself if the Tzadik or official blatantly jumps in front of your car knowingly??
May we never need these answers in any practical case and continue to gain reward for learning it theoretically.
I hope this helps. :)