var i = arequire("../@babel/runtime/helpers/assertThisInitialized"), t = arequire("../@babel/runtime/helpers/get"), e = arequire("../@babel/runtime/helpers/getPrototypeOf"), s = arequire("../@babel/runtime/helpers/inherits"), n = arequire("../@babel/runtime/helpers/createSuper"), a = arequire("../@babel/runtime/helpers/classCallCheck"), o = arequire("../@babel/runtime/helpers/createClass");

!function(r) {
    var l = function() {
        function i() {
            a(this, i), this._local_offset = new Laya.Vector2(), this._local_angle = 0, this._isTrigger = !1, 
            this._attatched = !1, this._scale = new Laya.Vector2(1, 1);
        }
        return o(i, [ {
            key: "clone",
            value: function() {
                return null;
            }
        }, {
            key: "material",
            get: function() {
                return this.p2_Shape.material;
            },
            set: function(i) {
                this.p2_Shape.material = i;
            }
        }, {
            key: "x",
            get: function() {
                return this._local_offset.x;
            },
            set: function(i) {
                this._local_offset.x = i, null != this.p2_Shape && (this.p2_Shape.position[0] = i);
            }
        }, {
            key: "y",
            get: function() {
                return this._local_offset.y;
            },
            set: function(i) {
                this._local_offset.y = i, null != this.p2_Shape && (this.p2_Shape.position[1] = i);
            }
        }, {
            key: "angle",
            get: function() {
                return this._local_angle;
            },
            set: function(i) {
                this._local_angle = i, this.p2_Shape && (this.p2_Shape.angle = i);
            }
        }, {
            key: "isTrigger",
            get: function() {
                return this._isTrigger;
            },
            set: function(i) {
                this._isTrigger = i, this.p2_Shape && (this.p2_Shape.sensor = this._isTrigger);
            }
        }, {
            key: "cloneTo",
            value: function(i) {
                var t = i;
                t.x = this.x, t.y = this.y, t.isTrigger = this.isTrigger;
            }
        }, {
            key: "destroy",
            value: function() {
                this.p2_Shape && (this.p2_Shape = null);
            }
        }, {
            key: "_setScale",
            value: function() {
                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
                null != this.p2_Shape && (this.p2_Shape.position[0] = this.x * i, this.p2_Shape.position[1] = this.y * t), 
                this.p2_Shape.updateArea(), this.p2_Shape.updateBoundingRadius();
            }
        } ]), i;
    }();
    l.SHAPETYPES_CIRCLE = 1, l.SHAPETYPES_PARTICLE = 2, l.SHAPETYPES_PLANE = 4, l.SHAPETYPES_CONVEX = 8, 
    l.SHAPETYPES_LINE = 16, l.SHAPETYPES_BOX = 32, l.SHAPETYPES_CAPSULE = 64, l.SHAPETYPES_HEIGHTFIELD = 128;
    var h = function(i) {
        s(l, i);
        var r = n(l);
        function l() {
            var i, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
            return a(this, l), (i = r.call(this)).p2_Shape = new p2.Box({
                width: t,
                height: e
            }), i.width = t, i.height = e, i;
        }
        return o(l, [ {
            key: "sizeX",
            get: function() {
                return this.width;
            }
        }, {
            key: "sizeY",
            get: function() {
                return this.height;
            }
        }, {
            key: "clone",
            value: function() {
                var i = new l(this.sizeX, this.sizeY);
                return this.cloneTo(i), i;
            }
        }, {
            key: "_setScale",
            value: function() {
                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, s = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
                this._scale.setValue(i, s);
                var n = this.p2_Shape, a = this.width / 2 * i, o = this.width / 2 * s;
                n.vertices[0][0] = -a, n.vertices[0][1] = -o, n.vertices[1][0] = a, n.vertices[1][1] = -o, 
                n.vertices[2][0] = a, n.vertices[2][1] = o, n.vertices[3][0] = -a, n.vertices[3][1] = o, 
                t(e(l.prototype), "_setScale", this).call(this, i, s);
            }
        } ]), l;
    }(l), u = function(i) {
        s(l, i);
        var r = n(l);
        function l() {
            var i, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1;
            return a(this, l), (i = r.call(this))._radius = 1, i._radius = t, i.p2_Shape = new p2.Circle({
                radius: t
            }), i;
        }
        return o(l, [ {
            key: "radius",
            get: function() {
                return this._radius;
            }
        }, {
            key: "_setScale",
            value: function() {
                var i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, s = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
                this.p2_Shape.radius = this._radius * Math.max(i, s), t(e(l.prototype), "_setScale", this).call(this, i, s);
            }
        }, {
            key: "clone",
            value: function() {
                var i = new l(this.radius);
                return this.cloneTo(i), i;
            }
        } ]), l;
    }(l), _ = function(i) {
        s(e, i);
        var t = n(e);
        function e(i) {
            var s;
            return a(this, e), (s = t.call(this))._length = i, s.p2_Shape = new p2.Line({
                length: i
            }), s;
        }
        return o(e, [ {
            key: "clone",
            value: function() {
                var i = new e(this._length);
                return this.cloneTo(i), i;
            }
        } ]), e;
    }(l), p = function(t) {
        s(r, t);
        var e = n(r);
        function r() {
            var t;
            return a(this, r), (t = e.call(this))._collisionGroup = Laya.Physics3DUtils.COLLISIONFILTERGROUP_DEFAULTFILTER, 
            t._canCollideWith = Laya.Physics3DUtils.COLLISIONFILTERGROUP_ALLFILTER, t._inPhysicUpdateListIndex = -1, 
            t.shapes = [], t._transformFlag = 2147483647, r._physicObjectsMap[t.id] = i(t), 
            t;
        }
        return o(r, [ {
            key: "colliderShapes",
            get: function() {
                return this.shapes;
            }
        }, {
            key: "addShape",
            value: function(i) {
                if (i._attatched) throw "P2PhysicsComponent: this shape has attatched to other entity.";
                i._attatched = !0, i._compoundParent = this, i._indexInCompound = this.shapes.length, 
                i.p2_Shape.collisionMask = this.canCollideWith, i.p2_Shape.collisionGroup = this.collisionGroup, 
                this.p2_Body.addShape(i.p2_Shape, [ i.x, i.y ], i.angle), i.p2_Shape.sensor = i.isTrigger, 
                this.shapes.push(i), this._onShapeChange();
                var t = this._simulation && this._enabled;
                t && this._removeFromSimulation(), t && (this._derivePhysicsTransformation(!0), 
                this._addToSimulation());
            }
        }, {
            key: "collisionGroup",
            get: function() {
                return this._collisionGroup;
            },
            set: function(i) {
                this._collisionGroup = i, this.shapes, this.shapes.forEach(function(t) {
                    t.p2_Shape.collisionGroup = i;
                });
            }
        }, {
            key: "canCollideWith",
            get: function() {
                return this._canCollideWith;
            },
            set: function(i) {
                this._canCollideWith = i, this.shapes.forEach(function(t) {
                    t.p2_Shape.collisionMask = i;
                });
            }
        }, {
            key: "body",
            get: function() {
                return this.p2_Body;
            }
        }, {
            key: "_onScaleChange",
            value: function(i, t) {
                for (var e = 0; e < this.shapes.length; e++) this.shapes[e]._setScale(i, t);
            }
        }, {
            key: "_onEnable",
            value: function() {
                this._simulation = this.owner._scene._p2PhysicsSimulation, null != this.p2_Body && this.shapes.length > 0 && (this._derivePhysicsTransformation(!0), 
                this._addToSimulation());
            }
        }, {
            key: "_onDisable",
            value: function() {
                null != this.p2_Body && (this._removeFromSimulation(), -1 !== this._inPhysicUpdateListIndex && this._simulation._physicsUpdateList.remove(this)), 
                this._simulation = null;
            }
        }, {
            key: "_onDestroy",
            value: function() {
                delete r._physicObjectsMap[this.id];
                for (var i = 0; i < this.shapes.length; i++) this.shapes[i].destroy();
                this.shapes = null, this.p2_Body = null, this._simulation = null, this.owner.transform.off(Laya.Event.TRANSFORM_CHANGED, this, this._onTransformChanged);
            }
        }, {
            key: "_isValid",
            value: function() {
                return this._simulation && this.shapes.length > 0 && this._enabled;
            }
        }, {
            key: "_onTransformChanged",
            value: function(i) {
                !r._addUpdateList && this._simulation || (i &= Laya.Transform3D.TRANSFORM_WORLDPOSITION | Laya.Transform3D.TRANSFORM_WORLDQUATERNION | Laya.Transform3D.TRANSFORM_WORLDSCALE) && (this._transformFlag |= i, 
                this._isValid() && -1 === this._inPhysicUpdateListIndex && this._simulation._physicsUpdateList.add(this));
            }
        }, {
            key: "_addToSimulation",
            value: function() {}
        }, {
            key: "_removeFromSimulation",
            value: function() {}
        }, {
            key: "_parse",
            value: function(i, t) {
                null != i.collisionGroup && (this.collisionGroup = i.collisionGroup), null != i.canCollideWith && (this.canCollideWith = i.canCollideWith), 
                this._parseShape(i.shapes);
            }
        }, {
            key: "_parseShape",
            value: function(i) {
                for (var t = i.length, e = 0; e < t; e++) {
                    var s = r.createShape(i[e]);
                    "GunBullet" == this.owner.name && console.log("---------GunBullet---------", s), 
                    this.addShape(s);
                }
            }
        }, {
            key: "_setTransformFlag",
            value: function(i, t) {
                t ? this._transformFlag |= i : this._transformFlag &= ~i;
            }
        }, {
            key: "_getTransformFlag",
            value: function(i) {
                return 0 != (this._transformFlag & i);
            }
        }, {
            key: "_derivePhysicsTransformation",
            value: function(i) {
                var t = this.p2_Body;
                this._innerDerivePhysicsTransformation(t, i);
            }
        }, {
            key: "_innerDerivePhysicsTransformation",
            value: function(i, t) {
                var e = this.owner._transform;
                if ((t || this._getTransformFlag(Laya.Transform3D.TRANSFORM_WORLDPOSITION)) && (i.position[0] = e.position.x, 
                i.position[1] = e.position.y, this._setTransformFlag(Laya.Transform3D.TRANSFORM_WORLDPOSITION, !1)), 
                (t || this._getTransformFlag(Laya.Transform3D.TRANSFORM_WORLDQUATERNION)) && (i.angle = e.rotationEuler.z * r.Deg2Rad, 
                (e.rotationEuler.x * e.rotationEuler.x > .01 || e.rotationEuler.y * e.rotationEuler.y > .01) && console.warn("刚体不能旋转x和y轴", e.owner.name), 
                this._setTransformFlag(Laya.Transform3D.TRANSFORM_WORLDQUATERNION, !1)), t || this._getTransformFlag(Laya.Transform3D.TRANSFORM_WORLDSCALE)) {
                    var s = e.getWorldLossyScale();
                    this._onScaleChange(s.x, s.y), this._setTransformFlag(Laya.Transform3D.TRANSFORM_WORLDSCALE, !1);
                }
            }
        }, {
            key: "_updateTransformComponent",
            value: function(i) {
                var t = this.owner._transform, e = t.position;
                if (e.setValue(i.interpolatedPosition[0], i.interpolatedPosition[1], e.z), t.position = e, 
                !i.fixedRotation) {
                    var s = t.rotationEuler;
                    s.z = i.interpolatedAngle * r.Rad2Deg, t.rotationEuler = s;
                }
            }
        }, {
            key: "_onShapeChange",
            value: function() {}
        }, {
            key: "_onAdded",
            value: function() {
                this.enabled = this._enabled, this.owner._transform.on(Laya.Event.TRANSFORM_CHANGED, this, this._onTransformChanged);
            }
        }, {
            key: "_cloneTo",
            value: function(i) {
                var t = i;
                t.collisionGroup = this._collisionGroup, t.canCollideWith = this._canCollideWith;
                for (var e = 0; e < this.shapes.length; e++) {
                    var s = this.shapes[e];
                    t.addShape(s.clone());
                }
            }
        } ], [ {
            key: "createShape",
            value: function(i) {
                var t;
                switch (i.type) {
                  case p2.Shape.BOX:
                    t = new h(i.size[0], i.size[1]);
                    break;

                  case p2.Shape.CIRCLE:
                    t = new u(i.radius);
                    break;

                  case p2.Shape.LINE:
                    t = new _(i.length);
                }
                return i.center && (t.x = i.center[0], t.y = i.center[1]), i.isTrigger && (t.isTrigger = i.isTrigger), 
                t;
            }
        } ]), r;
    }(Laya.Component);
    p.Deg2Rad = .017453292519943295, p.Rad2Deg = 57.29577951308232, p._physicObjectsMap = {}, 
    p._addUpdateList = !0;
    var d = function(i) {
        s(l, i);
        var r = n(l);
        function l() {
            return a(this, l), r.apply(this, arguments);
        }
        return o(l, [ {
            key: "_parse",
            value: function(i, s) {
                t(e(l.prototype), "_parse", this).call(this, i, s);
            }
        }, {
            key: "_onAdded",
            value: function() {
                this.p2_Body = new p2.Body(), this.p2_Body.layaID = this.id, this.p2_Body.type = p2.Body.STATIC, 
                this.p2_Body.mass = 0, t(e(l.prototype), "_onAdded", this).call(this);
            }
        }, {
            key: "_addToSimulation",
            value: function() {
                this._simulation._addRigidBody(this);
            }
        }, {
            key: "_removeFromSimulation",
            value: function() {
                this._simulation._removeRigidBody(this);
            }
        } ]), l;
    }(p), c = o(function i() {
        a(this, i);
    });
    c.maxSubSteps = 3, c.fixedTimeStep = 1 / 60, c.worldOptions = {
        gravity: [ 0, -10 ]
    }, c.enable = !1;
    var y = function(i) {
        s(l, i);
        var r = n(l);
        function l() {
            var i;
            return a(this, l), (i = r.call(this))._mass = 1, i._isKinematic = !1, i._gravity = new Laya.Vector2(0, -10), 
            i._type = p2.Body.DYNAMIC, i._gravityScale = 1, i;
        }
        return o(l, [ {
            key: "mass",
            get: function() {
                return this._mass;
            },
            set: function(i) {
                this._mass = i, null != this.body && (this.body.mass = i, this._updateMass(i));
            }
        }, {
            key: "gravityScale",
            get: function() {
                return this._gravityScale;
            },
            set: function(i) {
                this._gravityScale = i, null != this.body && (this.body.gravityScale = i, this._updateMass(this.mass));
            }
        }, {
            key: "damping",
            get: function() {
                return this._damping;
            },
            set: function(i) {
                this._damping = i, null != this.body && (this.body.damping = i);
            }
        }, {
            key: "angularDamping",
            get: function() {
                return this._angularDamping;
            },
            set: function(i) {
                this._angularDamping = i, null != this.body && (this.body.angularDamping = i);
            }
        }, {
            key: "isKinematic",
            get: function() {
                return this._isKinematic;
            }
        }, {
            key: "type",
            get: function() {
                return this._type;
            },
            set: function(i) {
                this._type = i, null != this.body && (this.body.type = i, i == p2.Body.KINEMATIC ? this._updateMass(0) : this._updateMass(this.mass));
            }
        }, {
            key: "_onScaleChange",
            value: function(i, s) {
                t(e(l.prototype), "_onScaleChange", this).call(this, i, s), this._type == p2.Body.KINEMATIC ? this._updateMass(0) : this._updateMass(this._mass);
            }
        }, {
            key: "_updateMass",
            value: function(i) {
                null != this.p2_Body && null != this.shapes && (this.p2_Body.mass = i, this.p2_Body.aabbNeedsUpdate = !0, 
                this.p2_Body.updateBoundingRadius(), this.p2_Body.updateMassProperties(), this.p2_Body.updateAABB(), 
                this.p2_Body.updateSolveMassProperties());
            }
        }, {
            key: "_onAdded",
            value: function() {
                var i = new p2.Body();
                i.layaID = this.id, this.p2_Body = i, this.p2_Body.type = this._type, this.p2_Body.gravityScale, 
                this.mass = this._mass, t(e(l.prototype), "_onAdded", this).call(this);
            }
        }, {
            key: "_parse",
            value: function(i, s) {
                this.mass = i.mass, this.type = i.bodyType, this._type == p2.Body.DYNAMIC && (this.angularDamping = i.angularDamping, 
                this.damping = i.damping, this.gravityScale = i.gravityScale), t(e(l.prototype), "_parse", this).call(this, i, s);
            }
        }, {
            key: "_onDestroy",
            value: function() {
                t(e(l.prototype), "_onDestroy", this).call(this);
            }
        }, {
            key: "_addToSimulation",
            value: function() {
                this._simulation._addRigidBody(this);
            }
        }, {
            key: "_removeFromSimulation",
            value: function() {
                this._simulation._removeRigidBody(this);
            }
        }, {
            key: "_cloneTo",
            value: function(i) {
                t(e(l.prototype), "_cloneTo", this).call(this, i);
                var s = i;
                s.mass = this._mass, s.type = this.type;
            }
        }, {
            key: "_onShapeChange",
            value: function() {
                t(e(l.prototype), "_onShapeChange", this).call(this), this._updateMass(this.mass);
            }
        } ]), l;
    }(p), g = function() {
        function i() {
            a(this, i), this.isTrigger = !1, this._lastUpdateFrame = -2147483648, this._updateFrame = -2147483648;
        }
        return o(i, [ {
            key: "_setUpdateFrame",
            value: function(i) {
                this._lastUpdateFrame = this._updateFrame, this._updateFrame = i;
            }
        } ]), i;
    }(), f = function() {
        function i() {
            a(this, i), this._collisions = {}, this._collisionsPool = [];
        }
        return o(i, [ {
            key: "getCollision",
            value: function(i, t) {
                var e, s = i.id, n = t.id, a = this._collisions[s];
                return a && (e = a[n]), e || (a || (a = {}, this._collisions[s] = a), (e = 0 == this._collisionsPool.length ? new g() : this._collisionsPool.pop())._shapeA = i, 
                e._shapeB = t, e._colliderA = p._physicObjectsMap[i.body.layaID], e._colliderB = p._physicObjectsMap[t.body.layaID], 
                a[n] = e), e;
            }
        }, {
            key: "recoverCollision",
            value: function(i) {
                var t = i._shapeA.id, e = i._shapeB.id;
                this._collisions[t][e] = null, this._collisionsPool.push(i);
            }
        } ]), i;
    }(), v = function(i) {
        s(e, i);
        var t = n(e);
        function e() {
            return a(this, e), t.call(this);
        }
        return o(e, [ {
            key: "add",
            value: function(i) {
                if (-1 !== i._inPhysicUpdateListIndex) throw "PhysicsUpdateList:element has  in  PhysicsUpdateList.";
                this._add(i), i._inPhysicUpdateListIndex = this.length++;
            }
        }, {
            key: "remove",
            value: function(i) {
                var t = i._inPhysicUpdateListIndex;
                if (this.length--, t !== this.length) {
                    var e = this.elements[this.length];
                    this.elements[t] = e, e._inPhysicUpdateListIndex = t;
                }
                i._inPhysicUpdateListIndex = -1;
            }
        } ]), e;
    }(Laya.SingletonList), m = function() {
        function i() {
            a(this, i), this._collisionsUtils = new f(), this._gravity = new Laya.Vector2(0, -10), 
            this.maxSubSteps = 1, this.fixedTimeStep = 1 / 60, this._physicsUpdateList = new v(), 
            this._currentFrameCollisions = [], this._previousFrameCollisions = [], this._allCollisions = [], 
            this.world = new p2.World(c.worldOptions), this.fixedTimeStep = c.fixedTimeStep, 
            this.maxSubSteps = c.maxSubSteps, this.world.on("beginContact", this.beginContact, this), 
            this.world.on("endContact", this.endContact, this);
        }
        return o(i, [ {
            key: "_updatePhysicsTransformFromRender",
            value: function() {
                for (var i = this._physicsUpdateList.elements, t = 0, e = this._physicsUpdateList.length; t < e; t++) {
                    var s = i[t];
                    s._derivePhysicsTransformation(!1), s._inPhysicUpdateListIndex = -1;
                }
                this._physicsUpdateList.length = 0;
            }
        }, {
            key: "_simulate",
            value: function(i) {
                null != this.world && this.world.step(this.fixedTimeStep, i, this.maxSubSteps);
                for (var t = this.world.bodies, e = 0; e < t.length; e++) {
                    var s = t[e];
                    p._physicObjectsMap[s.layaID]._updateTransformComponent(s);
                }
            }
        }, {
            key: "gravity",
            get: function() {
                return this.world.gravity;
            }
        }, {
            key: "gravityX",
            set: function(i) {
                this.world.gravity[0] = i;
            }
        }, {
            key: "gravityY",
            set: function(i) {
                this.world.gravity[1] = i;
            }
        }, {
            key: "_addRigidBody",
            value: function(i) {
                null != this.world && this.world.addBody(i.body);
            }
        }, {
            key: "_removeRigidBody",
            value: function(i) {
                null != this.world && this.world.removeBody(i.body);
            }
        }, {
            key: "_updateCollisions",
            value: function() {
                var i = this._currentFrameCollisions;
                this._currentFrameCollisions = this._previousFrameCollisions, this._currentFrameCollisions.length = 0, 
                this._previousFrameCollisions = i;
                for (var t = Laya.Stat.loopCount, e = this._allCollisions.length, s = 0; s < e; s++) {
                    var n = this._allCollisions[s];
                    this._currentFrameCollisions.push(n), n.isTrigger = n._shapeB.sensor || n._shapeA.sensor, 
                    n._setUpdateFrame(t);
                }
            }
        }, {
            key: "_eventScripts",
            value: function() {
                for (var t = Laya.Stat.loopCount, e = 0, s = this._currentFrameCollisions.length; e < s; e++) {
                    var n = this._currentFrameCollisions[e], a = n._colliderA, o = n._colliderB;
                    if (!a.destroyed && !o.destroyed) if (t - n._lastUpdateFrame == 1) {
                        var r = a.owner;
                        null != r && (n.isTrigger ? r.sendMessage(i.Trigger_Stay, o) : (n.other = o, r.sendMessage(i.Collision_Stay, n)));
                        var l = o.owner;
                        null != l && (n.isTrigger ? l.sendMessage(i.Trigger_Stay, a) : (n.other = a, l.sendMessage(i.Collision_Stay, n)));
                    } else {
                        var h = a.owner;
                        null != h && (n.isTrigger ? h.sendMessage(i.Trigger_Enter, o) : (n.other = o, h.sendMessage(i.Collision_Enter, n)));
                        var u = o.owner;
                        null != u && (n.isTrigger ? u.sendMessage(i.Trigger_Enter, a) : (n.other = a, u.sendMessage(i.Collision_Enter, n)));
                    }
                }
                for (e = 0, s = this._previousFrameCollisions.length; e < s; e++) {
                    var _ = this._previousFrameCollisions[e], p = _._colliderA, d = _._colliderB;
                    if (!p.destroyed && !d.destroyed && t - _._updateFrame == 1) {
                        this._collisionsUtils.recoverCollision(_);
                        var c = p.owner;
                        c && (_.isTrigger ? c.sendMessage(i.Trigger_Exit, d) : (_.other = d, c.sendMessage(i.Collision_Exit, _)));
                        var y = d.owner;
                        y && (_.isTrigger ? y.sendMessage(i.Trigger_Exit, p) : (_.other = p, y.sendMessage(i.Collision_Exit, _)));
                    }
                }
            }
        }, {
            key: "destroy",
            value: function() {
                null != this.world && (this.world.off("beginContact", this.beginContact), this.world.off("endContact", this.endContact), 
                this.world = null);
            }
        }, {
            key: "beginContact",
            value: function(i) {
                var t = this._collisionsUtils.getCollision(i.shapeA, i.shapeB);
                t.ContactEquations = i.contactEquations, -1 == this._allCollisions.findIndex(function(t) {
                    return t._shapeA.id == i.shapeA.id && t._shapeB.id == i.shapeB.id || t._shapeA.id == i.shapeB.id && t._shapeB.id == i.shapeA.id;
                }) && this._allCollisions.push(t);
            }
        }, {
            key: "endContact",
            value: function(i) {
                var t = this._allCollisions.findIndex(function(t) {
                    return t._shapeA.id == i.shapeA.id && t._shapeB.id == i.shapeB.id || t._shapeA.id == i.shapeB.id && t._shapeB.id == i.shapeA.id;
                });
                -1 != t ? this._allCollisions.splice(t, 1) : console.log("没有发生碰撞收到了碰撞事件");
            }
        } ], [ {
            key: "__init",
            value: function() {}
        } ]), i;
    }();
    m.Trigger_Exit = "onTriggerExit2D", m.Trigger_Enter = "onTriggerEnter2D", m.Trigger_Stay = "onTriggerStay2D", 
    m.Collision_Exit = "onCollisionExit2D", m.Collision_Enter = "onCollisionEnter2D", 
    m.Collision_Stay = "onCollisionStay2D", c.enable = !0, r.P2Box = h, r.P2Circle = u, 
    r.P2Collision = g, r.P2CollisionTool = f, r.P2Line = _, r.P2PhysicsCollider = d, 
    r.P2PhysicsComponent = p, r.P2PhysicsSettings = c, r.P2PhysicsSimulation = m, r.P2PhysicsUpdateList = v, 
    r.P2Rigidbody = y, r.P2Shape = l, r.init = function() {
        Laya.ClassUtils.regClass("P2Rigidbody", y), Laya.ClassUtils.regClass("P2PhysicsCollider", d);
    }, Object.defineProperty(r, "__esModule", {
        value: !0
    });
}(window.TY.P2Utils = window.TY.P2Utils || {});