You can use the camera.getDirection() function:
camera.getDirection()
https://www.babylonjs-playground.com/#IA7LXQ#2