lihis Posted August 2, 2018 Share Posted August 2, 2018 Hey, with mesh it's possible to do: let check_for_reselect = function(item) { let pickInfo = scene.pick(scene.pointerX, scene.pointerY); if (!pickInfo.hit) { return false; } if (pickInfo.hit) { if (pickInfo.pickedMesh !== item) { return false; } else { return true; } } }; and run that in scene.onPointerObservable the next time a click happens to see if a mesh was repicked. I can't quite figure out how to check if a specific GUI element is going to be picked. Is that doable somehow? The use case would be something like: if GUI element is going to be reselected, do nothing otherwise run some deselect code. -> scene.pick allows you to "click without actually clicking" and see what's below mouse - i would like to do the same with GUI elements. Edit: Another question: is there a way to make onPointerDownObservable / holding mouse button down not block the processing of other observables like onPointerOutObservable? Example: https://playground.babylonjs.com/#SDJ5S8 If you start holding mousebutton down the hover does not stop even when moving outside the rectangle. In chrome the hover stops once you release mousebutton (and you are outside the rectangle), but in in Firefox you actually have to move the mouse after releasing the mouse button, otherwise it will keep the hover state forever. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 2, 2018 Share Posted August 2, 2018 Hello you have to say that the rectangle can block the pointer events (like a button) else the main scene will capture the pointer: https://playground.babylonjs.com/#SDJ5S8#1 (line #36) 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.