Classic Doom character direction

Hello devs!

I’m trying to figure out how to check where the character is facing and where the camera is facing. It’s kinda complicated to explain but heres a video of that happening in doom classic. (it does the same thing inside RooM)