RelaX Posted August 12, 2015 Share Posted August 12, 2015 Hi,I woulk like to check if a Mesh is visible before an action ist triggered. What I don't want: http://www.babylonjs-playground.com/?17 My best attempt so far is this:var underPointer = new BABYLON.PredicateCondition(mesh.actionManager, function () { return scene.pick(scene.pointerX, scene.pointerY).pickedMesh === mesh;});mesh.actionManager.registerAction(new BABYLON.SetValueAction(BABYLON.ActionManager.OnPointerOverTrigger, mesh.material, "emissiveColor", BABYLON.Color3.White(), underPointer));And setting isPickable for everything that could be in the "way" to true.http://www.babylonjs-playground.com/#2DKQZC It doesn't look great, because the cursor ist still changing and it's not working correct when the condition fails and you move the pointer over the mesh to a position with true condition, because the trigger won't fire again. Is there no better way to do this? brgds Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 12, 2015 Share Posted August 12, 2015 Could you try to simplify your playground. It is not obvious what you want to achieve Quote Link to comment Share on other sites More sharing options...
RelaX Posted August 13, 2015 Author Share Posted August 13, 2015 There you go:http://www.babylonjs-playground.com/#2DKQZC#1 I just don't want the pointerOver action to be triggered when the mesh isn't the first mesh under the pointer. Quote Link to comment Share on other sites More sharing options...
iiceman Posted August 13, 2015 Share Posted August 13, 2015 I don't have a solution but I made it even a bit more obvious: http://www.babylonjs-playground.com/#2DKQZC#2 The cursor transforms to a pointer even if you hover over the part of the mesh that is underneath the plane. I assume that RelaX only wants to transform the pointer when hovering over the top part (just like the actual action triggers work). Am I right? Quote Link to comment Share on other sites More sharing options...
RelaX Posted August 13, 2015 Author Share Posted August 13, 2015 That's one goal I would like to achieve, more important is the fact that OnPointerOverTrigger isn't triggered after it was triggered the first time, without leaving the mesh again. For better understanding:move the pointer to a position where the sphere is covered (cursor changes) now move the pointer to a position where the sphere isn't coveredSo I need a way to reset the PointerOver trigger, is that possible? And would it work without resulting in bad performance? brgds Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 13, 2015 Share Posted August 13, 2015 Ok gotcha..it is a bug I'll fix it today:) RelaX 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.