Hello, I’m trying to “cancel” a drag on AxisDragGizmo, and I would like to use the validateDrag handler to it, as it is working very well on PointerDragBehavior. But on AxisDragGizmo it seems not to be fired. Is it a bug of the library or am I doing something wrong?
A repro in the playground would be amazingly helpful as it is hard to tell from the description only.
Here we are
As you see the validateDrag is not raised at all
Thanks a lot @Cedric will be able to have a look into it next week
I think I can plug
validateDrag in AxisDragGizmo, let me check …
Thank you very much!
I’ve updated to the new version, and I see now the validateDrag is being called. But I you can see on this example
the way I set up the X and Y drag gizmos is not working as expected, the collision is still happening in some way, it’s no precise as I expeted to. Could you help me understand what I’m doing wrong?
I’ll be taking a look on monday
It seems to work, sphere is colliding fine.
What shall I check?
Try to collide it from the X axis
X or Y axis works the same. Calling
moveWithCollisions will slide the sphere. If both spheres are perfectly aligned, a sliding vector is not found and sphere doesn’t move. If you want to prevent sphere from moving (ie, no sliding), then check sphere collision and return false if colliding.
By checking the distance between both sphere, you can verify is the validation is true.
I understood more or less what you’re saying, can you be so kind to change my example to let me understand better how to avoid `moveWithCollisions’ in order to decide if I have to return true or false on validateDrag? It would be very helpful, thank you again for your kindness
Sure, did you check this PG:
What is missing for you in this example?
Sorry, I didn’t understand you changed it! thank you!!!