Kesshi Posted February 27, 2016 Author Share Posted February 27, 2016 14 hours ago, satguru said: I like the idea of predicate but I wonder if it should be at the action level rather than at the scene level. I think its enough to have it at scene level. Its up to you how complex you make the predicate. If you want to check if a specific action is attached to a mesh you can do that. Having it at action level also can create conflicts. Lets say a mesh has two actions. Action one says "pick it" and action two says "don't pick it". Quote Link to comment Share on other sites More sharing options...
satguru Posted February 28, 2016 Share Posted February 28, 2016 @Kesshi At scene level the predicate becomes applicable to all actions and all mesh That may or may not be desirable. If different actions need different pick result then the predicate will have to figure out which action called it and return appropriate result. Now there is one case where setting predicate at scene level does help. scene has "onPonterDown", "onPointertUp" and so on functions For these the predicate like "pointerDonwPredicate" , "pointerUpPredicate" makes perfect sense. BUT ! @Deltakosh There is an issue with the current predicate implementation Currently the "isPickable " property is completely ignored. I think it should only be ignored if the predicate is not set The behavior should be like that of scene.pick() function. One of my app uses "scene.onPointerDown". It stopped working when i downloaded the latest dist. Had me scratching me head for sometime before I realized what happened.. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 28, 2016 Share Posted February 28, 2016 It was a bug I fixed 5 minutes ago can you try again? Quote Link to comment Share on other sites More sharing options...
satguru Posted February 28, 2016 Share Posted February 28, 2016 yep, works fine now. The predicate and "isPickable" also works as expected Quote Link to comment Share on other sites More sharing options...
Buho Posted February 29, 2016 Share Posted February 29, 2016 In the example the red block "click" cursor bleeds through the grey little box when they are lined up but the cursor returns to normal pointer when they are not, how can you prevent this? Thank You, Quote Link to comment Share on other sites More sharing options...
Kesshi Posted March 1, 2016 Author Share Posted March 1, 2016 @Buho which example do you mean? After the bugfix from Deltacosh my example (http://www.babylonjs-playground.com/#1XJSAN) is working correctly. I don't even need to use the new predicate. The cursor is correct in my example because of line 33 (scene.constantlyUpdateMeshUnderPointer = true;) Quote Link to comment Share on other sites More sharing options...
Buho Posted March 1, 2016 Share Posted March 1, 2016 Kesshi, K I see that now, thanks I definitely missed that. 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.