I would like to set a triangle predicate to be used for picking in ActionManager triggers like ActionManager.OnPickTrigger.
I know this is possible for pointer movement triggers with scene.pointerMoveTrianglePredicate. But I could not find anything similar for picking triggers, neither in the documentation nor in Babylons source.
Here is a playground to show the problem:
Hovering over the top half of the sphere shows an overlay. scene.pointerMoveTrianglePredicate is used here.
Clicking on the sphere changes the overlay color. However, I want this action to also use the triangle predicate.
PointerDragBehaviour also doesn’t seem to support triangle predicates.
Any ideas, how to accomplish this, without getting rid of the ActionManager/PointerDragBehaviour and converting everything to use scene.onPointerObservable with manual scene.pick calls? This would mean huge changes to the code base, I’m working on.
Hey, thanks for the welcome and the reply.
You’re solution works well for the example in the playground. Though, my actual use case would be picking through culled backfaces, by calculating the triangle normal. So the picking point is not enough.
Would a new member scene.pointerPickTrianglePredicate, which is used for ActionManagers and Behaviours, be a good feature request, maybe? I don’t seem to be the only one missing this functionality (How to Configure Scene.pick Predicate for All Picking Events?).