Jump to content

Intercept observable pointer events accross GUI and Scene


SvenFrankson
 Share

Recommended Posts

Hi,

I'm currently trying to convert some input code to observer/observables.

Here's a playground : https://www.babylonjs-playground.com/#XCPP9Y#259

When clicking in the scene, the ground color is randomly changed. 

Is there a built-in way in the observable design to avoid triggering the scene pointer observer when triggering the gui pointer observer ?

(ie : the ground should not change color when the clic hits the gui button)

If not, can we pick which observer we want to be triggered first ? So we can share some data accross the observer to abort (like skipNextObserver, but on a wider scope)

If not, it seems the GUI observer is triggered first. Can we rely on this ?

Thanks a lot for your inputs ! Have a nice day,

 

Note : As well... It seems "scene pickObservable" already performs some picking in the scene. Is there a way to avoid this behaviour ? (in the case we want to do the picking with another predicate). Thanks !

 

Link to comment
Share on other sites

Hey!

So the button must block the pointer observer. It is a bug (fix will be deployed in a couple of minutes)

I do not see a pickObservable on scene but perhaps you may want to check the default predicate and change them (like scene.pointerMovePredicate or  scene.pointerDownPredicate)

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...