Refactor recalculating camera direction into its own function