I currently have SceneCaptureComponent2D rendering to a texture that I'm using in a UMG widget. I want to deproject mouse clicks on that UMG widget to the 3D space in front of the SceneCaptureComponent2D. I've dug around the source to see if there's anything that I can use, but I couldn't quite find anything useful. And, unfortunately, I'm still trying to wrap my head around the math needed to make it work.
Answering my own question. This is what I did. (It involves editing UE4 source.)
First, I added two variables to USceneCaptureComponent.
Then I populate those two variables at the end of FScene::CreateSceneRenderer (in SceneCaptureRendering.cpp)
With that in place, I can use the above and take the screen position of the click event (or whatever) and call FSceneView::DeprojectScreenToWorld.
That's it. It should return an origin and direction normal for your tracing needs.
answered Apr 19 '16 at 02:52 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here