Allah says:
فَإِنْ خِفْتُمْ فَرِجَالًا أَوْ رُكْبَانًا
Translation: If you fear, then pray on foot or mounted.
The duty to pray remains while its form can be adjusted to danger. The departure from facing the qiblah is conditioned by inability, not convenience.