System.register(["cc"], function (_export, _context) {
  "use strict";

  var _cclegacy, _decorator, Component, Node, RigidBody, v3, _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _temp, _crd, ccclass, property, test;

  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }

  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }

  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }

  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      Component = _cc.Component;
      Node = _cc.Node;
      RigidBody = _cc.RigidBody;
      v3 = _cc.v3;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "00fffXwTfpNIbxuoyxJZyT9", "test", undefined);

      ccclass = _decorator.ccclass;
      property = _decorator.property;

      _export("test", test = (_dec = ccclass('test'), _dec2 = property({
        type: Node,
        tooltip: '触摸节点'
      }), _dec3 = property({
        type: Node,
        tooltip: '球'
      }), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function (_Component) {
        _inheritsLoose(test, _Component);

        function test() {
          var _this;

          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }

          _this = _Component.call.apply(_Component, [this].concat(args)) || this;

          _initializerDefineProperty(_assertThisInitialized(_this), "touch_node", _descriptor, _assertThisInitialized(_this));

          _initializerDefineProperty(_assertThisInitialized(_this), "qiu", _descriptor2, _assertThisInitialized(_this));

          _defineProperty(_assertThisInitialized(_this), "start_pos", null);

          _defineProperty(_assertThisInitialized(_this), "set_touch", null);

          _defineProperty(_assertThisInitialized(_this), "touch_id", -1);

          return _this;
        }

        var _proto = test.prototype;

        _proto.start = function start() {
          this.touch_node.on(Node.EventType.TOUCH_START, this.on, this);
          this.touch_node.on(Node.EventType.TOUCH_MOVE, this.move, this);
          this.touch_node.on(Node.EventType.TOUCH_END, this.up, this);
          this.touch_node.on(Node.EventType.TOUCH_CANCEL, this.up, this);
          var wuli = this.qiu.getComponent(RigidBody);
          wuli.useCCD = true;
        };

        _proto.on = function on(touch, event) {
          if (this.start_pos) {
            return;
          }

          this.touch_id = touch.getID();
          this.start_pos = touch.getLocation();
        };

        _proto.move = function move(touch, event) {
          if (touch.getID() != this.touch_id) {
            return;
          } // let pos = touch.getLocation();
          // let dir = pos.subtract(this.start_pos).normalize();
          // let angle = dir.signAngle(v2(1, 0));
          // //将弧度转换为欧拉角
          // let degree = angle / Math.PI * 180;
          // this.gan_parent.setRotationFromEuler(-degree, 0, 0);

        };

        _proto.up = function up(touch, event) {
          if (touch.getID() != this.touch_id) {
            return;
          } //旧版，直接对球施加力


          var pos = touch.getLocation();
          var liliang = 10000;
          var wuli = this.qiu.getComponent(RigidBody);
          wuli.applyForce(v3(0, 0, -liliang)); //初始化

          this.touch_id = -1;
          this.start_pos = null;
        };

        _proto.update = function update(deltaTime) {};

        return test;
      }(Component), _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "touch_node", [_dec2], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return null;
        }
      }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "qiu", [_dec3], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return null;
        }
      })), _class2)) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=test.js.map