Simon.Anderson Posted February 5, 2016 Posted February 5, 2016 Hi all, I'm trying to split my screen into 2 viewports (same camera) so I have effectively the exact same view in both viewports. I'm using WidgetSpriteViewport for this - and it's working ok in so far as it renders correctly. However, I also wan't to select objects in each viewport. Unfortunately whenever I click in the viewport the main viewport underneath the two split view receives the click and the test ray gets performed in the wrong viewport. So, when I click in one of the split viewports its not getting picked up in the right location. Does anyone know a quick and easy way of making this work? I'm trying to get the mouse click for the WidgetSpriteViewport then converting it to the large, full screen viewport but it seems quick clunky. Any help would be appreciated. Thanks, Simon
silent Posted February 5, 2016 Posted February 5, 2016 Hi Simon, Are you still using the 2013 SDK? Can we get a small reproduction sample? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Simon.Anderson Posted February 5, 2016 Author Posted February 5, 2016 yep - and again, our uniginescript code base is large and complex. simpliflying to a stand-alone scene will take time. Time I don't have unfortunately.
Simon.Anderson Posted February 8, 2016 Author Posted February 8, 2016 ok - I'll use the viewport sample as an example. In the attached picture, imagine the circled object is selectable (when clicking on it in the scene it highlights). Now, currently when clicking on the object in the top right it needs to transform the click to the main viewport - which is does not (and it shouldn't). If I use Unigine::getPlayerMouseDirection( v0, v1 ) returns start/end vectors from the top left, relative to the main viewport. What I need is a routine to get the mouse click/direction relative to the small viewport. Essentially I need Unigine::getPlayerMouseDirection to return me a vector through the middle of the screen (main viewport) whenever I click on the middle of the smaller viewport. So, I'm after a routine something like "getPlayerMouseDirectionFromViewportWidget()" or something along those lines. Does this make sense? Is there a better way of getting around this problem?
Simon.Anderson Posted February 8, 2016 Author Posted February 8, 2016 I tried attaching a picture but I keep getting the error "You are not allowed to use that image extension on this community."
silent Posted February 8, 2016 Posted February 8, 2016 Hi Simon, Unigine::getPlayerMouseDirection method is defined in <SDK>/data/core/scripts/utils.h. If I understand you correctly, you can modify that function so it will return the required values. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts