I try to combine my beloved PointerDragBehavoir and GizmoManager but struggle with some issues:
- I want to pick/drag only specific elements or through ‘walls’, so I think a ‘predicate’ function would do the job…
But I found no way to implement such behavoir in PointerDragBehavoirs…so I decided to use the scene.pickWithRay(). PointerDragBehavoirs theirself seems not to provide any way to assign/modify the ray/picking behavoir. The same goes for the GizmoManger, which uses a PointerDragBehavoir internally (source: Use Gizmos (eg. Drag arrow, Bounding box) - Babylon.js Documentation).
- I want the GizmoManger to attach specific Meshes through walls…
It is possible to use gizmoManager.attachableMeshes but the gizmoManager.usePointerToAttachGizmos still will not work through walls.
To summarize it would be nice if I could:
- modify the rayPicking methods in the PointerDragBehavoir
- modify the PointerDragBehavoir in the GizmoManger
Here an example PlayGround where I testet a crappy workaround:
I mean if this is the right way to do it…ok, but with GizmoManger and PointerDragBehavoir…we have everything there, just need a bit more flexibility to prevent redundant code…
It worked all nice until I noticed, that I need to pick some stuff through walls (and do not want the wall to be picked/dragged/or a gizmo attached to…
Here a bonus Playground which shows you how easy you can use PointerDragBehavoirs for Dragging: