I separated the logic to generate the ray direction in Modern UI from the logic to generate the ray direction in Classic UI. Modern UI is still using y-shearing but doesn't depend on window dimensions or mouse position in window.
I separated the logic to generate the ray direction in Modern UI from the logic to generate the ray direction in Classic UI. Modern UI is still using y-shearing but doesn't depend on window dimensions or mouse position in window.

Ideally we would want to use player.getDirection() but the direction that gives doesn't agree with what we see on-screen right now.

afritz1/OpenTESArena