Computes a directional sprite index (4/6/8 dirs) based on player 3D position relative to NPC facing angle.
4 direction Sprite example