It would be quite difficult to add all the necessary checks to avoid recalculating the world matrix during a drag-and-drop operation…
Since we usually move the mouse during such an operation, I think it is acceptable to simply recalculate the matrix each time, even when the mouse stops moving.
Seems like it would be this line of code, I guess needMatrixUpdate is always true when grabbing?
But i generally agree that the optimization might not be worth the potential side effects, if it causes lag in a scene while not moving its causing lag while moving as well and developers should be optimizing their scene around that first anyways.
However, equalsWithEpsilon makes me uncomfortable (and using equals doesn’t work), because depending on the value of epsilon, you won’t get the same result (the drag will stop more or less quickly)… Furthermore, this would constitute a breaking change, even if minor, unless we add an “epsilon” parameter to the PointerDragBehavior class and set the default value to 0…
For this reason, I think it’s better to let the user decide if they want to override the validateDrag method, but I may be a little too conservative, so let’s see what @sebavan or @amoebachant think.