
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_collide_system/lq_collide_system.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '81314mE3BdESr87SAFK9cqv', 'lq_collide_system');
// Script/lq_collide_system/lq_collide_system.js

/*Obfuscated by JShaman.com*/'use strict';

exports['__esModule'] = !![];
exports['LQCollideSystem'] = void 0x0;
var lq_const_1 = require('../lq_base/data/lq_const');
var lq_math_util_1 = require('../lq_base/util/lq_math_util');
var lq_collide_config_1 = require('./lq_collide_config');
var lq_data_1 = require('../lq_base/data/lq_data');
var Vec2 = cc['Vec2'];
var game = cc['game'];
var director = cc['director'];
var Scheduler = cc['Scheduler'];
var misc = cc['misc'];
var LQQuadTree = function () {
  function _0x56565e(_0x3d3a0e, _0x3fb055, _0x20ce04, _0x406033) {
    this['collide_arr'] = [];
    this['node_arr'] = [];
    this['max_object'] = _0x3fb055 || 0xa;
    this['max_level'] = _0x20ce04 || 0x4;
    this['level'] = _0x406033 || 0x0;
    this['rect'] = _0x3d3a0e;
    this['collide_arr'] = [];
    this['node_arr'] = [];
  }
  _0x56565e['prototype']['split'] = function () {
    var _0x32a9cb = this['level'] + 0x1;
    var _0x178d81 = this['rect']['width'] * 0.5;
    var _0x1d1d97 = this['rect']['height'] * 0.5;
    var _0x5f5093 = this['rect']['x'];
    var _0x3269c2 = this['rect']['y'];
    this['node_arr'][0x0] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093 + _0x178d81, _0x3269c2, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
    this['node_arr'][0x1] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093, _0x3269c2, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
    this['node_arr'][0x2] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093, _0x3269c2 + _0x1d1d97, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
    this['node_arr'][0x3] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093 + _0x178d81, _0x3269c2 + _0x1d1d97, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
  };
  _0x56565e['prototype']['get_index'] = function (_0x59d6ec) {
    var _0x1dc547 = [];
    var _0x2ea7cd = this['rect']['x'] + this['rect']['half_width'];
    var _0x5e97b7 = this['rect']['y'] + this['rect']['half_height'];
    var _0x241f59 = _0x59d6ec['world_rect']['y'] + _0x59d6ec['world_rect']['half_height'] > _0x5e97b7;
    var _0x437790 = _0x59d6ec['world_rect']['x'] - _0x59d6ec['world_rect']['half_width'] < _0x2ea7cd;
    var _0x5e6619 = _0x59d6ec['world_rect']['x'] + _0x59d6ec['world_rect']['half_width'] > _0x2ea7cd;
    var _0x3b42aa = _0x59d6ec['world_rect']['y'] - _0x59d6ec['world_rect']['half_height'] < _0x5e97b7;
    if (_0x5e6619 && _0x241f59) {
      _0x1dc547['push'](0x0);
    }
    if (_0x437790 && _0x241f59) {
      _0x1dc547['push'](0x1);
    }
    if (_0x437790 && _0x3b42aa) {
      _0x1dc547['push'](0x2);
    }
    if (_0x3b42aa && _0x5e6619) {
      _0x1dc547['push'](0x3);
    }
    return _0x1dc547;
  };
  ;
  _0x56565e['prototype']['insert'] = function (_0x32f23a) {
    var _0x3850fe;
    if (this['node_arr']['length']) {
      _0x3850fe = this['get_index'](_0x32f23a);
      for (var _0x4856cf = 0x0; _0x4856cf < _0x3850fe['length']; _0x4856cf++) {
        this['node_arr'][_0x3850fe[_0x4856cf]]['insert'](_0x32f23a);
      }
      return;
    }
    this['collide_arr']['push'](_0x32f23a);
    if (this['collide_arr']['length'] > this['max_object'] && this['level'] < this['max_level']) {
      if (!this['node_arr']['length']) {
        this['split']();
      }
      for (var _0x4856cf = 0x0; _0x4856cf < this['collide_arr']['length']; _0x4856cf++) {
        var _0x2d136c = this['collide_arr'][_0x4856cf];
        _0x3850fe = this['get_index'](_0x2d136c);
        for (var _0x1e9f35 = 0x0; _0x1e9f35 < _0x3850fe['length']; _0x1e9f35++) {
          this['node_arr'][_0x3850fe[_0x1e9f35]]['insert'](_0x2d136c);
        }
      }
      this['collide_arr'] = [];
    }
  };
  ;
  _0x56565e['prototype']['retrieve'] = function (_0x77a71) {
    var _0xaa8c7a;
    var _0x42264c = this['get_index'](_0x77a71);
    if (this['collide_arr']['length']) {
      (_0xaa8c7a = _0x56565e['temp_collide_arr'])['push']['apply'](_0xaa8c7a, this['collide_arr']);
    }
    if (this['node_arr']['length']) {
      for (var _0x4c3497 = 0x0; _0x4c3497 < _0x42264c['length']; _0x4c3497++) {
        this['node_arr'][_0x42264c[_0x4c3497]]['retrieve'](_0x77a71);
      }
    }
  };
  ;
  _0x56565e['prototype']['get_all_area'] = function () {
    if (this['collide_arr']['length']) {
      _0x56565e['all_collide_arr']['push'](this['collide_arr']);
    }
    if (this['node_arr']['length']) {
      for (var _0x3d5c9f = 0x0; _0x3d5c9f < 0x4; _0x3d5c9f++) {
        this['node_arr'][_0x3d5c9f]['get_all_area']();
      }
    }
  };
  _0x56565e['prototype']['clear'] = function () {
    this['collide_arr'] = [];
    for (var _0x170eca = 0x0; _0x170eca < this['node_arr']['length']; _0x170eca++) {
      if (this['node_arr']['length']) {
        this['node_arr'][_0x170eca]['clear']();
      }
    }
    this['node_arr'] = [];
  };
  ;
  _0x56565e['temp_collide_arr'] = [];
  _0x56565e['all_collide_arr'] = [];
  return _0x56565e;
}();
var LQCollideSystem = function () {
  function _0x9bf60e() {}
  _0x9bf60e['cache_polygon'] = function (_0xbc3d22) {
    if (_0xbc3d22['_collide_shape'] === lq_const_1['LQCollideShape']['Rect']) {
      _0xbc3d22['cache_polygon_points'] = [];
      var _0x53235e = _0xbc3d22['world_rect']['top_left']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
      _0x53235e = _0xbc3d22['world_rect']['bottom_left']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
      _0x53235e = _0xbc3d22['world_rect']['bottom_right']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
      _0x53235e = _0xbc3d22['world_rect']['top_right']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
    } else if (_0xbc3d22['_collide_shape'] === lq_const_1['LQCollideShape']['Polygon']) {
      _0xbc3d22['cache_polygon_points'] = [];
      if (_0xbc3d22['node']['angle'] == 0x0) {
        for (var _0x2f1e6c = 0x0; _0x2f1e6c < _0xbc3d22['_polygon_points']['length']; _0x2f1e6c++) {
          var _0x53235e = _0xbc3d22['world_rect']['add'](_0xbc3d22['_polygon_points'][_0x2f1e6c]);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
        }
      } else {
        var _0x1be630 = misc['degreesToRadians'](_0xbc3d22['node']['angle']);
        var _0x1a0598 = Math['sin'](_0x1be630);
        var _0x25967e = Math['cos'](_0x1be630);
        var _0xfbf241 = function _0xfbf241(_0x5ed3a5) {
          return new Vec2(_0x5ed3a5['x'] * _0x25967e - _0x5ed3a5['y'] * _0x1a0598 + _0xbc3d22['world_rect']['x'], _0x5ed3a5['x'] * _0x1a0598 + _0x5ed3a5['y'] * _0x25967e + _0xbc3d22['world_rect']['y']);
        };
        for (var _0x2f1e6c = 0x0; _0x2f1e6c < _0xbc3d22['_polygon_points']['length']; _0x2f1e6c++) {
          var _0x53235e = _0xfbf241(_0xbc3d22['_polygon_points'][_0x2f1e6c]);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
        }
      }
    }
  };
  _0x9bf60e['_updateWorldMatrix'] = function (_0x296a1a) {
    if (_0x296a1a['_parent']) {
      _0x9bf60e['_updateWorldMatrix'](_0x296a1a['_parent']);
    }
    if (_0x296a1a['_worldMatDirty']) {
      this['tmp_bool'] = !![];
      _0x296a1a['_calculWorldMatrix']();
      var _0x3d1ca2 = _0x296a1a['_children'];
      for (var _0x2b4ec9 = 0x0, _0x600367 = _0x3d1ca2['length']; _0x2b4ec9 < _0x600367; _0x2b4ec9++) {
        _0x3d1ca2[_0x2b4ec9]['_worldMatDirty'] = !![];
      }
    }
  };
  _0x9bf60e['transformMat4'] = function (_0x5d68b5, _0x2c4dd0, _0x190f88) {
    var _0x523dc8 = _0x190f88['m'];
    _0x5d68b5['x'] = _0x523dc8[0x0] * _0x2c4dd0['x'] + _0x523dc8[0x4] * _0x2c4dd0['y'] + _0x523dc8[0xc];
    _0x5d68b5['y'] = _0x523dc8[0x1] * _0x2c4dd0['x'] + _0x523dc8[0x5] * _0x2c4dd0['y'] + _0x523dc8[0xd];
    return _0x5d68b5;
  };
  _0x9bf60e['update_world_rect'] = function (_0x264b72) {
    if (!_0x264b72['world_rect']) {
      return;
    }
    this['tmp_bool'] = ![];
    this['_updateWorldMatrix'](_0x264b72['node']);
    if (this['tmp_bool']) {
      _0x264b72['cache_polygon_points'] = undefined;
    }
    _0x9bf60e['transformMat4'](_0x264b72['world_rect'], _0x264b72['_offset'], _0x264b72['node']['_worldMatrix']);
  };
  _0x9bf60e['update_collide_logic'] = function (_0x1b9a2c) {
    if (_0x1b9a2c['is_open_func']) {
      for (var _0x1d8d8c in _0x1b9a2c['collide_map']) {
        var _0x1406b5 = _0x1b9a2c['collide_map'][_0x1d8d8c];
        if (_0x1406b5['status'] === 0x1) {
          _0x1406b5['status'] = 0x2;
        } else {
          delete _0x1b9a2c['collide_map'][_0x1d8d8c];
          _0x1b9a2c['on_exit'](_0x1406b5['collide']);
        }
      }
    }
    _0x1b9a2c['update_lq_collide']();
  };
  _0x9bf60e['collide_other'] = function (_0x64f064, _0x3becdd) {
    if (_0x64f064['is_open_func']) {
      var _0x45b029 = _0x64f064['collide_map'][_0x3becdd['collide_id']];
      if (_0x45b029) {
        _0x45b029['status'] = 0x1;
      } else {
        _0x64f064['collide_map'][_0x3becdd['collide_id']] = {
          'collide': _0x3becdd,
          'status': 0x1
        };
        _0x64f064['on_enter'](_0x3becdd);
      }
    }
    if (_0x3becdd['is_open_func']) {
      var _0x544a5c = _0x3becdd['collide_map'][_0x64f064['collide_id']];
      if (_0x544a5c) {
        _0x544a5c['status'] = 0x1;
      } else {
        _0x3becdd['collide_map'][_0x64f064['collide_id']] = {
          'collide': _0x64f064,
          'status': 0x1
        };
        _0x3becdd['on_enter'](_0x64f064);
      }
    }
    _0x64f064['on_collide'](_0x3becdd);
    _0x3becdd['on_collide'](_0x64f064);
  };
  _0x9bf60e['add_collide'] = function (_0x2e897d) {
    this['update_world_rect'](_0x2e897d);
    this['collide_arr']['push'](_0x2e897d);
  };
  _0x9bf60e['remove_collide'] = function (_0x416298) {
    for (var _0x12059a = this['collide_arr']['length'] - 0x1; _0x12059a >= 0x0; _0x12059a--) {
      if (this['collide_arr'][_0x12059a]['collide_id'] === _0x416298['collide_id']) {
        this['collide_arr']['splice'](_0x12059a, 0x1);
        break;
      }
    }
  };
  _0x9bf60e['line_point'] = function (_0x4a7370, _0x24c7a1, _0x4e18ee, _0x122356, _0x2bd713, _0x2d3b6e) {
    return Math['abs'](this['distanceSquared'](_0x4a7370, _0x24c7a1, _0x4e18ee, _0x122356) - (this['distanceSquared'](_0x4a7370, _0x24c7a1, _0x2bd713, _0x2d3b6e) + this['distanceSquared'](_0x4e18ee, _0x122356, _0x2bd713, _0x2d3b6e))) <= 0x1;
  };
  _0x9bf60e['distanceSquared'] = function (_0x5cca3b, _0x11b678, _0x1f0b63, _0x52cec7) {
    return Math['sqrt'](Math['pow'](_0x5cca3b - _0x1f0b63, 0x2) + Math['pow'](_0x11b678 - _0x52cec7, 0x2));
  };
  _0x9bf60e['polygon_point'] = function (_0x4236c0, _0x12e825, _0x5cd4dd) {
    var _0xbd6fd0 = _0x4236c0['length'];
    var _0x1f4fbc = ![];
    var _0x267b58, _0x4a1bae;
    for (_0x267b58 = 0x0, _0x4a1bae = _0xbd6fd0 - 0x2; _0x267b58 < _0xbd6fd0; _0x267b58 += 0x2) {
      if (_0x4236c0[_0x267b58 + 0x1] > _0x5cd4dd !== _0x4236c0[_0x4a1bae + 0x1] > _0x5cd4dd && _0x12e825 < (_0x4236c0[_0x4a1bae] - _0x4236c0[_0x267b58]) * (_0x5cd4dd - _0x4236c0[_0x267b58 + 0x1]) / (_0x4236c0[_0x4a1bae + 0x1] - _0x4236c0[_0x267b58 + 0x1]) + _0x4236c0[_0x267b58]) {
        _0x1f4fbc = !_0x1f4fbc;
      }
      _0x4a1bae = _0x267b58;
    }
    if (_0x1f4fbc) {
      return !![];
    }
    for (_0x267b58 = 0x0; _0x267b58 < _0xbd6fd0; _0x267b58 += 0x2) {
      var _0x574e3e = _0x4236c0[_0x267b58];
      var _0x4b92d8 = _0x4236c0[_0x267b58 + 0x1];
      var _0x5d39d4 = void 0x0,
        _0x124e9c = void 0x0;
      if (_0x267b58 === _0xbd6fd0 - 0x2) {
        _0x5d39d4 = _0x4236c0[0x0];
        _0x124e9c = _0x4236c0[0x1];
      } else {
        _0x5d39d4 = _0x4236c0[_0x267b58 + 0x2];
        _0x124e9c = _0x4236c0[_0x267b58 + 0x3];
      }
      if (this['line_point'](_0x574e3e, _0x4b92d8, _0x5d39d4, _0x124e9c, _0x12e825, _0x5cd4dd)) {
        return !![];
      }
    }
    return ![];
  };
  _0x9bf60e['polygon_circle'] = function (_0x387188, _0x611012, _0x3707e8, _0x2432e1) {
    if (this['polygon_point'](_0x387188, _0x611012, _0x3707e8)) {
      return !![];
    }
    var _0x197657 = _0x387188['length'];
    for (var _0x3df6fc = 0x0; _0x3df6fc < _0x197657 - 0x2; _0x3df6fc += 0x2) {
      if (this['line_circle'](_0x387188[_0x3df6fc], _0x387188[_0x3df6fc + 0x1], _0x387188[_0x3df6fc + 0x2], _0x387188[_0x3df6fc + 0x3], _0x611012, _0x3707e8, _0x2432e1)) {
        return !![];
      }
    }
    return this['line_circle'](_0x387188[0x0], _0x387188[0x1], _0x387188[_0x197657 - 0x2], _0x387188[_0x197657 - 0x1], _0x611012, _0x3707e8, _0x2432e1);
  };
  _0x9bf60e['line_circle'] = function (_0x12bba1, _0x321290, _0x136703, _0x537e0e, _0x3ad147, _0x559a7d, _0x48a834) {
    var _0x3bfd94 = [_0x3ad147 - _0x12bba1, _0x559a7d - _0x321290];
    var _0x6da620 = [_0x136703 - _0x12bba1, _0x537e0e - _0x321290];
    var _0x1feda4 = this['dot'](_0x6da620, _0x6da620);
    var _0x53913d = this['dot'](_0x3bfd94, _0x6da620);
    var _0x3674f5 = _0x53913d / _0x1feda4;
    _0x3674f5 = _0x3674f5 < 0x0 ? 0x0 : _0x3674f5;
    _0x3674f5 = _0x3674f5 > 0x1 ? 0x1 : _0x3674f5;
    var _0x150033 = [_0x6da620[0x0] * _0x3674f5 + _0x12bba1 - _0x3ad147, _0x6da620[0x1] * _0x3674f5 + _0x321290 - _0x559a7d];
    var _0x442af1 = this['dot'](_0x150033, _0x150033);
    return _0x442af1 <= _0x48a834 * _0x48a834;
  };
  _0x9bf60e['dot'] = function (_0x1e79a5, _0x179c92) {
    return _0x1e79a5[0x0] * _0x179c92[0x0] + _0x1e79a5[0x1] * _0x179c92[0x1];
  };
  _0x9bf60e['update_logic'] = function (_0xb17278) {
    if (!this['is_enable']) {
      return;
    }
    if (lq_collide_config_1['LQCollideConfig']['switch_quad_tree']) {
      this['quad_tree']['clear']();
      for (var _0x1337bd = this['collide_arr']['length'] - 0x1; _0x1337bd >= 0x0; _0x1337bd--) {
        var _0x20181e = this['collide_arr'][_0x1337bd];
        if (!_0x20181e) {
          return;
        }
        if (!_0x20181e['isValid']) {
          this['collide_arr']['splice'](_0x1337bd, 0x1);
          continue;
        }
        this['update_collide_logic'](_0x20181e);
        if (_0x20181e['is_enable']) {
          this['update_world_rect'](_0x20181e);
          this['quad_tree']['insert'](_0x20181e);
        }
      }
      LQQuadTree['all_collide_arr'] = [];
      this['quad_tree']['get_all_area']();
      for (var _0x4af6ff = 0x0; _0x4af6ff < LQQuadTree['all_collide_arr']['length']; _0x4af6ff++) {
        var _0x5cac71 = LQQuadTree['all_collide_arr'][_0x4af6ff];
        for (var _0x1337bd = 0x0; _0x1337bd < _0x5cac71['length']; _0x1337bd++) {
          var _0x549a66 = _0x5cac71[_0x1337bd];
          for (var _0x5793ff = _0x1337bd + 0x1; _0x5793ff < _0x5cac71['length']; _0x5793ff++) {
            var _0x4740fe = _0x5cac71[_0x5793ff];
            if (_0x549a66['collide_category'] & _0x4740fe['collide_mask'] && _0x549a66 !== _0x4740fe) {
              if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x1) {
                if (lq_math_util_1['LQMathUtil']['intersects_rect'](_0x549a66['world_rect'], _0x4740fe['world_rect'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x2) {
                if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x4740fe['world_rect'], _0x4740fe['radius'], _0x549a66['world_rect'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x1) {
                if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x2) {
                if (lq_math_util_1['LQMathUtil']['intersects_circle'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'], _0x4740fe['radius'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] == 0x3 && _0x4740fe['_collide_shape'] == 0x2) {
                if (!_0x549a66['cache_polygon_points']) {
                  this['cache_polygon'](_0x549a66);
                }
                if (this['polygon_circle'](_0x549a66['cache_polygon_points'], _0x4740fe['world_rect']['x'], _0x4740fe['world_rect']['y'], _0x4740fe['radius'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] == 0x2 && _0x4740fe['_collide_shape'] == 0x3) {
                if (!_0x4740fe['cache_polygon_points']) {
                  this['cache_polygon'](_0x4740fe);
                }
                if (this['polygon_circle'](_0x4740fe['cache_polygon_points'], _0x549a66['world_rect']['x'], _0x549a66['world_rect']['y'], _0x549a66['radius'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else {
                if (!_0x549a66['cache_polygon_points']) {
                  this['cache_polygon'](_0x549a66);
                }
                if (!_0x4740fe['cache_polygon_points']) {
                  this['cache_polygon'](_0x4740fe);
                }
                if (this['polygon_polygon'](_0x549a66['cache_polygon_points'], _0x4740fe['cache_polygon_points'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              }
            }
          }
        }
      }
    } else {
      var _0x5cac71 = [];
      for (var _0x1337bd = this['collide_arr']['length'] - 0x1; _0x1337bd >= 0x0; _0x1337bd--) {
        var _0x20181e = this['collide_arr'][_0x1337bd];
        if (!_0x20181e) {
          return;
        }
        if (!_0x20181e['isValid']) {
          this['collide_arr']['splice'](_0x1337bd, 0x1);
          continue;
        }
        this['update_collide_logic'](_0x20181e);
        if (_0x20181e['is_enable']) {
          this['update_world_rect'](_0x20181e);
          _0x5cac71['push'](_0x20181e);
        }
      }
      var _0x4f3337 = _0x5cac71['length'];
      for (var _0x1337bd = 0x0; _0x1337bd < _0x4f3337; _0x1337bd++) {
        var _0x549a66 = _0x5cac71[_0x1337bd];
        for (var _0x5793ff = _0x1337bd + 0x1; _0x5793ff < _0x4f3337; _0x5793ff++) {
          var _0x4740fe = _0x5cac71[_0x5793ff];
          if (_0x549a66['collide_category'] & _0x4740fe['collide_mask']) {
            if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x1) {
              if (lq_math_util_1['LQMathUtil']['intersects_rect'](_0x549a66['world_rect'], _0x4740fe['world_rect'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x2) {
              if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x4740fe['world_rect'], _0x4740fe['radius'], _0x549a66['world_rect'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x1) {
              if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x2) {
              if (lq_math_util_1['LQMathUtil']['intersects_circle'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'], _0x4740fe['radius'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] == 0x3 && _0x4740fe['_collide_shape'] == 0x2) {
              if (!_0x549a66['cache_polygon_points']) {
                this['cache_polygon'](_0x549a66);
              }
              if (this['polygon_circle'](_0x549a66['cache_polygon_points'], _0x4740fe['world_rect']['x'], _0x4740fe['world_rect']['y'], _0x4740fe['radius'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] == 0x2 && _0x4740fe['_collide_shape'] == 0x3) {
              if (!_0x4740fe['cache_polygon_points']) {
                this['cache_polygon'](_0x4740fe);
              }
              if (this['polygon_circle'](_0x4740fe['cache_polygon_points'], _0x549a66['world_rect']['x'], _0x549a66['world_rect']['y'], _0x549a66['radius'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else {
              if (!_0x549a66['cache_polygon_points']) {
                this['cache_polygon'](_0x549a66);
              }
              if (!_0x4740fe['cache_polygon_points']) {
                this['cache_polygon'](_0x4740fe);
              }
              if (this['polygon_polygon'](_0x549a66['cache_polygon_points'], _0x4740fe['cache_polygon_points'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            }
          }
        }
      }
    }
  };
  _0x9bf60e['polygon_polygon'] = function (_0x1a152c, _0x484cd2) {
    var _0x173f61 = _0x1a152c;
    var _0x3fccda = _0x484cd2;
    var _0x22eef9 = [_0x173f61, _0x3fccda];
    var _0x3662ed, _0x10bbdb, _0x29133c, _0x5ce192, _0x8011c7, _0xdfe8bc;
    for (var _0x3aee8c = 0x0; _0x3aee8c < _0x22eef9['length']; _0x3aee8c++) {
      var _0x1ce8fd = _0x22eef9[_0x3aee8c];
      for (var _0x2ab2ff = 0x0; _0x2ab2ff < _0x1ce8fd['length']; _0x2ab2ff += 0x2) {
        var _0x373bd2 = (_0x2ab2ff + 0x2) % _0x1ce8fd['length'];
        var _0x4b64a4 = {
          'x': _0x1ce8fd[_0x373bd2 + 0x1] - _0x1ce8fd[_0x2ab2ff + 0x1],
          'y': _0x1ce8fd[_0x2ab2ff] - _0x1ce8fd[_0x373bd2]
        };
        _0x3662ed = null;
        _0x10bbdb = null;
        for (_0xdfe8bc = 0x0; _0xdfe8bc < _0x173f61['length']; _0xdfe8bc += 0x2) {
          _0x29133c = _0x4b64a4['x'] * _0x173f61[_0xdfe8bc] + _0x4b64a4['y'] * _0x173f61[_0xdfe8bc + 0x1];
          if (_0x3662ed === null || _0x29133c < _0x3662ed) {
            _0x3662ed = _0x29133c;
          }
          if (_0x10bbdb === null || _0x29133c > _0x10bbdb) {
            _0x10bbdb = _0x29133c;
          }
        }
        _0x5ce192 = null;
        _0x8011c7 = null;
        for (_0xdfe8bc = 0x0; _0xdfe8bc < _0x3fccda['length']; _0xdfe8bc += 0x2) {
          _0x29133c = _0x4b64a4['x'] * _0x3fccda[_0xdfe8bc] + _0x4b64a4['y'] * _0x3fccda[_0xdfe8bc + 0x1];
          if (_0x5ce192 === null || _0x29133c < _0x5ce192) {
            _0x5ce192 = _0x29133c;
          }
          if (_0x8011c7 === null || _0x29133c > _0x8011c7) {
            _0x8011c7 = _0x29133c;
          }
        }
        if (_0x10bbdb < _0x5ce192 || _0x8011c7 < _0x3662ed) {
          return ![];
        }
      }
    }
    return !![];
  };
  _0x9bf60e['get_group_by_index'] = function (_0x40e2f1) {
    for (var _0xfca8d1 in lq_collide_config_1['LQCollideConfig']['collide_group_map']) {
      var _0x5ac815 = lq_collide_config_1['LQCollideConfig']['collide_group_map'][_0xfca8d1];
      if (_0x5ac815['index'] === _0x40e2f1) {
        return _0x5ac815;
      }
    }
    return undefined;
  };
  _0x9bf60e['get_info_by_id'] = function (_0xffbcdc) {
    var _0x308325;
    for (var _0x149f5e in lq_collide_config_1['LQCollideConfig']['collide_group_map']) {
      var _0x12150f = lq_collide_config_1['LQCollideConfig']['collide_group_map'][_0x149f5e];
      if (_0x12150f['id'] === _0xffbcdc) {
        return _0x12150f;
      }
      if (!_0x308325) {
        _0x308325 = _0x12150f;
      }
    }
    return _0x308325;
  };
  _0x9bf60e['find_nearest_collide'] = function (_0x308082) {
    var _0x3131c5 = [];
    for (var _0xc3c380 = _0x9bf60e['collide_arr']['length'] - 0x1; _0xc3c380 >= 0x0; _0xc3c380--) {
      var _0x585f4f = _0x9bf60e['collide_arr'][_0xc3c380];
      if (_0x308082 === _0x585f4f || !_0x585f4f['is_enable']) {
        continue;
      }
      if (_0x308082['follow_target_category']) {
        if (_0x585f4f['collide_category'] === _0x308082['follow_target_category']) {
          _0x3131c5['push'](_0x585f4f);
        }
      } else if ((_0x585f4f['collide_category'] & _0x308082['collide_mask']) !== 0x0) {
        _0x3131c5['push'](_0x585f4f);
      }
    }
    _0x3131c5['sort'](function (_0x3ddb83, _0x3ccf74) {
      return _0x308082['world_rect']['sub'](_0x3ddb83['world_rect'])['magSqr']() - _0x308082['world_rect']['sub'](_0x3ccf74['world_rect'])['magSqr']();
    });
    return _0x3131c5[0x0];
  };
  _0x9bf60e['clear'] = function (_0x4cf6a6) {
    if (_0x4cf6a6 === void 0x0) {
      _0x4cf6a6 = ![];
    }
    if (_0x4cf6a6) {
      for (var _0x537b2d = this['collide_arr']['length'] - 0x1; _0x537b2d >= 0x0; _0x537b2d--) {
        var _0x197d2f = this['collide_arr'][_0x537b2d];
        if (_0x197d2f['isValid']) {
          _0x197d2f['node']['destroy']();
        }
      }
    }
    this['collide_arr'] = [];
  };
  _0x9bf60e['check_collide'] = function (_0x183de2) {
    var _0x25cea1 = [];
    var _0xa7b05;
    if (lq_collide_config_1['LQCollideConfig']['switch_quad_tree']) {
      LQQuadTree['temp_collide_arr'] = [];
      this['quad_tree']['retrieve'](_0x183de2);
      _0xa7b05 = LQQuadTree['temp_collide_arr'];
    } else {
      _0xa7b05 = this['collide_arr'];
    }
    for (var _0x381af2 = 0x0; _0x381af2 < _0xa7b05['length']; _0x381af2++) {
      var _0x5db7b3 = _0xa7b05[_0x381af2];
      if (_0x183de2 === _0x5db7b3) {
        continue;
      }
      if (_0x183de2['collide_category'] & _0x5db7b3['collide_mask']) {
        if (_0x183de2['_collide_shape'] === 0x1 && _0x5db7b3['_collide_shape'] === 0x1) {
          if (lq_math_util_1['LQMathUtil']['intersects_rect'](_0x183de2['world_rect'], _0x5db7b3['world_rect'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (_0x183de2['_collide_shape'] === 0x1 && _0x5db7b3['_collide_shape'] === 0x2) {
          if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x5db7b3['world_rect'], _0x5db7b3['radius'], _0x183de2['world_rect'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (_0x183de2['_collide_shape'] === 0x2 && _0x5db7b3['_collide_shape'] === 0x1) {
          if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x183de2['world_rect'], _0x183de2['radius'], _0x5db7b3['world_rect'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (_0x183de2['_collide_shape'] === 0x2 && _0x5db7b3['_collide_shape'] === 0x2) {
          if (lq_math_util_1['LQMathUtil']['intersects_circle'](_0x183de2['world_rect'], _0x183de2['radius'], _0x5db7b3['world_rect'], _0x5db7b3['radius'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (this['polygon_polygon'](_0x183de2, _0x5db7b3)) {
          _0x25cea1['push'](_0x5db7b3);
        }
      }
    }
    return _0x25cea1;
  };
  _0x9bf60e['is_enable'] = ![];
  _0x9bf60e['collide_arr'] = [];
  _0x9bf60e['quad_tree'] = new LQQuadTree(new lq_data_1['LQRect'](lq_collide_config_1['LQCollideConfig']['active_area_x'], lq_collide_config_1['LQCollideConfig']['active_area_y'], lq_collide_config_1['LQCollideConfig']['active_area_width'], lq_collide_config_1['LQCollideConfig']['active_area_height']), lq_collide_config_1['LQCollideConfig']['max_node_len'], lq_collide_config_1['LQCollideConfig']['max_node_level']);
  return _0x9bf60e;
}();
exports['LQCollideSystem'] = LQCollideSystem;
var AutoRun = function () {
  function _0xf5b087() {
    this['flag'] = !![];
  }
  _0xf5b087['prototype']['update'] = function (_0x365e55) {
    if (lq_collide_config_1['LQCollideConfig']['per_frame'] === 0x3c) {
      LQCollideSystem['update_logic'](_0x365e55);
    } else {
      if (this['flag']) {
        this['flag'] = ![];
        LQCollideSystem['update_logic'](_0x365e55);
      } else {
        this['flag'] = !![];
      }
    }
  };
  return _0xf5b087;
}();
game['on'](game['EVENT_GAME_INITED'], function () {
  if (lq_collide_config_1['LQCollideConfig']['switch_auto_run'] && !CC_EDITOR) {
    var _0x287f86 = new AutoRun();
    director['getScheduler']()['enableForTarget'](_0x287f86);
    director['getScheduler']()['scheduleUpdate'](_0x287f86, Scheduler['PRIORITY_SYSTEM'], ![]);
  }
});

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 71536 characters]