onDoubleTap method
void
onDoubleTap(
- dynamic event
Implementation
void onDoubleTap(event) {
if (enabled && enablePan && scene != null) {
dispatchEvent(_startEvent);
setCenter(event.clientX, event.clientY);
final hitP = unprojectOnObj(
getCursorNDC(_center.x, _center.y),
camera);
if (hitP != null && enableAnimations) {
final self = this;
if (_animationId != -1) {
cancelAnimationFrame(_animationId);
}
_timeStart = -1;
_animationId = requestAnimationFrame((t) {
self.updateTbState(State2.animationFocus, true);
self.onFocusAnim(
t, hitP, self._cameraMatrixState, self._gizmoMatrixState);
});
} else if (hitP != null && !enableAnimations) {
updateTbState(State2.focus, true);
focus(hitP, scaleFactor);
updateTbState(State2.idle, false);
dispatchEvent(_changeEvent);
}
}
dispatchEvent(_endEvent);
}