Jump to content

ActionManager and Multiple Viewports


ChrisR
 Share

Recommended Posts

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! :) 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...