I need to find out the location of the 3d cursor given the mouse position. That is: if the user were to click at the position (x, y) on 3d viewport, what would be the location of the 3d cursor in 3d space.
This is not the same as getting the location from calls to region_2d_to_vector_3d and region_2d_to_location_3d because the cursor location calculation also considers object locations.
This thread discusses the issue, but the question is related to 3d cursor location without any object under it. I need to find out the location when there IS an object (even an object with geometry that does not allow ray-casting).