pointerDown method

dynamic pointerDown(
  1. Pointer pointer
)

Implementation

pointerDown(Pointer pointer) {
  _pointer0 = pointer;

  if (object == null || dragging == true || pointer.button != 1) return;

  if (axis != null) {
    _raycaster.setFromCamera(Vector2(pointer.x, pointer.y), camera);

    var planeIntersect = intersectObjectWithRay(_plane, _raycaster, true);

    if (planeIntersect != null && planeIntersect != false) {
      object.updateMatrixWorld(false);
      object.parent.updateMatrixWorld(false);

      _positionStart.copy(object.position);
      _quaternionStart.copy(object.quaternion);
      _scaleStart.copy(object.scale);

      object.matrixWorld.decompose(worldPositionStart, worldQuaternionStart, _worldScaleStart);

      pointStart.copy(planeIntersect.point).sub(worldPositionStart);
    }

    dragging = true;
    _mouseDownEvent.mode = mode;
    dispatchEvent(_mouseDownEvent);
  }
}