ChrisR Posted January 21, 2016 Share Posted January 21, 2016 Hi guys, Trying to get action manager to work with multiple view ports. I am having an issue, that seems to be closely related to this question asked almost 2 years ago. (http://www.html5gamedevs.com/topic/5973-multiple-viewport-issues/) Take a look at my playground: http://www.babylonjs-playground.com/#1QXZAA#4 You will see what i am trying to do. Get the actionmanger to fire when mouse moves over the sphere. Code works well if you get rid of view ports. It doesn't work on its own (the hit test is far off in the distance) I have put an option2 in there, that works great. But it registers a camera to a pick test every frame. And this is my problem. Constantly running a registerBeforeRender pick test on an object every frame for what could be over 100 different objects in my application. This seems less than optimal. Or does actionmanager just basically run every frame as well so there is 0 difference in speed/resources? Regardless, I would still like to use actionmanager as its cleaner code, and on top of that it is simple to remove the actionmanager by just removing an object, rather than having to unregisterBeforeRender every object when it is removed. Thoughts? Thanks! Quote Link to comment Share on other sites More sharing options...
ChrisR Posted January 21, 2016 Author Share Posted January 21, 2016 To add on, i just noticed that if i register my main camera as the last active camera the hit test works! But now the camera viewport overlays my bottom left viewport, Which i don't want. http://www.babylonjs-playground.com/#1QXZAA#5 Move the camera so that the ground and sphere overlay the bottom left corner viewports to see what i mean. The hit test is working though. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 21, 2016 Share Posted January 21, 2016 You can set scene.cameraToUseForPointers = mainCamera ChrisR 1 Quote Link to comment Share on other sites More sharing options...
ChrisR Posted January 21, 2016 Author Share Posted January 21, 2016 You're my hero again! Thanks @deltakosh ! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.