From 7e4b789568a372a7b716d07d4eb3464331bca395 Mon Sep 17 00:00:00 2001 From: Ivan Popelyshev Date: Wed, 19 Oct 2016 21:51:04 +0300 Subject: [PATCH] Bump version, 1.2 --- bin/pixi-spine.js | 675 ++++++++++++++++++++++++-------------- bin/pixi-spine.js.map | 2 +- bin/pixi-spine.min.js | 11 +- bin/pixi-spine.min.js.map | 2 +- package.json | 2 +- 5 files changed, 434 insertions(+), 258 deletions(-) diff --git a/bin/pixi-spine.js b/bin/pixi-spine.js index 6d6a8a70..a8be2515 100644 --- a/bin/pixi-spine.js +++ b/bin/pixi-spine.js @@ -1,6 +1,6 @@ /*! - * pixi-spine - v1.1.3 - * Compiled Fri Oct 07 2016 01:10:27 GMT+0300 (RTZ 2 (зима)) + * pixi-spine - v1.2.0 + * Compiled Wed Oct 19 2016 21:49:57 GMT+0300 (RTZ 2 (зима)) * * pixi-spine is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -175,14 +175,10 @@ var Spine = (function (_super) { } } slot.bone.matrix.copy(lt_1); - lt_1.tx += slot.bone.skeleton.x; - lt_1.ty += slot.bone.skeleton.y; } else { var lt = slotContainer.localTransform || new PIXI.Matrix(); slot.bone.matrix.copy(lt); - lt.tx += slot.bone.skeleton.x; - lt.ty += slot.bone.skeleton.y; slotContainer.localTransform = lt; slotContainer.displayObjectUpdateTransform = SlotContainerUpdateTransformV3; } @@ -1338,6 +1334,38 @@ var AnimationStateData = (function () { exports.AnimationStateData = AnimationStateData; },{}],5:[function(require,module,exports){ "use strict"; +var attachments_1 = require("./attachments"); +var AtlasAttachmentLoader = (function () { + function AtlasAttachmentLoader(atlas) { + this.atlas = atlas; + } + AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); + var attachment = new attachments_1.RegionAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { + var region = this.atlas.findRegion(path); + if (region == null) + throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); + var attachment = new attachments_1.MeshAttachment(name); + attachment.region = region; + return attachment; + }; + AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { + return new attachments_1.BoundingBoxAttachment(name); + }; + AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { + return new attachments_1.PathAttachment(name); + }; + return AtlasAttachmentLoader; +}()); +exports.AtlasAttachmentLoader = AtlasAttachmentLoader; +},{"./attachments":33}],6:[function(require,module,exports){ +"use strict"; (function (BlendMode) { BlendMode[BlendMode["Normal"] = 0] = "Normal"; BlendMode[BlendMode["Additive"] = 1] = "Additive"; @@ -1345,8 +1373,9 @@ exports.AnimationStateData = AnimationStateData; BlendMode[BlendMode["Screen"] = 3] = "Screen"; })(exports.BlendMode || (exports.BlendMode = {})); var BlendMode = exports.BlendMode; -},{}],6:[function(require,module,exports){ +},{}],7:[function(require,module,exports){ "use strict"; +var BoneData_1 = require("./BoneData"); var Utils_1 = require("./Utils"); var Bone = (function () { function Bone(data, skeleton, parent) { @@ -1359,9 +1388,14 @@ var Bone = (function () { this.scaleY = 0; this.shearX = 0; this.shearY = 0; - this.appliedRotation = 0; - this.worldSignX = 0; - this.worldSignY = 0; + this.ax = 0; + this.ay = 0; + this.arotation = 0; + this.ascaleX = 0; + this.ascaleY = 0; + this.ashearX = 0; + this.ashearY = 0; + this.appliedValid = false; this.sorted = false; if (data == null) throw new Error("data cannot be null."); @@ -1393,13 +1427,22 @@ var Bone = (function () { this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); }; Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) { - this.appliedRotation = rotation; - var rotationY = rotation + 90 + shearY; - var la = Utils_1.MathUtils.cosDeg(rotation + shearX) * scaleX, lb = Utils_1.MathUtils.cosDeg(rotationY) * scaleY; - var lc = Utils_1.MathUtils.sinDeg(rotation + shearX) * scaleX, ld = Utils_1.MathUtils.sinDeg(rotationY) * scaleY; + this.ax = x; + this.ay = y; + this.arotation = rotation; + this.ascaleX = scaleX; + this.ascaleY = scaleY; + this.ashearX = shearX; + this.ashearY = shearY; + this.appliedValid = true; var parent = this.parent; var m = this.matrix; if (parent == null) { + var rotationY = rotation + 90 + shearY; + var la = Utils_1.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = Utils_1.MathUtils.cosDeg(rotationY) * scaleY; + var lc = Utils_1.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = Utils_1.MathUtils.sinDeg(rotationY) * scaleY; var skeleton = this.skeleton; if (skeleton.flipX) { x = -x; @@ -1415,38 +1458,109 @@ var Bone = (function () { m.c = lb; m.b = lc; m.d = ld; - m.tx = x; - m.ty = y; - this.worldSignX = Utils_1.MathUtils.signum(scaleX); - this.worldSignY = Utils_1.MathUtils.signum(scaleY); + m.tx = x + skeleton.x; + m.ty = y + skeleton.y; return; } var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d; m.tx = pa * x + pb * y + parent.matrix.tx; m.ty = pc * x + pd * y + parent.matrix.ty; - this.worldSignX = parent.worldSignX * Utils_1.MathUtils.signum(scaleX); - this.worldSignY = parent.worldSignY * Utils_1.MathUtils.signum(scaleY); - if (this.data.inheritRotation && this.data.inheritScale) { - m.a = pa * la + pb * lc; - m.c = pa * lb + pb * ld; - m.b = pc * la + pd * lc; - m.d = pc * lb + pd * ld; - } - else { - if (this.data.inheritRotation) { + switch (this.data.transformMode) { + case BoneData_1.TransformMode.Normal: { + var rotationY = rotation + 90 + shearY; + var la = Utils_1.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = Utils_1.MathUtils.cosDeg(rotationY) * scaleY; + var lc = Utils_1.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = Utils_1.MathUtils.sinDeg(rotationY) * scaleY; + m.a = pa * la + pb * lc; + m.c = pa * lb + pb * ld; + m.b = pc * la + pd * lc; + m.d = pc * lb + pd * ld; + return; + } + case BoneData_1.TransformMode.OnlyTranslation: { + var rotationY = rotation + 90 + shearY; + m.a = Utils_1.MathUtils.cosDeg(rotation + shearX) * scaleX; + m.c = Utils_1.MathUtils.cosDeg(rotationY) * scaleY; + m.b = Utils_1.MathUtils.sinDeg(rotation + shearX) * scaleX; + m.d = Utils_1.MathUtils.sinDeg(rotationY) * scaleY; + break; + } + case BoneData_1.TransformMode.NoRotationOrReflection: { + var s = pa * pa + pc * pc; + var prx = 0; + if (s > 0.0001) { + s = Math.abs(pa * pd - pb * pc) / s; + pb = pc * s; + pd = pa * s; + prx = Math.atan2(pc, pa) * Utils_1.MathUtils.radDeg; + } + else { + pa = 0; + pc = 0; + prx = 90 - Math.atan2(pd, pb) * Utils_1.MathUtils.radDeg; + } + var rx = rotation + shearX - prx; + var ry = rotation + shearY - prx + 90; + var la = Utils_1.MathUtils.cosDeg(rx) * scaleX; + var lb = Utils_1.MathUtils.cosDeg(ry) * scaleY; + var lc = Utils_1.MathUtils.sinDeg(rx) * scaleX; + var ld = Utils_1.MathUtils.sinDeg(ry) * scaleY; + m.a = pa * la - pb * lc; + m.c = pa * lb - pb * ld; + m.b = pc * la + pd * lc; + m.d = pc * lb + pd * ld; + break; + } + case BoneData_1.TransformMode.NoScale: + case BoneData_1.TransformMode.NoScaleOrReflection: { + var cos = Utils_1.MathUtils.cosDeg(rotation); + var sin = Utils_1.MathUtils.sinDeg(rotation); + var za = pa * cos + pb * sin; + var zc = pc * cos + pd * sin; + var s = Math.sqrt(za * za + zc * zc); + if (s > 0.00001) + s = 1 / s; + za *= s; + zc *= s; + s = Math.sqrt(za * za + zc * zc); + var r = Math.PI / 2 + Math.atan2(zc, za); + var zb = Math.cos(r) * s; + var zd = Math.sin(r) * s; + var la = Utils_1.MathUtils.cosDeg(shearX) * scaleX; + var lb = Utils_1.MathUtils.cosDeg(90 + shearY) * scaleY; + var lc = Utils_1.MathUtils.sinDeg(shearX) * scaleX; + var ld = Utils_1.MathUtils.sinDeg(90 + shearY) * scaleY; + m.a = za * la + zb * lc; + m.c = za * lb + zb * ld; + m.b = zc * la + zd * lc; + m.d = zc * lb + zd * ld; + if (this.data.transformMode != BoneData_1.TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : (this.skeleton.flipX != this.skeleton.flipY) != Bone.yDown) { + m.b = -m.b; + m.d = -m.d; + } + return; + } + case BoneData_1.TransformMode.InheritRotation: { + var rotationY = rotation + 90 + shearY; + var la = Utils_1.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = Utils_1.MathUtils.cosDeg(rotationY) * scaleY; + var lc = Utils_1.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = Utils_1.MathUtils.sinDeg(rotationY) * scaleY; pa = 1; pb = 0; pc = 0; pd = 1; do { - var cos = Utils_1.MathUtils.cosDeg(parent.appliedRotation), sin = Utils_1.MathUtils.sinDeg(parent.appliedRotation); + var cos = Utils_1.MathUtils.cosDeg(parent.arotation), sin = Utils_1.MathUtils.sinDeg(parent.arotation); var temp = pa * cos + pb * sin; pb = pb * cos - pa * sin; pa = temp; temp = pc * cos + pd * sin; pd = pd * cos - pc * sin; pc = temp; - if (!parent.data.inheritRotation) + if (parent.data.transformMode === BoneData_1.TransformMode.InheritScale || + parent.data.transformMode === BoneData_1.TransformMode.OnlyTranslation) break; parent = parent.parent; } while (parent != null); @@ -1454,14 +1568,20 @@ var Bone = (function () { m.c = pa * lb + pb * ld; m.b = pc * la + pd * lc; m.d = pc * lb + pd * ld; + break; } - else if (this.data.inheritScale) { + case BoneData_1.TransformMode.InheritScale: { + var rotationY = rotation + 90 + shearY; + var la = Utils_1.MathUtils.cosDeg(rotation + shearX) * scaleX; + var lb = Utils_1.MathUtils.cosDeg(rotationY) * scaleY; + var lc = Utils_1.MathUtils.sinDeg(rotation + shearX) * scaleX; + var ld = Utils_1.MathUtils.sinDeg(rotationY) * scaleY; pa = 1; pb = 0; pc = 0; pd = 1; do { - var cos = Utils_1.MathUtils.cosDeg(parent.appliedRotation), sin = Utils_1.MathUtils.sinDeg(parent.appliedRotation); + var cos = Utils_1.MathUtils.cosDeg(parent.arotation), sin = Utils_1.MathUtils.sinDeg(parent.arotation); var psx = parent.scaleX, psy = parent.scaleY; var za = cos * psx, zb = sin * psy, zc = sin * psx, zd = cos * psy; var temp = pa * za + pb * zc; @@ -1478,7 +1598,8 @@ var Bone = (function () { temp = pc * cos + pd * sin; pd = pd * cos - pc * sin; pc = temp; - if (!parent.data.inheritScale) + if (parent.data.transformMode === BoneData_1.TransformMode.InheritRotation || + parent.data.transformMode === BoneData_1.TransformMode.OnlyTranslation) break; parent = parent.parent; } while (parent != null); @@ -1486,22 +1607,17 @@ var Bone = (function () { m.c = pa * lb + pb * ld; m.b = pc * la + pd * lc; m.d = pc * lb + pd * ld; - } - else { - m.a = la; - m.c = lb; - m.b = lc; - m.d = ld; - } - if (this.skeleton.flipX) { - m.a = -m.a; - m.c = -m.c; - } - if (this.skeleton.flipY !== Bone.yDown) { - m.b = -m.b; - m.d = -m.d; + break; } } + if (this.skeleton.flipX) { + m.a = -m.a; + m.c = -m.c; + } + if (this.skeleton.flipY != Bone.yDown) { + m.b = -m.b; + m.d = -m.d; + } }; Bone.prototype.setToSetupPose = function () { var data = this.data; @@ -1520,26 +1636,26 @@ var Bone = (function () { return Math.atan2(this.matrix.d, this.matrix.c) * Utils_1.MathUtils.radDeg; }; Bone.prototype.getWorldScaleX = function () { - return Math.sqrt(this.matrix.a * this.matrix.a + this.matrix.b * this.matrix.b) * this.worldSignX; + var m = this.matrix; + return Math.sqrt(m.a * m.a + m.c * m.c); }; Bone.prototype.getWorldScaleY = function () { - return Math.sqrt(this.matrix.c * this.matrix.c + this.matrix.d * this.matrix.d) * this.worldSignY; + var m = this.matrix; + return Math.sqrt(m.b * m.b + m.d * m.d); }; Bone.prototype.worldToLocalRotationX = function () { var parent = this.parent; if (parent == null) - return this.rotation; - var pm = parent.matrix; - var pa = pm.a, pb = pm.c, pc = pm.b, pd = pm.d, a = this.matrix.a, c = this.matrix.b; - return Math.atan2(pa * c - pc * a, pd * a - pb * c) * Utils_1.MathUtils.radDeg; + return this.arotation; + var pm = parent.matrix, m = this.matrix; + return Math.atan2(pm.a * m.b - pm.b * m.a, pm.d * m.a - pm.c * m.b) * Utils_1.MathUtils.radDeg; }; Bone.prototype.worldToLocalRotationY = function () { var parent = this.parent; if (parent == null) - return this.rotation; - var pm = parent.matrix; - var pa = pm.a, pb = pm.b, pc = pm.c, pd = pm.d, b = this.matrix.c, d = this.matrix.d; - return Math.atan2(pa * d - pc * b, pd * b - pb * d) * Utils_1.MathUtils.radDeg; + return this.arotation; + var pm = parent.matrix, m = this.matrix; + return Math.atan2(pm.a * m.d - pm.b * m.c, pm.d * m.c - pm.c * m.d) * Utils_1.MathUtils.radDeg; }; Bone.prototype.rotateWorld = function (degrees) { var m = this.matrix; @@ -1549,50 +1665,49 @@ var Bone = (function () { m.c = cos * b - sin * d; m.b = sin * a + cos * c; m.d = sin * b + cos * d; + this.appliedValid = false; }; - Bone.prototype.updateLocalTransform = function () { + Bone.prototype.updateAppliedTransform = function () { + this.appliedValid = true; var parent = this.parent; var m = this.matrix; if (parent == null) { - this.x = m.tx; - this.y = m.ty; - this.rotation = Math.atan2(m.b, m.a) * Utils_1.MathUtils.radDeg; - this.scaleX = Math.sqrt(m.a * m.a + m.b * m.b); - this.scaleY = Math.sqrt(m.c * m.c + m.d * m.d); - var det = m.a * m.d - m.b * m.c; - this.shearX = 0; - this.shearY = Math.atan2(m.a * m.c + m.b * m.d, det) * Utils_1.MathUtils.radDeg; + this.ax = m.tx; + this.ay = m.ty; + this.arotation = Math.atan2(m.b, m.a) * Utils_1.MathUtils.radDeg; + this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b); + this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d); + this.ashearX = 0; + this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * Utils_1.MathUtils.radDeg; return; } var pm = parent.matrix; - var pa = pm.a, pb = pm.c, pc = pm.b, pd = pm.d; - var pid = 1 / (pa * pd - pb * pc); + var pid = 1 / (pm.a * pm.d - pm.b * pm.c); var dx = m.tx - pm.tx, dy = m.ty - pm.ty; - this.x = (dx * pd * pid - dy * pb * pid); - this.y = (dy * pa * pid - dx * pc * pid); - var ia = pid * pd; - var id = pid * pa; - var ib = pid * pb; - var ic = pid * pc; + this.ax = (dx * pm.d * pid - dy * pm.c * pid); + this.ay = (dy * pm.a * pid - dx * pm.b * pid); + var ia = pid * pm.d; + var id = pid * pm.a; + var ib = pid * pm.c; + var ic = pid * pm.b; var ra = ia * m.a - ib * m.b; var rb = ia * m.c - ib * m.d; var rc = id * m.b - ic * m.a; var rd = id * m.d - ic * m.c; - this.shearX = 0; - this.scaleX = Math.sqrt(ra * ra + rc * rc); - if (this.scaleX > 0.0001) { + this.ashearX = 0; + this.ascaleX = Math.sqrt(ra * ra + rc * rc); + if (this.ascaleX > 0.0001) { var det = ra * rd - rb * rc; - this.scaleY = det / this.scaleX; - this.shearY = Math.atan2(ra * rb + rc * rd, det) * Utils_1.MathUtils.radDeg; - this.rotation = Math.atan2(rc, ra) * Utils_1.MathUtils.radDeg; + this.ascaleY = det / this.ascaleX; + this.ashearY = Math.atan2(ra * rb + rc * rd, det) * Utils_1.MathUtils.radDeg; + this.arotation = Math.atan2(rc, ra) * Utils_1.MathUtils.radDeg; } else { - this.scaleX = 0; - this.scaleY = Math.sqrt(rb * rb + rd * rd); - this.shearY = 0; - this.rotation = 90 - Math.atan2(rd, rb) * Utils_1.MathUtils.radDeg; + this.ascaleX = 0; + this.ascaleY = Math.sqrt(rb * rb + rd * rd); + this.ashearY = 0; + this.arotation = 90 - Math.atan2(rd, rb) * Utils_1.MathUtils.radDeg; } - this.appliedRotation = this.rotation; }; Bone.prototype.worldToLocal = function (world) { var m = this.matrix; @@ -1614,7 +1729,7 @@ var Bone = (function () { return Bone; }()); exports.Bone = Bone; -},{"./Utils":26}],7:[function(require,module,exports){ +},{"./BoneData":8,"./Utils":26}],8:[function(require,module,exports){ "use strict"; var BoneData = (function () { function BoneData(index, name, parent) { @@ -1625,8 +1740,7 @@ var BoneData = (function () { this.scaleY = 1; this.shearX = 0; this.shearY = 0; - this.inheritRotation = true; - this.inheritScale = true; + this.transformMode = TransformMode.Normal; if (index < 0) throw new Error("index must be >= 0."); if (name == null) @@ -1638,7 +1752,17 @@ var BoneData = (function () { return BoneData; }()); exports.BoneData = BoneData; -},{}],8:[function(require,module,exports){ +(function (TransformMode) { + TransformMode[TransformMode["Normal"] = 0] = "Normal"; + TransformMode[TransformMode["OnlyTranslation"] = 1] = "OnlyTranslation"; + TransformMode[TransformMode["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; + TransformMode[TransformMode["NoScale"] = 3] = "NoScale"; + TransformMode[TransformMode["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; + TransformMode[TransformMode["InheritRotation"] = 5] = "InheritRotation"; + TransformMode[TransformMode["InheritScale"] = 6] = "InheritScale"; +})(exports.TransformMode || (exports.TransformMode = {})); +var TransformMode = exports.TransformMode; +},{}],9:[function(require,module,exports){ "use strict"; var Event = (function () { function Event(time, data) { @@ -1650,7 +1774,7 @@ var Event = (function () { return Event; }()); exports.Event = Event; -},{}],9:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ "use strict"; var EventData = (function () { function EventData(name) { @@ -1659,7 +1783,7 @@ var EventData = (function () { return EventData; }()); exports.EventData = EventData; -},{}],10:[function(require,module,exports){ +},{}],11:[function(require,module,exports){ "use strict"; var Utils_1 = require("./Utils"); var IkConstraint = (function () { @@ -1679,6 +1803,9 @@ var IkConstraint = (function () { this.bones.push(skeleton.findBone(data.bones[i].name)); this.target = skeleton.findBone(data.target.name); } + IkConstraint.prototype.getOrder = function () { + return this.data.order; + }; IkConstraint.prototype.apply = function () { this.update(); }; @@ -1695,25 +1822,31 @@ var IkConstraint = (function () { } }; IkConstraint.prototype.apply1 = function (bone, targetX, targetY, alpha) { + if (!bone.appliedValid) + bone.updateAppliedTransform(); var pp = bone.parent.matrix; var id = 1 / (pp.a * pp.d - pp.b * pp.c); var x = targetX - pp.tx, y = targetY - pp.ty; - var tx = (x * pp.d - y * pp.c) * id - bone.x, ty = (y * pp.a - x * pp.b) * id - bone.y; - var rotationIK = Math.atan2(ty, tx) * Utils_1.MathUtils.radDeg - bone.shearX - bone.rotation; - if (bone.scaleX < 0) + var tx = (x * pp.d - y * pp.c) * id - bone.ax, ty = (y * pp.a - x * pp.b) * id - bone.ay; + var rotationIK = Math.atan2(ty, tx) * Utils_1.MathUtils.radDeg - bone.ashearX - bone.arotation; + if (bone.ascaleX < 0) rotationIK += 180; if (rotationIK > 180) rotationIK -= 360; else if (rotationIK < -180) rotationIK += 360; - bone.updateWorldTransformWith(bone.x, bone.y, bone.rotation + rotationIK * alpha, bone.scaleX, bone.scaleY, bone.shearX, bone.shearY); + bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, bone.ascaleX, bone.ascaleY, bone.ashearX, bone.ashearY); }; IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, alpha) { if (alpha == 0) { child.updateWorldTransform(); return; } - var px = parent.x, py = parent.y, psx = parent.scaleX, psy = parent.scaleY, csx = child.scaleX; + if (!parent.appliedValid) + parent.updateAppliedTransform(); + if (!child.appliedValid) + child.updateAppliedTransform(); + var px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, csx = child.ascaleX; var os1 = 0, os2 = 0, s2 = 0; if (psx < 0) { psx = -psx; @@ -1735,7 +1868,7 @@ var IkConstraint = (function () { else os2 = 0; var pm = parent.matrix; - var cx = child.x, cy = 0, cwx = 0, cwy = 0, a = pm.a, b = pm.c, c = pm.b, d = pm.d; + var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pm.a, b = pm.c, c = pm.b, d = pm.d; var u = Math.abs(psx - psy) <= 0.0001; if (!u) { cy = 0; @@ -1743,7 +1876,7 @@ var IkConstraint = (function () { cwy = c * cx + pm.ty; } else { - cy = child.y; + cy = child.ay; cwx = a * cx + b * cy + pm.tx; cwy = c * cx + d * cy + pm.ty; } @@ -1834,28 +1967,29 @@ var IkConstraint = (function () { } } var os = Math.atan2(cy, cx) * s2; - var rotation = parent.rotation; + var rotation = parent.arotation; a1 = (a1 - os) * Utils_1.MathUtils.radDeg + os1 - rotation; if (a1 > 180) a1 -= 360; else if (a1 < -180) a1 += 360; - parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.scaleX, parent.scaleY, 0, 0); - rotation = child.rotation; - a2 = ((a2 + os) * Utils_1.MathUtils.radDeg - child.shearX) * s2 + os2 - rotation; + parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.ascaleX, parent.ascaleY, 0, 0); + rotation = child.arotation; + a2 = ((a2 + os) * Utils_1.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; if (a2 > 180) a2 -= 360; else if (a2 < -180) a2 += 360; - child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.scaleX, child.scaleY, child.shearX, child.shearY); + child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); }; return IkConstraint; }()); exports.IkConstraint = IkConstraint; -},{"./Utils":26}],11:[function(require,module,exports){ +},{"./Utils":26}],12:[function(require,module,exports){ "use strict"; var IkConstraintData = (function () { function IkConstraintData(name) { + this.order = 0; this.bones = new Array(); this.bendDirection = 1; this.mix = 1; @@ -1864,7 +1998,7 @@ var IkConstraintData = (function () { return IkConstraintData; }()); exports.IkConstraintData = IkConstraintData; -},{}],12:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ "use strict"; var PathConstraintData_1 = require("./PathConstraintData"); var attachments_1 = require("./attachments"); @@ -1933,15 +2067,13 @@ var PathConstraint = (function () { spaces[i] = spacing; } var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == PathConstraintData_1.PositionMode.Percent, spacingMode == PathConstraintData_1.SpacingMode.Percent); - var skeleton = this.target.bone.skeleton; - var skeletonX = skeleton.x, skeletonY = skeleton.y; var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; var tip = rotateMode == PathConstraintData_1.RotateMode.Chain && offsetRotation == 0; for (var i = 0, p = 3; i < boneCount; i++, p += 3) { var bone = bones[i]; var m = bone.matrix; - m.tx += (boneX - skeletonX - bone.worldX) * translateMix; - m.ty += (boneY - skeletonY - bone.worldY) * translateMix; + m.tx += (boneX - m.tx) * translateMix; + m.ty += (boneY - m.ty) * translateMix; var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; if (scale) { var length_2 = lengths[i]; @@ -1981,6 +2113,7 @@ var PathConstraint = (function () { m.b = sin * a + cos * c; m.d = sin * b + cos * d; } + bone.appliedValid = false; } }; PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) { @@ -2207,7 +2340,7 @@ var PathConstraint = (function () { out[o + 2] = r; }; PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { - if (p == 0) + if (p == 0 || isNaN(p)) p = 0.0001; var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; @@ -2217,16 +2350,20 @@ var PathConstraint = (function () { if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); }; + PathConstraint.prototype.getOrder = function () { + return this.data.order; + }; PathConstraint.NONE = -1; PathConstraint.BEFORE = -2; PathConstraint.AFTER = -3; return PathConstraint; }()); exports.PathConstraint = PathConstraint; -},{"./PathConstraintData":13,"./Utils":26,"./attachments":33}],13:[function(require,module,exports){ +},{"./PathConstraintData":14,"./Utils":26,"./attachments":33}],14:[function(require,module,exports){ "use strict"; var PathConstraintData = (function () { function PathConstraintData(name) { + this.order = 0; this.bones = new Array(); this.name = name; } @@ -2250,7 +2387,7 @@ var SpacingMode = exports.SpacingMode; RotateMode[RotateMode["ChainScale"] = 2] = "ChainScale"; })(exports.RotateMode || (exports.RotateMode = {})); var RotateMode = exports.RotateMode; -},{}],14:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ "use strict"; var Slot_1 = require("./Slot"); var Bone_1 = require("./Bone"); @@ -2262,6 +2399,7 @@ var attachments_1 = require("./attachments"); var Skeleton = (function () { function Skeleton(data) { this._updateCache = new Array(); + this.updateCacheReset = new Array(); this.time = 0; this.flipX = false; this.flipY = false; @@ -2293,7 +2431,6 @@ var Skeleton = (function () { this.drawOrder.push(slot); } this.ikConstraints = new Array(); - this.ikConstraintsSorted = new Array(); for (var i = 0; i < data.ikConstraints.length; i++) { var ikConstraintData = data.ikConstraints[i]; this.ikConstraints.push(new IkConstraint_1.IkConstraint(ikConstraintData, this)); @@ -2317,82 +2454,87 @@ var Skeleton = (function () { var bones = this.bones; for (var i = 0, n = bones.length; i < n; i++) bones[i].sorted = false; - var ikConstraints = this.ikConstraintsSorted; - ikConstraints.length = 0; - for (var i = 0; i < this.ikConstraints.length; i++) - ikConstraints.push(this.ikConstraints[i]); - var ikCount = ikConstraints.length; - for (var i = 0, level = 0, n = ikCount; i < n; i++) { - var ik = ikConstraints[i]; - var bone = ik.bones[0].parent; - for (level = 0; bone != null; level++) - bone = bone.parent; - ik.level = level; - } - for (var i = 1, ii = 0; i < ikCount; i++) { - var ik = ikConstraints[i]; - var level = ik.level; - for (ii = i - 1; ii >= 0; ii--) { - var other = ikConstraints[ii]; - if (other.level < level) - break; - ikConstraints[ii + 1] = other; - } - ikConstraints[ii + 1] = ik; - } - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var constraint = ikConstraints[i]; - var target = constraint.target; - this.sortBone(target); - var constrained = constraint.bones; - var parent_2 = constrained[0]; - this.sortBone(parent_2); - updateCache.push(constraint); - this.sortReset(parent_2.children); - constrained[constrained.length - 1].sorted = true; - } - var pathConstraints = this.pathConstraints; - for (var i = 0, n = pathConstraints.length; i < n; i++) { - var constraint = pathConstraints[i]; - var slot = constraint.target; - var slotIndex = slot.data.index; - var slotBone = slot.bone; - if (this.skin != null) - this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); - if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) - this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); - for (var ii = 0, nn = this.data.skins.length; ii < nn; ii++) - this.sortPathConstraintAttachment(this.data.skins[ii], slotIndex, slotBone); - var attachment = slot.getAttachment(); - if (attachment instanceof attachments_1.PathAttachment) - this.sortPathConstraintAttachmentWith(attachment, slotBone); - var constrained = constraint.bones; - var boneCount = constrained.length; - for (var ii = 0; ii < boneCount; ii++) - this.sortBone(constrained[ii]); - updateCache.push(constraint); - for (var ii = 0; ii < boneCount; ii++) - this.sortReset(constrained[ii].children); - for (var ii = 0; ii < boneCount; ii++) - constrained[ii].sorted = true; - } + var ikConstraints = this.ikConstraints; var transformConstraints = this.transformConstraints; - for (var i = 0, n = transformConstraints.length; i < n; i++) { - var constraint = transformConstraints[i]; - this.sortBone(constraint.target); - var constrained = constraint.bones; - var boneCount = constrained.length; - for (var ii = 0; ii < boneCount; ii++) - this.sortBone(constrained[ii]); - updateCache.push(constraint); - for (var ii = 0; ii < boneCount; ii++) - this.sortReset(constrained[ii].children); - for (var ii = 0; ii < boneCount; ii++) - constrained[ii].sorted = true; + var pathConstraints = this.pathConstraints; + var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length; + var constraintCount = ikCount + transformCount + pathCount; + outer: for (var i = 0; i < constraintCount; i++) { + for (var ii = 0; ii < ikCount; ii++) { + var constraint = ikConstraints[ii]; + if (constraint.data.order == i) { + this.sortIkConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < transformCount; ii++) { + var constraint = transformConstraints[ii]; + if (constraint.data.order == i) { + this.sortTransformConstraint(constraint); + continue outer; + } + } + for (var ii = 0; ii < pathCount; ii++) { + var constraint = pathConstraints[ii]; + if (constraint.data.order == i) { + this.sortPathConstraint(constraint); + continue outer; + } + } } for (var i = 0, n = bones.length; i < n; i++) this.sortBone(bones[i]); }; + Skeleton.prototype.sortIkConstraint = function (constraint) { + var target = constraint.target; + this.sortBone(target); + var constrained = constraint.bones; + var parent = constrained[0]; + this.sortBone(parent); + if (constrained.length > 1) { + var child = constrained[constrained.length - 1]; + if (!(this._updateCache.indexOf(child) > -1)) + this.updateCacheReset.push(child); + } + this._updateCache.push(constraint); + this.sortReset(parent.children); + constrained[constrained.length - 1].sorted = true; + }; + Skeleton.prototype.sortPathConstraint = function (constraint) { + var slot = constraint.target; + var slotIndex = slot.data.index; + var slotBone = slot.bone; + if (this.skin != null) + this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); + if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin) + this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); + for (var ii = 0, nn = this.data.skins.length; ii < nn; ii++) + this.sortPathConstraintAttachment(this.data.skins[ii], slotIndex, slotBone); + var attachment = slot.getAttachment(); + if (attachment instanceof attachments_1.PathAttachment) + this.sortPathConstraintAttachmentWith(attachment, slotBone); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var ii = 0; ii < boneCount; ii++) + this.sortBone(constrained[ii]); + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; + Skeleton.prototype.sortTransformConstraint = function (constraint) { + this.sortBone(constraint.target); + var constrained = constraint.bones; + var boneCount = constrained.length; + for (var ii = 0; ii < boneCount; ii++) + this.sortBone(constrained[ii]); + this._updateCache.push(constraint); + for (var ii = 0; ii < boneCount; ii++) + this.sortReset(constrained[ii].children); + for (var ii = 0; ii < boneCount; ii++) + constrained[ii].sorted = true; + }; Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) { var attachments = skin.attachments[slotIndex]; if (!attachments) @@ -2409,9 +2551,13 @@ var Skeleton = (function () { this.sortBone(slotBone); else { var bones = this.bones; - for (var i = 0; i < pathBones.length; i++) { - var boneIndex = pathBones[i]; - this.sortBone(bones[boneIndex]); + var i = 0; + while (i < pathBones.length) { + var boneCount = pathBones[i++]; + for (var n = i + boneCount; i < n; i++) { + var boneIndex = pathBones[i]; + this.sortBone(bones[boneIndex]); + } } } }; @@ -2433,6 +2579,18 @@ var Skeleton = (function () { } }; Skeleton.prototype.updateWorldTransform = function () { + var updateCacheReset = this.updateCacheReset; + for (var i = 0, n = updateCacheReset.length; i < n; i++) { + var bone = updateCacheReset[i]; + bone.ax = bone.x; + bone.ay = bone.y; + bone.arotation = bone.rotation; + bone.ascaleX = bone.scaleX; + bone.ascaleY = bone.scaleY; + bone.ashearX = bone.shearX; + bone.ashearY = bone.shearY; + bone.appliedValid = true; + } var updateCache = this._updateCache; for (var i = 0, n = updateCache.length; i < n; i++) updateCache[i].update(); @@ -2647,7 +2805,7 @@ var Skeleton = (function () { return Skeleton; }()); exports.Skeleton = Skeleton; -},{"./Bone":6,"./IkConstraint":10,"./PathConstraint":12,"./Slot":19,"./TransformConstraint":24,"./Utils":26,"./attachments":33}],15:[function(require,module,exports){ +},{"./Bone":7,"./IkConstraint":11,"./PathConstraint":13,"./Slot":20,"./TransformConstraint":24,"./Utils":26,"./attachments":33}],16:[function(require,module,exports){ "use strict"; var Utils_1 = require("./Utils"); var attachments_1 = require("./attachments"); @@ -2807,7 +2965,7 @@ var SkeletonBounds = (function () { return SkeletonBounds; }()); exports.SkeletonBounds = SkeletonBounds; -},{"./Utils":26,"./attachments":33}],16:[function(require,module,exports){ +},{"./Utils":26,"./attachments":33}],17:[function(require,module,exports){ "use strict"; var SkeletonData = (function () { function SkeletonData() { @@ -2819,6 +2977,7 @@ var SkeletonData = (function () { this.ikConstraints = new Array(); this.transformConstraints = new Array(); this.pathConstraints = new Array(); + this.fps = 0; } SkeletonData.prototype.findBone = function (boneName) { if (boneName == null) @@ -2938,7 +3097,7 @@ var SkeletonData = (function () { return SkeletonData; }()); exports.SkeletonData = SkeletonData; -},{}],17:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ "use strict"; var SkeletonData_1 = require("./SkeletonData"); var BoneData_1 = require("./BoneData"); @@ -2967,6 +3126,7 @@ var SkeletonJson = (function () { skeletonData.version = skeletonMap.spine; skeletonData.width = skeletonMap.width; skeletonData.height = skeletonMap.height; + skeletonData.fps = skeletonMap.fps; skeletonData.imagesPath = skeletonMap.images; } if (root.bones) { @@ -2988,8 +3148,12 @@ var SkeletonJson = (function () { data.scaleY = this.getValue(boneMap, "scaleY", 1); data.shearX = this.getValue(boneMap, "shearX", 0); data.shearY = this.getValue(boneMap, "shearY", 0); - data.inheritRotation = this.getValue(boneMap, "inheritRotation", true); - data.inheritScale = this.getValue(boneMap, "inheritScale", true); + if (boneMap.hasOwnProperty("inheritScale") || boneMap.hasOwnProperty("inheritRotation")) { + data.transformMode = SkeletonJson.transformModeLegacy(this.getValue(boneMap, "inheritRotation", true), this.getValue(boneMap, "inheritScale", true)); + } + else { + data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, "transform", "normal")); + } skeletonData.bones.push(data); } } @@ -3014,6 +3178,7 @@ var SkeletonJson = (function () { for (var i = 0; i < root.ik.length; i++) { var constraintMap = root.ik[i]; var data = new IkConstraintData_1.IkConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); for (var j = 0; j < constraintMap.bones.length; j++) { var boneName = constraintMap.bones[j]; var bone = skeletonData.findBone(boneName); @@ -3034,6 +3199,7 @@ var SkeletonJson = (function () { for (var i = 0; i < root.transform.length; i++) { var constraintMap = root.transform[i]; var data = new TransformConstraintData_1.TransformConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); for (var j = 0; j < constraintMap.bones.length; j++) { var boneName = constraintMap.bones[j]; var bone = skeletonData.findBone(boneName); @@ -3062,6 +3228,7 @@ var SkeletonJson = (function () { for (var i = 0; i < root.path.length; i++) { var constraintMap = root.path[i]; var data = new PathConstraintData_1.PathConstraintData(constraintMap.name); + data.order = this.getValue(constraintMap, "order", 0); for (var j = 0; j < constraintMap.bones.length; j++) { var boneName = constraintMap.bones[j]; var bone = skeletonData.findBone(boneName); @@ -3578,6 +3745,34 @@ var SkeletonJson = (function () { return PathConstraintData_1.RotateMode.ChainScale; throw new Error("Unknown rotate mode: " + str); }; + SkeletonJson.transformModeFromString = function (str) { + str = str.toLowerCase(); + if (str == "normal") + return BoneData_1.TransformMode.Normal; + if (str == "onlytranslation") + return BoneData_1.TransformMode.OnlyTranslation; + if (str == "norotationorreflection") + return BoneData_1.TransformMode.NoRotationOrReflection; + if (str == "noscale") + return BoneData_1.TransformMode.NoScale; + if (str == "noscaleorreflection") + return BoneData_1.TransformMode.NoScaleOrReflection; + throw new Error("Unknown transform mode: " + str); + }; + SkeletonJson.transformModeLegacy = function (inheritRotation, inheritScale) { + if (inheritRotation && inheritScale) { + return BoneData_1.TransformMode.Normal; + } + else if (inheritRotation) { + return BoneData_1.TransformMode.InheritRotation; + } + else if (inheritScale) { + return BoneData_1.TransformMode.InheritScale; + } + else { + return BoneData_1.TransformMode.OnlyTranslation; + } + }; return SkeletonJson; }()); exports.SkeletonJson = SkeletonJson; @@ -3590,7 +3785,7 @@ var LinkedMesh = (function () { } return LinkedMesh; }()); -},{"./Animation":2,"./BoneData":7,"./Event":8,"./EventData":9,"./IkConstraintData":11,"./PathConstraintData":13,"./SkeletonData":16,"./Skin":18,"./SlotData":20,"./TransformConstraintData":25,"./Utils":26}],18:[function(require,module,exports){ +},{"./Animation":2,"./BoneData":8,"./Event":9,"./EventData":10,"./IkConstraintData":12,"./PathConstraintData":14,"./SkeletonData":17,"./Skin":19,"./SlotData":21,"./TransformConstraintData":25,"./Utils":26}],19:[function(require,module,exports){ "use strict"; var Skin = (function () { function Skin(name) { @@ -3636,7 +3831,7 @@ var Skin = (function () { return Skin; }()); exports.Skin = Skin; -},{}],19:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ "use strict"; var Utils_1 = require("./Utils"); var Slot = (function () { @@ -3680,7 +3875,7 @@ var Slot = (function () { return Slot; }()); exports.Slot = Slot; -},{"./Utils":26}],20:[function(require,module,exports){ +},{"./Utils":26}],21:[function(require,module,exports){ "use strict"; var Utils_1 = require("./Utils"); var SlotData = (function () { @@ -3699,7 +3894,7 @@ var SlotData = (function () { return SlotData; }()); exports.SlotData = SlotData; -},{"./Utils":26}],21:[function(require,module,exports){ +},{"./Utils":26}],22:[function(require,module,exports){ "use strict"; var Texture = (function () { function Texture(image) { @@ -3891,7 +4086,7 @@ var TextureRegion = (function () { return TextureRegion; }()); exports.TextureRegion = TextureRegion; -},{}],22:[function(require,module,exports){ +},{}],23:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -4133,39 +4328,7 @@ var TextureAtlasRegion = (function (_super) { return TextureAtlasRegion; }(Texture_1.TextureRegion)); exports.TextureAtlasRegion = TextureAtlasRegion; -},{"./Texture":21}],23:[function(require,module,exports){ -"use strict"; -var attachments_1 = require("./attachments"); -var TextureAtlasAttachmentLoader = (function () { - function TextureAtlasAttachmentLoader(atlas) { - this.atlas = atlas; - } - TextureAtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); - var attachment = new attachments_1.RegionAttachment(name); - attachment.region = region; - return attachment; - }; - TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); - var attachment = new attachments_1.MeshAttachment(name); - attachment.region = region; - return attachment; - }; - TextureAtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) { - return new attachments_1.BoundingBoxAttachment(name); - }; - TextureAtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) { - return new attachments_1.PathAttachment(name); - }; - return TextureAtlasAttachmentLoader; -}()); -exports.TextureAtlasAttachmentLoader = TextureAtlasAttachmentLoader; -},{"./attachments":33}],24:[function(require,module,exports){ +},{"./Texture":22}],24:[function(require,module,exports){ "use strict"; var Utils_1 = require("./Utils"); var TransformConstraint = (function () { @@ -4195,13 +4358,13 @@ var TransformConstraint = (function () { TransformConstraint.prototype.update = function () { var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix; var target = this.target; - var tm = target.matrix; - var ta = tm.a, tb = tm.c, tc = tm.b, td = tm.d; + var ta = target.matrix.a, tb = target.matrix.c, tc = target.matrix.b, td = target.matrix.d; var bones = this.bones; for (var i = 0, n = bones.length; i < n; i++) { var bone = bones[i]; var m = bone.matrix; - if (rotateMix > 0) { + var modified = false; + if (rotateMix != 0) { var a = m.a, b = m.c, c = m.b, d = m.d; var r = Math.atan2(tc, ta) - Math.atan2(c, a) + this.data.offsetRotation * Utils_1.MathUtils.degRad; if (r > Utils_1.MathUtils.PI) @@ -4214,24 +4377,29 @@ var TransformConstraint = (function () { m.c = cos * b - sin * d; m.b = sin * a + cos * c; m.d = sin * b + cos * d; + modified = true; } - if (translateMix > 0) { + if (translateMix != 0) { var temp = this.temp; target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - m.tx += (temp.x - bone.worldX) * translateMix; - m.ty += (temp.y - bone.worldY) * translateMix; + m.tx += (temp.x - m.tx) * translateMix; + m.ty += (temp.y - m.ty) * translateMix; + modified = true; } if (scaleMix > 0) { - var bs = Math.sqrt(m.a * m.a + m.b * m.b); + var s = Math.sqrt(m.a * m.a + m.b * m.b); var ts = Math.sqrt(ta * ta + tc * tc); - var s = bs > 0.00001 ? (bs + (ts - bs + this.data.offsetScaleX) * scaleMix) / bs : 0; + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s; m.a *= s; m.b *= s; - bs = Math.sqrt(m.c * m.c + m.d * m.d); + s = Math.sqrt(m.c * m.c + m.d * m.d); ts = Math.sqrt(tb * tb + td * td); - s = bs > 0.00001 ? (bs + (ts - bs + this.data.offsetScaleY) * scaleMix) / bs : 0; + if (s > 0.00001) + s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s; m.c *= s; m.d *= s; + modified = true; } if (shearMix > 0) { var b = m.c, d = m.d; @@ -4245,9 +4413,15 @@ var TransformConstraint = (function () { var s = Math.sqrt(b * b + d * d); m.c = Math.cos(r) * s; m.d = Math.sin(r) * s; + modified = true; } + if (modified) + bone.appliedValid = false; } }; + TransformConstraint.prototype.getOrder = function () { + return this.data.order; + }; return TransformConstraint; }()); exports.TransformConstraint = TransformConstraint; @@ -4255,6 +4429,7 @@ exports.TransformConstraint = TransformConstraint; "use strict"; var TransformConstraintData = (function () { function TransformConstraintData(name) { + this.order = 0; this.bones = new Array(); this.rotateMix = 0; this.translateMix = 0; @@ -4541,7 +4716,6 @@ var VertexAttachment = (function (_super) { VertexAttachment.prototype.computeWorldVerticesWith = function (slot, start, count, worldVertices, offset) { count += offset; var skeleton = slot.bone.skeleton; - var x = skeleton.x, y = skeleton.y; var deformArray = slot.attachmentVertices; var vertices = this.vertices; var bones = this.bones; @@ -4550,8 +4724,8 @@ var VertexAttachment = (function (_super) { vertices = deformArray; var bone = slot.bone; var m = bone.matrix; - x += m.tx; - y += m.ty; + var x = m.tx; + var y = m.ty; var a = m.a, b = m.c, c = m.b, d = m.d; for (var v_1 = start, w = offset; w < count; v_1 += 2, w += 2) { var vx = vertices[v_1], vy = vertices[v_1 + 1]; @@ -4569,7 +4743,7 @@ var VertexAttachment = (function (_super) { var skeletonBones = skeleton.bones; if (deformArray.length == 0) { for (var w = offset, b = skip * 3; w < count; w += 2) { - var wx = x, wy = y; + var wx = 0, wy = 0; var n = bones[v++]; n += v; for (; v < n; v++, b += 3) { @@ -4586,7 +4760,7 @@ var VertexAttachment = (function (_super) { else { var deform = deformArray; for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += 2) { - var wx = x, wy = y; + var wx = 0, wy = 0; var n = bones[v++]; n += v; for (; v < n; v++, b += 3, f += 2) { @@ -4792,6 +4966,7 @@ var Bone_1 = require("./Bone"); exports.Bone = Bone_1.Bone; var BoneData_1 = require("./BoneData"); exports.BoneData = BoneData_1.BoneData; +exports.TransformMode = BoneData_1.TransformMode; var Event_1 = require("./Event"); exports.Event = Event_1.Event; var EventData_1 = require("./EventData"); @@ -4829,8 +5004,8 @@ exports.TextureFilter = Texture_1.TextureFilter; var TextureAtlas_1 = require("./TextureAtlas"); exports.TextureAtlas = TextureAtlas_1.TextureAtlas; exports.TextureAtlasRegion = TextureAtlas_1.TextureAtlasRegion; -var TextureAtlasAttachmentLoader_1 = require("./TextureAtlasAttachmentLoader"); -exports.TextureAtlasAttachmentLoader = TextureAtlasAttachmentLoader_1.TextureAtlasAttachmentLoader; +var AtlasAttachmentLoader_1 = require("./AtlasAttachmentLoader"); +exports.AtlasAttachmentLoader = AtlasAttachmentLoader_1.AtlasAttachmentLoader; var TransformConstraint_1 = require("./TransformConstraint"); exports.TransformConstraint = TransformConstraint_1.TransformConstraint; var TransformConstraintData_1 = require("./TransformConstraintData"); @@ -4841,7 +5016,7 @@ exports.Pool = Utils_1.Pool; exports.MathUtils = Utils_1.MathUtils; exports.Color = Utils_1.Color; exports.Vector2 = Utils_1.Vector2; -},{"./Animation":2,"./AnimationState":3,"./AnimationStateData":4,"./BlendMode":5,"./Bone":6,"./BoneData":7,"./Event":8,"./EventData":9,"./IkConstraint":10,"./IkConstraintData":11,"./PathConstraint":12,"./PathConstraintData":13,"./Skeleton":14,"./SkeletonBounds":15,"./SkeletonData":16,"./SkeletonJson":17,"./Skin":18,"./Slot":19,"./SlotData":20,"./Texture":21,"./TextureAtlas":22,"./TextureAtlasAttachmentLoader":23,"./TransformConstraint":24,"./TransformConstraintData":25,"./Utils":26,"./attachments":33}],35:[function(require,module,exports){ +},{"./Animation":2,"./AnimationState":3,"./AnimationStateData":4,"./AtlasAttachmentLoader":5,"./BlendMode":6,"./Bone":7,"./BoneData":8,"./Event":9,"./EventData":10,"./IkConstraint":11,"./IkConstraintData":12,"./PathConstraint":13,"./PathConstraintData":14,"./Skeleton":15,"./SkeletonBounds":16,"./SkeletonData":17,"./SkeletonJson":18,"./Skin":19,"./Slot":20,"./SlotData":21,"./Texture":22,"./TextureAtlas":23,"./TransformConstraint":24,"./TransformConstraintData":25,"./Utils":26,"./attachments":33}],35:[function(require,module,exports){ "use strict"; var spine = require("./core"); function atlasParser() { @@ -4854,7 +5029,7 @@ function atlasParser() { return next(); } if (metadataAtlas && metadataAtlas.pages) { - var spineJsonParser = new spine.SkeletonJson(new spine.TextureAtlasAttachmentLoader(metadataAtlas)); + var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(metadataAtlas)); var skeletonData = spineJsonParser.readSkeletonData(resource.data); resource.spineData = skeletonData; resource.spineAtlas = metadataAtlas; @@ -4880,7 +5055,7 @@ function atlasParser() { var adapter = imageLoaderAdapter(this, resource.name + '_atlas_page_', baseUrl, imageOptions); this.add(resource.name + '_atlas', atlasPath, atlasOptions, function () { new spine.TextureAtlas(this.xhr.responseText, adapter, function (spineAtlas) { - var spineJsonParser = new spine.SkeletonJson(new spine.TextureAtlasAttachmentLoader(spineAtlas)); + var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(spineAtlas)); var skeletonData = spineJsonParser.readSkeletonData(resource.data); resource.spineData = skeletonData; resource.spineAtlas = spineAtlas; diff --git a/bin/pixi-spine.js.map b/bin/pixi-spine.js.map index f716c321..704d0c50 100644 --- a/bin/pixi-spine.js.map +++ b/bin/pixi-spine.js.map @@ -1 +1 @@ -{"version":3,"sources":["../pixify/node_modules/browser-pack/_prelude.js","src/Spine.ts","src/core/Animation.ts","src/core/AnimationState.ts","src/core/AnimationStateData.ts","src/core/BlendMode.ts","src/core/Bone.ts","src/core/BoneData.ts","src/core/Event.ts","src/core/EventData.ts","src/core/IkConstraint.ts","src/core/IkConstraintData.ts","src/core/PathConstraint.ts","src/core/PathConstraintData.ts","src/core/Skeleton.ts","src/core/SkeletonBounds.ts","src/core/SkeletonData.ts","src/core/SkeletonJson.ts","src/core/Skin.ts","src/core/Slot.ts","src/core/SlotData.ts","src/core/Texture.ts","src/core/TextureAtlas.ts","src/core/TextureAtlasAttachmentLoader.ts","src/core/TransformConstraint.ts","src/core/TransformConstraintData.ts","src/core/Utils.ts","src/core/attachments/Attachment.ts","src/core/attachments/AttachmentType.ts","src/core/attachments/BoundingBoxAttachment.ts","src/core/attachments/MeshAttachment.ts","src/core/attachments/PathAttachment.ts","src/core/attachments/RegionAttachment.ts","src/core/attachments/index.ts","src/core/index.ts","src/loaders.ts","src/index.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;ACAA,IAAY,KAAK,WAAM,QAAQ,CAAC,CAAA;AAIhC,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAGvC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AAExB,IAAI,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExB;IAAiC,+BAAW;IAGxC,qBAAY,GAAiB;QACzB,kBAAM,GAAG,CAAC,CAAC;IACf,CAAC;IACL,kBAAC;AAAD,CANA,AAMC,CANgC,IAAI,CAAC,MAAM,GAM3C;AANY,mBAAW,cAMvB,CAAA;AAED;IAA+B,6BAAc;IAGzC,mBAAY,OAAqB,EAAE,QAA4B,EAAE,GAAuB,EAAE,OAA2B,EAAE,QAAiB;QACpI,kBAAM,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IACL,gBAAC;AAAD,CANA,AAMC,CAN8B,IAAI,CAAC,IAAI,CAAC,IAA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;AACrB,sBAA4C,SAAS,CAAC;AAA9C,8BAAK;AAAE,sCAAS;AAAE,0CAA4B","file":"pixi-spine.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o, uvs?: ArrayLike, indices?: ArrayLike, drawMode?: number) {\n super(texture, vertices, uvs, indices, drawMode);\n }\n}\n\n/**\n * A class that enables the you to import and run your spine animations in pixi.\n * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class\n * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\n *\n * ```js\n * var spineAnimation = new PIXI.Spine(spineData);\n * ```\n *\n * @class\n * @extends Container\n * @memberof PIXI.spine\n * @param spineData {object} The spine data loaded from a spine atlas.\n */\nexport class Spine extends PIXI.Container {\n static globalAutoUpdate: boolean = true;\n\n tintRgb: ArrayLike;\n spineData: spine.SkeletonData;\n skeleton: spine.Skeleton;\n stateData: spine.AnimationStateData;\n state: spine.AnimationState;\n slotContainers: Array;\n\n constructor(spineData: spine.SkeletonData) {\n super();\n\n if (!spineData) {\n throw new Error('The spineData param is required.');\n }\n\n if ((typeof spineData) === \"string\") {\n throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas(\"YOUR_RESOURCE_NAME\") from now on.');\n }\n\n /**\n * The spineData object\n *\n * @member {object}\n */\n this.spineData = spineData;\n\n /**\n * A spine Skeleton object\n *\n * @member {object}\n */\n this.skeleton = new spine.Skeleton(spineData);\n this.skeleton.updateWorldTransform();\n\n /**\n * A spine AnimationStateData object created from the spine data passed in the constructor\n *\n * @member {object}\n */\n this.stateData = new spine.AnimationStateData(spineData);\n\n /**\n * A spine AnimationState object created from the spine AnimationStateData object\n *\n * @member {object}\n */\n this.state = new spine.AnimationState(this.stateData);\n\n /**\n * An array of containers\n *\n * @member {Container[]}\n */\n this.slotContainers = [];\n\n for (var i = 0, n = this.skeleton.slots.length; i < n; i++) {\n var slot = this.skeleton.slots[i];\n var attachment : any = slot.attachment;\n var slotContainer = new PIXI.Container();\n this.slotContainers.push(slotContainer);\n this.addChild(slotContainer);\n\n if (attachment instanceof spine.RegionAttachment) {\n var spriteName = attachment.region.name;\n var sprite = this.createSprite(slot, attachment, spriteName);\n slot.currentSprite = sprite;\n slot.currentSpriteName = spriteName;\n slotContainer.addChild(sprite);\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = this.createMesh(slot, attachment);\n slot.currentMesh = mesh;\n slot.currentMeshName = attachment.name;\n slotContainer.addChild(mesh);\n }\n else {\n continue;\n }\n\n }\n\n /**\n * Should the Spine object update its transforms\n *\n * @member {boolean}\n */\n this.autoUpdate = true;\n\n /**\n * The tint applied to all spine slots. This is a [r,g,b] value. A value of [1,1,1] will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n */\n this.tintRgb = new Float32Array([1, 1, 1]);\n }\n\n /**\n * If this flag is set to true, the spine animation will be autoupdated every time\n * the object id drawn. The down side of this approach is that the delta time is\n * automatically calculated and you could miss out on cool effects like slow motion,\n * pause, skip ahead and the sorts. Most of these effects can be achieved even with\n * autoupdate enabled but are harder to achieve.\n *\n * @member {boolean}\n * @memberof PIXI.spine.Spine#\n * @default true\n */\n get autoUpdate(): boolean {\n return (this.updateTransform === Spine.prototype.autoUpdateTransform);\n }\n\n set autoUpdate(value: boolean) {\n this.updateTransform = value ? Spine.prototype.autoUpdateTransform : PIXI.Container.prototype.updateTransform;\n }\n\n /**\n * The tint applied to the spine object. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n * @default 0xFFFFFF\n */\n get tint(): number {\n return PIXI.utils.rgb2hex(this.tintRgb);\n }\n\n set tint(value: number) {\n this.tintRgb = PIXI.utils.hex2rgb(value, this.tintRgb);\n }\n\n /**\n * Update the spine skeleton and its animations by delta time (dt)\n *\n * @param dt {number} Delta time. Time by which the animation should be updated\n */\n update(dt: number) {\n this.state.update(dt);\n this.state.apply(this.skeleton);\n this.skeleton.updateWorldTransform();\n\n let drawOrder = this.skeleton.drawOrder;\n let slots = this.skeleton.slots;\n\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n this.children[i] = this.slotContainers[drawOrder[i].data.index];\n }\n\n var r0 = this.tintRgb[0];\n var g0 = this.tintRgb[1];\n var b0 = this.tintRgb[2];\n\n for (i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n var attachment = slot.attachment;\n var slotContainer = this.slotContainers[i];\n\n if (!attachment) {\n slotContainer.visible = false;\n continue;\n }\n\n var attColor = (attachment as any).color;\n if (attachment instanceof spine.RegionAttachment) {\n let region = (attachment as spine.RegionAttachment).region;\n if (region) {\n let ar = region as TextureAtlasRegion;\n if (!slot.currentSpriteName || slot.currentSpriteName !== ar.name) {\n var spriteName = ar.name;\n if (slot.currentSprite) {\n slot.currentSprite.visible = false;\n }\n slot.sprites = slot.sprites || {};\n if (slot.sprites[spriteName] !== undefined) {\n slot.sprites[spriteName].visible = true;\n }\n else {\n var sprite = this.createSprite(slot, attachment, spriteName);\n slotContainer.addChild(sprite);\n }\n slot.currentSprite = slot.sprites[spriteName];\n slot.currentSpriteName = spriteName;\n }\n }\n\n if (slotContainer.transform) {\n var transform = slotContainer.transform;\n let lt : PIXI.Matrix;\n if (slotContainer.transform.matrix2d) {\n //gameofbombs pixi fork\n lt = transform.matrix2d;\n transform._dirtyVersion++;\n transform.version = transform._dirtyVersion;\n transform.isStatic = true;\n transform.operMode = 0;\n } else {\n if (TransformBase) {\n //PIXI v4.0\n if (transform.position) {\n transform = new PIXI.TransformBase();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n } else {\n //PIXI v4.0rc\n if (!transform._dirtyLocal) {\n transform = new PIXI.TransformStatic();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n transform._dirtyParentVersion = -1;\n transform._dirtyLocal = 1;\n transform._versionLocal = 1;\n }\n }\n slot.bone.matrix.copy(lt);\n lt.tx += slot.bone.skeleton.x;\n lt.ty += slot.bone.skeleton.y;\n } else {\n //PIXI v3\n var lt = slotContainer.localTransform || new PIXI.Matrix();\n slot.bone.matrix.copy(lt);\n lt.tx += slot.bone.skeleton.x;\n lt.ty += slot.bone.skeleton.y;\n slotContainer.localTransform = lt;\n slotContainer.displayObjectUpdateTransform = SlotContainerUpdateTransformV3;\n }\n tempRgb[0] = r0 * slot.color.r * attColor.r;\n tempRgb[1] = g0 * slot.color.g * attColor.g;\n tempRgb[2] = b0 * slot.color.b * attColor.b;\n slot.currentSprite.tint = PIXI.utils.rgb2hex(tempRgb);\n slot.currentSprite.blendMode = slot.blendMode;\n }\n else if (attachment instanceof spine.MeshAttachment) {\n if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) {\n var meshName = attachment.name;\n if (slot.currentMesh) {\n slot.currentMesh.visible = false;\n }\n\n slot.meshes = slot.meshes || {};\n\n if (slot.meshes[meshName] !== undefined) {\n slot.meshes[meshName].visible = true;\n }\n else {\n var mesh = this.createMesh(slot, attachment);\n slotContainer.addChild(mesh);\n }\n\n slot.currentMesh = slot.meshes[meshName];\n slot.currentMeshName = meshName;\n }\n (attachment as VertexAttachment).computeWorldVertices(slot, slot.currentMesh.vertices);\n if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // slot.currentMesh.dirty++;\n //only for PIXI v4\n var tintRgb = slot.currentMesh.tintRgb;\n tintRgb[0] = r0 * slot.color.r * attColor.r;\n tintRgb[1] = g0 * slot.color.g * attColor.g;\n tintRgb[2] = b0 * slot.color.b * attColor.b;\n }\n slot.currentMesh.blendMode = slot.blendMode;\n }\n else {\n slotContainer.visible = false;\n continue;\n }\n slotContainer.visible = true;\n\n slotContainer.alpha = slot.color.a;\n }\n };\n\n private setSpriteRegion(attachment: spine.RegionAttachment, sprite: SpineSprite, region: spine.TextureRegion) {\n sprite.region = region;\n sprite.texture = region.texture;\n if (!region.size) {\n sprite.scale.x = attachment.scaleX * attachment.width / region.originalWidth;\n sprite.scale.y = -attachment.scaleY * attachment.height / region.originalHeight;\n } else {\n //hacked!\n sprite.scale.x = region.size.width / region.originalWidth;\n sprite.scale.y = -region.size.height / region.originalHeight;\n }\n }\n\n private setMeshRegion(attachment: spine.MeshAttachment, mesh: SpineMesh, region: spine.TextureRegion) {\n mesh.region = region;\n mesh.texture = region.texture;\n attachment.updateUVs(region, mesh.uvs);\n // if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // mesh.indexDirty++;\n // } else {\n // PIXI version 3\n mesh.dirty++;\n // }\n }\n\n protected lastTime: number;\n\n /**\n * When autoupdate is set to yes this function is used as pixi's updateTransform function\n *\n * @private\n */\n autoUpdateTransform() {\n if (Spine.globalAutoUpdate) {\n this.lastTime = this.lastTime || Date.now();\n var timeDelta = (Date.now() - this.lastTime) * 0.001;\n this.lastTime = Date.now();\n this.update(timeDelta);\n } else {\n this.lastTime = 0;\n }\n\n PIXI.Container.prototype.updateTransform.call(this);\n };\n\n /**\n * Create a new sprite to be used with spine.RegionAttachment\n *\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createSprite(slot: spine.Slot, attachment: spine.RegionAttachment, defName: string) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n var texture = region.texture;\n var sprite = new SpineSprite(texture);\n sprite.rotation = attachment.rotation * spine.MathUtils.degRad;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n sprite.position.x = attachment.x;\n sprite.position.y = attachment.y;\n sprite.alpha = attachment.color.a;\n\n sprite.region = attachment.region;\n this.setSpriteRegion(attachment, sprite, attachment.region);\n\n slot.sprites = slot.sprites || {};\n slot.sprites[defName] = sprite;\n return sprite;\n };\n\n /**\n * Creates a Strip from the spine data\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createMesh(slot: spine.Slot, attachment: spine.MeshAttachment) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n let strip = new SpineMesh(\n region.texture,\n new Float32Array(attachment.regionUVs.length),\n new Float32Array(attachment.regionUVs.length),\n new Uint16Array(attachment.triangles),\n PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);\n\n strip.canvasPadding = 1.5;\n\n strip.alpha = attachment.color.a;\n\n strip.region = attachment.region;\n this.setMeshRegion(attachment, strip, region);\n\n slot.meshes = slot.meshes || {};\n slot.meshes[attachment.name] = strip;\n return strip;\n };\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotIndex {number}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotIndex(slotIndex: number, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var slot = this.skeleton.slots[slotIndex];\n if (!slot) {\n return false;\n }\n var attachment: any = slot.attachment;\n var region: spine.TextureRegion = attachment.region;\n if (texture) {\n region = new spine.TextureRegion();\n region.texture = texture;\n region.size = size;\n }\n if (slot.currentSprite && slot.currentSprite.region != region) {\n this.setSpriteRegion(attachment, slot.currentSprite, region);\n slot.currentSprite.region = region;\n } else\n if (slot.currentMesh && slot.currentMesh.region != region) {\n this.setMeshRegion(attachment, slot.currentMesh, region);\n } else {\n slot.tempRegion = region;\n slot.tempAttachment = attachment;\n }\n return true;\n }\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotName {string}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotName = function (slotName: String, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var index = this.skeleton.findSlotIndex(slotName);\n if (index == -1) {\n return false;\n }\n return this.hackTextureBySlotIndex(index, texture, size);\n }\n}\n\nfunction SlotContainerUpdateTransformV3() {\n var pt = this.parent.worldTransform;\n var wt = this.worldTransform;\n var lt = this.localTransform;\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n this._currentBounds = null;\n}\n","import {Event} from \"./Event\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {PathConstraint} from \"./PathConstraint\";\r\nimport {Utils, MathUtils, Color} from \"./Utils\";\r\nimport {TransformConstraint} from \"./TransformConstraint\";\r\nimport {IkConstraint} from \"./IkConstraint\";\r\nimport {VertexAttachment, Attachment} from \"./attachments\";\r\nimport {Slot} from \"./Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Animation {\r\n name: string;\r\n timelines: Array;\r\n duration: number;\r\n\r\n constructor (name: string, timelines: Array, duration: number) {\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n if (timelines == null) throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.duration = duration;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0) lastTime %= this.duration;\r\n }\r\n\r\n let timelines = this.timelines;\r\n for (let i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, 1);\r\n }\r\n\r\n mix (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0) lastTime %= this.duration;\r\n }\r\n\r\n let timelines = this.timelines;\r\n for (let i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha);\r\n }\r\n\r\n static binarySearch (values: ArrayLike, target: number, step: number = 1) {\r\n let low = 0;\r\n let high = values.length / step - 2;\r\n if (high == 0) return step;\r\n let current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high) return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n }\r\n\r\n static linearSearch (values: ArrayLike, target: number, step: number) {\r\n for (let i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target) return i;\r\n return -1;\r\n }\r\n}\r\n\r\nexport interface Timeline {\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\r\n}\r\n\r\nexport abstract class CurveTimeline implements Timeline {\r\n static LINEAR = 0; static STEPPED = 1; static BEZIER = 2;\r\n static BEZIER_SIZE = 10 * 2 - 1;\r\n\r\n private curves: ArrayLike; // type, x, y, ...\r\n\r\n constructor (frameCount: number) {\r\n if (frameCount <= 0) throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n\r\n getFrameCount () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n }\r\n\r\n setLinear (frameIndex: number) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n }\r\n\r\n setStepped (frameIndex: number) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n }\r\n\r\n getCurveType (frameIndex: number): number {\r\n let index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length) return CurveTimeline.LINEAR;\r\n let type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR) return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED) return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n }\r\n\r\n /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\r\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\r\n * the difference between the keyframe's values. */\r\n setCurve (frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number) {\r\n let tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n let dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n let ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n let dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n\r\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n let curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n\r\n let x = dfx, y = dfy;\r\n for (let n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n }\r\n\r\n getCurvePercent (frameIndex: number, percent: number) {\r\n percent = MathUtils.clamp(percent, 0, 1);\r\n let curves = this.curves;\r\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n let type = curves[i];\r\n if (type == CurveTimeline.LINEAR) return percent;\r\n if (type == CurveTimeline.STEPPED) return 0;\r\n i++;\r\n let x = 0;\r\n for (let start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n let prevX: number, prevY: number;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n } else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n let y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\r\n }\r\n\r\n abstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\r\n}\r\n\r\nexport class RotateTimeline extends CurveTimeline {\r\n static ENTRIES = 2;\r\n static PREV_TIME = -2; static PREV_ROTATION = -1;\r\n static ROTATION = 1;\r\n\r\n boneIndex: number;\r\n frames: ArrayLike; // time, degrees, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount << 1);\r\n }\r\n\r\n /** Sets the time and angle of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, degrees: number) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\r\n let amount = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION] - bone.rotation;\r\n while (amount > 180)\r\n amount -= 360;\r\n while (amount < -180)\r\n amount += 360;\r\n bone.rotation += amount * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n let prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent((frame >> 1) - 1,\r\n 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n\r\n let amount = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n while (amount > 180)\r\n amount -= 360;\r\n while (amount < -180)\r\n amount += 360;\r\n amount = bone.data.rotation + (prevRotation + amount * percent) - bone.rotation;\r\n while (amount > 180)\r\n amount -= 360;\r\n while (amount < -180)\r\n amount += 360;\r\n bone.rotation += amount * alpha;\r\n }\r\n}\r\n\r\nexport class TranslateTimeline extends CurveTimeline {\r\n static ENTRIES = 3;\r\n static PREV_TIME = -3; static PREV_X = -2; static PREV_Y = -1;\r\n static X = 1; static Y = 2;\r\n\r\n boneIndex: number;\r\n frames: ArrayLike; // time, x, y, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, x: number, y: number) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\r\n bone.x += (bone.data.x + frames[frames.length + TranslateTimeline.PREV_X] - bone.x) * alpha;\r\n bone.y += (bone.data.y + frames[frames.length + TranslateTimeline.PREV_Y] - bone.y) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n let prevX = frames[frame + TranslateTimeline.PREV_X];\r\n let prevY = frames[frame + TranslateTimeline.PREV_Y];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n\r\n bone.x += (bone.data.x + prevX + (frames[frame + TranslateTimeline.X] - prevX) * percent - bone.x) * alpha;\r\n bone.y += (bone.data.y + prevY + (frames[frame + TranslateTimeline.Y] - prevY) * percent - bone.y) * alpha;\r\n }\r\n}\r\n\r\nexport class ScaleTimeline extends TranslateTimeline {\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\r\n bone.scaleX += (bone.data.scaleX * frames[frames.length + ScaleTimeline.PREV_X] - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY * frames[frames.length + ScaleTimeline.PREV_Y] - bone.scaleY) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n let prevX = frames[frame + ScaleTimeline.PREV_X];\r\n let prevY = frames[frame + ScaleTimeline.PREV_Y];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n\r\n bone.scaleX += (bone.data.scaleX * (prevX + (frames[frame + ScaleTimeline.X] - prevX) * percent) - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY * (prevY + (frames[frame + ScaleTimeline.Y] - prevY) * percent) - bone.scaleY) * alpha;\r\n }\r\n}\r\n\r\nexport class ShearTimeline extends TranslateTimeline {\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\r\n bone.shearX += (bone.data.shearX + frames[frames.length + ShearTimeline.PREV_X] - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + frames[frames.length + ShearTimeline.PREV_Y] - bone.shearY) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n let prevX = frames[frame + ShearTimeline.PREV_X];\r\n let prevY = frames[frame + ShearTimeline.PREV_Y];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n\r\n bone.shearX += (bone.data.shearX + (prevX + (frames[frame + ShearTimeline.X] - prevX) * percent) - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + (prevY + (frames[frame + ShearTimeline.Y] - prevY) * percent) - bone.shearY) * alpha;\r\n }\r\n}\r\n\r\nexport class ColorTimeline extends CurveTimeline {\r\n static ENTRIES = 5;\r\n static PREV_TIME = -5; static PREV_R = -4; static PREV_G = -3; static PREV_B = -2; static PREV_A = -1;\r\n static R = 1; static G = 2; static B = 3; static A = 4;\r\n\r\n slotIndex: number;\r\n frames: ArrayLike; // time, r, g, b, a, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, r: number, g: number, b: number, a: number) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n } else {\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n let color: Color = skeleton.slots[this.slotIndex].color;\r\n if (alpha < 1)\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n else\r\n color.set(r, g, b, a);\r\n }\r\n}\r\n\r\nexport class AttachmentTimeline implements Timeline {\r\n slotIndex: number;\r\n frames: ArrayLike // time, ...\r\n attachmentNames: Array;\r\n\r\n constructor (frameCount: number) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n\r\n getFrameCount () {\r\n return this.frames.length;\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, attachmentName: string) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frameIndex = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n\r\n let attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n }\r\n}\r\n\r\nexport class EventTimeline implements Timeline {\r\n frames: ArrayLike; // time, ...\r\n events: Array;\r\n\r\n constructor (frameCount: number) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n\r\n getFrameCount () {\r\n return this.frames.length;\r\n }\r\n\r\n /** Sets the time of the specified keyframe. */\r\n setFrame (frameIndex: number, event: Event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n }\r\n\r\n /** Fires events for frames > lastTime and <= time. */\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n if (firedEvents == null) return;\r\n let frames = this.frames;\r\n let frameCount = this.frames.length;\r\n\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha);\r\n lastTime = -1;\r\n } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n let frameTime = frames[frame];\r\n while (frame > 0) { // Fire multiple events with the same frame.\r\n if (frames[frame - 1] != frameTime) break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n }\r\n}\r\n\r\nexport class DrawOrderTimeline implements Timeline {\r\n frames: ArrayLike; // time, ...\r\n drawOrders: Array>;\r\n\r\n constructor (frameCount: number) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array>(frameCount);\r\n }\r\n\r\n getFrameCount () {\r\n return this.frames.length;\r\n }\r\n\r\n /** Sets the time of the specified keyframe.\r\n * @param drawOrder May be null to use bind pose draw order. */\r\n setFrame (frameIndex: number, time: number, drawOrder: Array) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frame = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n\r\n let drawOrder: Array = skeleton.drawOrder;\r\n let slots: Array = skeleton.slots;\r\n let drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n }\r\n}\r\n\r\nexport class DeformTimeline extends CurveTimeline {\r\n frames: ArrayLike; // time, ...\r\n frameVertices: Array>;\r\n slotIndex: number;\r\n attachment: VertexAttachment;\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.frameVertices = new Array>(frameCount);\r\n }\r\n\r\n /** Sets the time of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, vertices: ArrayLike) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let slot: Slot = skeleton.slots[this.slotIndex];\r\n let slotAttachment: Attachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof VertexAttachment) || !(slotAttachment).applyDeform(this.attachment)) return;\r\n\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frameVertices = this.frameVertices;\r\n let vertexCount = frameVertices[0].length;\r\n\r\n let verticesArray: Array = slot.attachmentVertices;\r\n if (verticesArray.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.\r\n let vertices: Array = Utils.setArraySize(verticesArray, vertexCount);\r\n\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n let lastVertices = frameVertices[frames.length - 1];\r\n if (alpha < 1) {\r\n for (let i = 0; i < vertexCount; i++)\r\n vertices[i] += (lastVertices[i] - vertices[i]) * alpha;\r\n } else\r\n Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time);\r\n let prevVertices = frameVertices[frame - 1];\r\n let nextVertices = frameVertices[frame];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n\r\n if (alpha < 1) {\r\n for (let i = 0; i < vertexCount; i++) {\r\n let prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;\r\n }\r\n } else {\r\n for (let i = 0; i < vertexCount; i++) {\r\n let prev = prevVertices[i];\r\n vertices[i] = prev + (nextVertices[i] - prev) * percent;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class IkConstraintTimeline extends CurveTimeline {\r\n static ENTRIES = 3;\r\n static PREV_TIME = -3; static PREV_MIX = -2; static PREV_BEND_DIRECTION = -1;\r\n static MIX = 1; static BEND_DIRECTION = 2;\r\n\r\n ikConstraintIndex: number;\r\n frames: ArrayLike; // time, mix, bendDirection, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time, mix and bend direction of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, mix: number, bendDirection: number) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: IkConstraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n constraint.bendDirection = Math.floor(frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]);\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n let mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n constraint.bendDirection = Math.floor(frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]);\r\n }\r\n}\r\n\r\nexport class TransformConstraintTimeline extends CurveTimeline {\r\n static ENTRIES = 5;\r\n static PREV_TIME = -5; static PREV_ROTATE = -4; static PREV_TRANSLATE = -3; static PREV_SCALE = -2; static PREV_SHEAR = -1;\r\n static ROTATE = 1; static TRANSLATE = 2; static SCALE = 3; static SHEAR = 4;\r\n\r\n transformConstraintIndex: number;\r\n frames: ArrayLike; // time, rotate mix, translate mix, scale mix, shear mix, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and mixes of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: TransformConstraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.rotateMix += (frames[i + TransformConstraintTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (frames[i + TransformConstraintTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (frames[i + TransformConstraintTimeline.PREV_SCALE] - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (frames[i + TransformConstraintTimeline.PREV_SHEAR] - constraint.shearMix) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n\r\n let rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n let translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n let scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n let shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n constraint.rotateMix += (rotate + (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate + (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\r\n * alpha;\r\n constraint.scaleMix += (scale + (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear + (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent - constraint.shearMix) * alpha;\r\n }\r\n}\r\n\r\nexport class PathConstraintPositionTimeline extends CurveTimeline {\r\n static ENTRIES = 2;\r\n static PREV_TIME = -2; static PREV_VALUE = -1;\r\n static VALUE = 1;\r\n\r\n pathConstraintIndex: number;\r\n\r\n frames: ArrayLike; // time, position, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, value: number) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.position += (frames[i + PathConstraintPositionTimeline.PREV_VALUE] - constraint.position) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n let position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.position += (position + (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent - constraint.position) * alpha;\r\n }\r\n}\r\n\r\nexport class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.spacing += (frames[i + PathConstraintSpacingTimeline.PREV_VALUE] - constraint.spacing) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n let spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.spacing += (spacing + (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent - constraint.spacing) * alpha;\r\n }\r\n}\r\n\r\nexport class PathConstraintMixTimeline extends CurveTimeline {\r\n static ENTRIES = 3;\r\n static PREV_TIME = -3; static PREV_ROTATE = -2; static PREV_TRANSLATE = -1;\r\n static ROTATE = 1; static TRANSLATE = 2;\r\n\r\n pathConstraintIndex: number;\r\n\r\n frames: ArrayLike; // time, rotate mix, translate mix, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and mixes of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.rotateMix += (frames[i + PathConstraintMixTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (frames[i + PathConstraintMixTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n let rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n let translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.rotateMix += (rotate + (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate + (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\r\n * alpha;\r\n }\r\n}\r\n","import {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils, Utils} from \"./Utils\";\r\nimport {Animation} from \"./Animation\";\r\nimport {AnimationStateData} from \"./AnimationStateData\";\r\nimport {Event} from \"./Event\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class AnimationState {\r\n data: AnimationStateData;\r\n tracks = new Array();\r\n events = new Array();\r\n timeScale = 1;\r\n\r\n constructor (data: AnimationStateData = null) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n }\r\n\r\n update (delta: number) {\r\n delta *= this.timeScale;\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n let next = current.next;\r\n if (next != null) {\r\n let nextTime = current.lastTime - next.delay;\r\n if (nextTime >= 0) {\r\n let nextDelta = delta * next.timeScale;\r\n next.time = nextTime + nextDelta; // For start event to see correct time.\r\n current.time += delta * current.timeScale; // For end event to see correct time.\r\n this.setCurrent(i, next);\r\n next.time -= nextDelta; // Prevent increasing time twice, below.\r\n current = next;\r\n }\r\n } else if (!current.loop && current.lastTime >= current.endTime) {\r\n // End non-looping animation when it reaches its end time and there is no next entry.\r\n this.clearTrack(i);\r\n continue;\r\n }\r\n\r\n current.time += delta * current.timeScale;\r\n if (current.previous != null) {\r\n let previousDelta = delta * current.previous.timeScale;\r\n current.previous.time += previousDelta;\r\n current.mixTime += previousDelta;\r\n }\r\n }\r\n }\r\n\r\n apply (skeleton: Skeleton) {\r\n let events = this.events;\r\n\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n events.length = 0;\r\n\r\n let time = current.time;\r\n let lastTime = current.lastTime;\r\n let endTime = current.endTime;\r\n let loop = current.loop;\r\n if (!loop && time > endTime) time = endTime;\r\n\r\n let previous = current.previous;\r\n if (previous == null)\r\n current.animation.mix(skeleton, lastTime, time, loop, events, current.mix);\r\n else {\r\n let previousTime = previous.time;\r\n if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime;\r\n previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null);\r\n\r\n let alpha = current.mixTime / current.mixDuration * current.mix;\r\n if (alpha >= 1) {\r\n alpha = 1;\r\n current.previous = null;\r\n }\r\n current.animation.mix(skeleton, lastTime, time, loop, events, alpha);\r\n }\r\n\r\n for (let ii = 0, nn = events.length; ii < nn; ii++) {\r\n let event = events[ii];\r\n if (current.onEvent) current.onEvent(i, event);\r\n if (this.onEvent) this.onEvent(i, event);\r\n }\r\n\r\n // Check if completed the animation or a loop iteration.\r\n if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) {\r\n let count = MathUtils.toInt(time / endTime);\r\n if (current.onComplete) current.onComplete(i, count);\r\n if (this.onComplete) this.onComplete(i, count);\r\n }\r\n\r\n current.lastTime = current.time;\r\n }\r\n }\r\n\r\n clearTracks () {\r\n for (let i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n }\r\n\r\n clearTrack (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return;\r\n let current = this.tracks[trackIndex];\r\n if (current == null) return;\r\n\r\n if (current.onEnd) current.onEnd(trackIndex);\r\n if (this.onEnd) this.onEnd(trackIndex);\r\n\r\n this.tracks[trackIndex] = null;\r\n\r\n this.freeAll(current);\r\n }\r\n\r\n freeAll (entry: TrackEntry) {\r\n while (entry != null) {\r\n let next = entry.next;\r\n entry = next;\r\n }\r\n }\r\n\r\n expandToIndex (index: number) {\r\n if (index < this.tracks.length) return this.tracks[index];\r\n Utils.setArraySize(this.tracks, index - this.tracks.length + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n }\r\n\r\n setCurrent (index: number, entry: TrackEntry) {\r\n let current = this.expandToIndex(index);\r\n if (current != null) {\r\n let previous = current.previous;\r\n current.previous = null;\r\n\r\n if (entry.onEnd) entry.onEnd(index);\r\n if (this.onEnd) this.onEnd(index);\r\n\r\n entry.mixDuration = this.data.getMix(current.animation, entry.animation);\r\n if (entry.mixDuration > 0) {\r\n entry.mixTime = 0;\r\n // If a mix is in progress, mix from the closest animation.\r\n if (previous != null && current.mixTime / current.mixDuration < 0.5) {\r\n entry.previous = previous;\r\n previous = current;\r\n } else\r\n entry.previous = current;\r\n }\r\n }\r\n\r\n this.tracks[index] = entry;\r\n\r\n if (entry.onStart) entry.onStart(index);\r\n if (this.onStart) this.onStart(index);\r\n }\r\n\r\n /** @see #setAnimation(int, Animation, boolean) */\r\n setAnimation (trackIndex: number, animationName: string, loop: boolean) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n }\r\n\r\n /** Set the current animation. Any queued animations are cleared. */\r\n setAnimationWith (trackIndex: number, animation: Animation, loop: boolean) {\r\n let current = this.expandToIndex(trackIndex);\r\n if (current != null) this.freeAll(current.next);\r\n\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n this.setCurrent(trackIndex, entry);\r\n return entry;\r\n }\r\n\r\n /** {@link #addAnimation(int, Animation, boolean, float)} */\r\n addAnimation (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n }\r\n\r\n hasAnimation(animationName: string): boolean\r\n {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n\r\n /** Adds an animation to be played delay seconds after the current or last queued animation.\r\n * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */\r\n addAnimationWith (trackIndex: number, animation: Animation, loop: boolean, delay: number) {\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n\r\n let last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n last.next = entry;\r\n } else\r\n this.tracks[trackIndex] = entry;\r\n\r\n if (delay <= 0) {\r\n if (last != null)\r\n delay += last.endTime - this.data.getMix(last.animation, animation);\r\n else\r\n delay = 0;\r\n }\r\n entry.delay = delay;\r\n\r\n return entry;\r\n }\r\n\r\n /** @return May be null. */\r\n getCurrent (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return null;\r\n return this.tracks[trackIndex];\r\n }\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n private static deprecatedWarning1: boolean = false;\r\n setAnimationByName (trackIndex: number, animationName: string, loop: boolean) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n }\r\n\r\n private static deprecatedWarning2: boolean = false;\r\n addAnimationByName (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n }\r\n\r\n private static deprecatedWarning3: boolean = false;\r\n hasAnimationByName (animationName: string): boolean\r\n {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n}\r\n\r\nexport class TrackEntry {\r\n next: TrackEntry; previous: TrackEntry;\r\n animation: Animation;\r\n loop = false;\r\n delay = 0; time = 0; lastTime = -1; endTime = 0; timeScale = 1;\r\n mixTime = 0; mixDuration = 0;\r\n mix = 1;\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n reset () {\r\n this.next = null;\r\n this.previous = null;\r\n this.animation = null;\r\n this.timeScale = 1;\r\n this.lastTime = -1; // Trigger events on frame zero.\r\n this.time = 0;\r\n }\r\n\r\n /** Returns true if the current time is greater than the end time, regardless of looping. */\r\n isComplete () : boolean {\r\n return this.time >= this.endTime;\r\n }\r\n}\r\n","import {Animation} from \"./Animation\";\nimport {SkeletonData} from \"./SkeletonData\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class AnimationStateData {\n skeletonData: SkeletonData;\n animationToMixTime: Map = { };\n defaultMix = 0;\n\n constructor (skeletonData: SkeletonData) {\n if (skeletonData == null) throw new Error(\"skeletonData cannot be null.\");\n this.skeletonData = skeletonData;\n }\n\n setMix (fromName: string, toName: string, duration: number) {\n let from = this.skeletonData.findAnimation(fromName);\n if (from == null) throw new Error(\"Animation not found: \" + fromName);\n let to = this.skeletonData.findAnimation(toName);\n if (to == null) throw new Error(\"Animation not found: \" + toName);\n this.setMixWith(from, to, duration);\n }\n\n private static deprecatedWarning1: boolean = false;\n setMixByName(fromName: string, toName: string, duration: number) {\n if (!AnimationStateData.deprecatedWarning1) {\n AnimationStateData.deprecatedWarning1 = true;\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\n }\n this.setMix(fromName, toName, duration);\n }\n\n setMixWith (from: Animation, to: Animation, duration: number) {\n if (from == null) throw new Error(\"from cannot be null.\");\n if (to == null) throw new Error(\"to cannot be null.\");\n let key = from.name + to.name;\n this.animationToMixTime[key] = duration;\n }\n\n getMix (from: Animation, to: Animation) {\n let key = from.name + to.name;\n let value = this.animationToMixTime[key];\n return value === undefined ? this.defaultMix : value;\n }\n}\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum BlendMode {\r\n Normal,\r\n Additive,\r\n Multiply,\r\n Screen\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {BoneData} from \"./BoneData\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils, Vector2} from \"./Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Bone implements Updatable {\r\n static yDown: boolean = false;\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n matrix = new PIXI.Matrix();\r\n\r\n get worldX(): number {\r\n return this.matrix.tx;\r\n }\r\n\r\n get worldY(): number {\r\n return this.matrix.ty;\r\n }\r\n\r\n data: BoneData;\r\n skeleton: Skeleton;\r\n parent: Bone;\r\n children = new Array();\r\n x = 0; y = 0; rotation = 0; scaleX = 0; scaleY = 0; shearX = 0; shearY = 0;\r\n appliedRotation = 0;\r\n\r\n worldSignX = 0; worldSignY = 0;\r\n\r\n sorted = false;\r\n\r\n /** @param parent May be null. */\r\n constructor (data: BoneData, skeleton: Skeleton, parent: Bone) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n\r\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\r\n update () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n }\r\n\r\n /** Computes the world transform using the parent bone and this bone's local transform. */\r\n updateWorldTransform () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n }\r\n\r\n /** Computes the world transform using the parent bone and the specified local transform. */\r\n updateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\r\n this.appliedRotation = rotation;\r\n\r\n let rotationY = rotation + 90 + shearY;\r\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX, lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX, ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n\r\n let parent = this.parent;\r\n let m = this.matrix;\r\n if (parent == null) { // Root bone.\r\n let skeleton = this.skeleton;\r\n if (skeleton.flipX) {\r\n x = -x;\r\n la = -la;\r\n lb = -lb;\r\n }\r\n if (skeleton.flipY !== Bone.yDown) {\r\n y = -y;\r\n lc = -lc;\r\n ld = -ld;\r\n }\r\n m.a = la;\r\n m.c = lb;\r\n m.b = lc;\r\n m.d = ld;\r\n m.tx = x;\r\n m.ty = y;\r\n this.worldSignX = MathUtils.signum(scaleX);\r\n this.worldSignY = MathUtils.signum(scaleY);\r\n return;\r\n }\r\n\r\n let pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n this.worldSignX = parent.worldSignX * MathUtils.signum(scaleX);\r\n this.worldSignY = parent.worldSignY * MathUtils.signum(scaleY);\r\n\r\n if (this.data.inheritRotation && this.data.inheritScale) {\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n } else {\r\n if (this.data.inheritRotation) { // No scale inheritance.\r\n pa = 1;\r\n pb = 0;\r\n pc = 0;\r\n pd = 1;\r\n do {\r\n let cos = MathUtils.cosDeg(parent.appliedRotation), sin = MathUtils.sinDeg(parent.appliedRotation);\r\n let temp = pa * cos + pb * sin;\r\n pb = pb * cos - pa * sin;\r\n pa = temp;\r\n temp = pc * cos + pd * sin;\r\n pd = pd * cos - pc * sin;\r\n pc = temp;\r\n\r\n if (!parent.data.inheritRotation) break;\r\n parent = parent.parent;\r\n } while (parent != null);\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n } else if (this.data.inheritScale) { // No rotation inheritance.\r\n pa = 1;\r\n pb = 0;\r\n pc = 0;\r\n pd = 1;\r\n do {\r\n let cos = MathUtils.cosDeg(parent.appliedRotation), sin = MathUtils.sinDeg(parent.appliedRotation);\r\n let psx = parent.scaleX, psy = parent.scaleY;\r\n let za = cos * psx, zb = sin * psy, zc = sin * psx, zd = cos * psy;\r\n let temp = pa * za + pb * zc;\r\n pb = pb * zd - pa * zb;\r\n pa = temp;\r\n temp = pc * za + pd * zc;\r\n pd = pd * zd - pc * zb;\r\n pc = temp;\r\n\r\n if (psx >= 0) sin = -sin;\r\n temp = pa * cos + pb * sin;\r\n pb = pb * cos - pa * sin;\r\n pa = temp;\r\n temp = pc * cos + pd * sin;\r\n pd = pd * cos - pc * sin;\r\n pc = temp;\r\n\r\n if (!parent.data.inheritScale) break;\r\n parent = parent.parent;\r\n } while (parent != null);\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n } else {\r\n m.a = la;\r\n m.c = lb;\r\n m.b = lc;\r\n m.d = ld;\r\n }\r\n if (this.skeleton.flipX) {\r\n m.a = -m.a;\r\n m.c = -m.c;\r\n }\r\n if (this.skeleton.flipY !== Bone.yDown) {\r\n m.b = -m.b;\r\n m.d = -m.d;\r\n }\r\n }\r\n }\r\n\r\n setToSetupPose () {\r\n let data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n }\r\n\r\n getWorldRotationX () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n }\r\n\r\n getWorldRotationY () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n }\r\n\r\n getWorldScaleX () {\r\n return Math.sqrt(this.matrix.a * this.matrix.a + this.matrix.b * this.matrix.b) * this.worldSignX;\r\n }\r\n\r\n getWorldScaleY () {\r\n return Math.sqrt(this.matrix.c * this.matrix.c + this.matrix.d * this.matrix.d) * this.worldSignY;\r\n }\r\n\r\n worldToLocalRotationX () {\r\n let parent = this.parent;\r\n if (parent == null) return this.rotation;\r\n let pm = parent.matrix;\r\n let pa = pm.a, pb = pm.c, pc = pm.b, pd = pm.d, a = this.matrix.a, c = this.matrix.b;\r\n return Math.atan2(pa * c - pc * a, pd * a - pb * c) * MathUtils.radDeg;\r\n }\r\n\r\n worldToLocalRotationY () {\r\n let parent = this.parent;\r\n if (parent == null) return this.rotation;\r\n let pm = parent.matrix;\r\n let pa = pm.a, pb = pm.b, pc = pm.c, pd = pm.d, b = this.matrix.c, d = this.matrix.d;\r\n return Math.atan2(pa * d - pc * b, pd * b - pb * d) * MathUtils.radDeg;\r\n }\r\n\r\n rotateWorld (degrees: number) {\r\n let m = this.matrix;\r\n let a = this.matrix.a, b = m.c, c = m.b, d = m.d;\r\n let cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n m.a = cos * a - sin * c;\r\n m.c = cos * b - sin * d;\r\n m.b = sin * a + cos * c;\r\n m.d = sin * b + cos * d;\r\n }\r\n\r\n /** Computes the local transform from the world transform. This can be useful to perform processing on the local transform\r\n * after the world transform has been modified directly (eg, by a constraint).\r\n *

\r\n * Some redundant information is lost by the world transform, such as -1,-1 scale versus 180 rotation. The computed local\r\n * transform values may differ from the original values but are functionally the same. */\r\n updateLocalTransform () {\r\n let parent = this.parent;\r\n let m = this.matrix;\r\n if (parent == null) {\r\n this.x = m.tx;\r\n this.y = m.ty;\r\n this.rotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.scaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.scaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n let det = m.a * m.d - m.b * m.c;\r\n this.shearX = 0;\r\n this.shearY = Math.atan2(m.a * m.c + m.b * m.d, det) * MathUtils.radDeg;\r\n return;\r\n }\r\n let pm = parent.matrix;\r\n let pa = pm.a, pb = pm.c, pc = pm.b, pd = pm.d;\r\n let pid = 1 / (pa * pd - pb * pc);\r\n let dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.x = (dx * pd * pid - dy * pb * pid);\r\n this.y = (dy * pa * pid - dx * pc * pid);\r\n let ia = pid * pd;\r\n let id = pid * pa;\r\n let ib = pid * pb;\r\n let ic = pid * pc;\r\n let ra = ia * m.a - ib * m.b;\r\n let rb = ia * m.c - ib * m.d;\r\n let rc = id * m.b - ic * m.a;\r\n let rd = id * m.d - ic * m.c;\r\n this.shearX = 0;\r\n this.scaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.scaleX > 0.0001) {\r\n let det = ra * rd - rb * rc;\r\n this.scaleY = det / this.scaleX;\r\n this.shearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.rotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n } else {\r\n this.scaleX = 0;\r\n this.scaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.shearY = 0;\r\n this.rotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n this.appliedRotation = this.rotation;\r\n }\r\n\r\n worldToLocal (world: Vector2) {\r\n let m = this.matrix;\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n let invDet = 1 / (a * d - b * c);\r\n let x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n }\r\n\r\n localToWorld (local: Vector2) {\r\n let m = this.matrix;\r\n let x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class BoneData {\r\n index: number;\r\n name: string;\r\n parent: BoneData;\r\n length: number;\r\n x = 0; y = 0; rotation = 0; scaleX = 1; scaleY = 1; shearX = 0; shearY = 0;\r\n inheritRotation = true; inheritScale = true;\r\n\r\n constructor (index: number, name: string, parent: BoneData) {\r\n if (index < 0) throw new Error(\"index must be >= 0.\");\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n}\r\n","import {EventData} from \"./EventData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Event {\r\n data: EventData;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n time: number;\r\n\r\n constructor (time: number, data: EventData) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class EventData {\r\n name: string;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {IkConstraintData} from \"./IkConstraintData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils} from \"./Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class IkConstraint implements Updatable {\r\n data: IkConstraintData;\r\n bones: Array;\r\n target: Bone;\r\n mix = 1;\r\n bendDirection = 0;\r\n\r\n level = 0;\r\n\r\n constructor (data: IkConstraintData, skeleton: Skeleton) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.bendDirection = data.bendDirection;\r\n\r\n this.bones = new Array();\r\n for (let i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n\r\n apply () {\r\n this.update();\r\n }\r\n\r\n update () {\r\n let target = this.target;\r\n let bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix);\r\n break;\r\n }\r\n }\r\n\r\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\r\n * coordinate system. */\r\n apply1 (bone: Bone, targetX: number, targetY: number, alpha: number) {\r\n let pp = bone.parent.matrix;\r\n let id = 1 / (pp.a * pp.d - pp.b * pp.c);\r\n let x = targetX - pp.tx, y = targetY - pp.ty;\r\n let tx = (x * pp.d - y * pp.c) * id - bone.x, ty = (y * pp.a - x * pp.b) * id - bone.y;\r\n let rotationIK = Math.atan2(ty, tx) * MathUtils.radDeg - bone.shearX - bone.rotation;\r\n if (bone.scaleX < 0) rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180) rotationIK += 360;\r\n bone.updateWorldTransformWith(bone.x, bone.y, bone.rotation + rotationIK * alpha, bone.scaleX, bone.scaleY, bone.shearX,\r\n bone.shearY);\r\n }\r\n\r\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\r\n * target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n apply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n let px = parent.x, py = parent.y, psx = parent.scaleX, psy = parent.scaleY, csx = child.scaleX;\r\n let os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n } else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n } else\r\n os2 = 0;\r\n let pm = parent.matrix;\r\n let cx = child.x, cy = 0, cwx = 0, cwy = 0, a = pm.a, b = pm.c, c = pm.b, d = pm.d;\r\n let u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + pm.tx;\r\n cwy = c * cx + pm.ty;\r\n } else {\r\n cy = child.y;\r\n cwx = a * cx + b * cy + pm.tx;\r\n cwy = c * cx + d * cy + pm.ty;\r\n }\r\n let pp = parent.parent;\r\n let ppm = parent.parent.matrix;\r\n a = ppm.a;\r\n b = ppm.c;\r\n c = ppm.b;\r\n d = ppm.d;\r\n let id = 1 / (a * d - b * c), x = targetX - ppm.tx, y = targetY - ppm.ty;\r\n let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n x = cwx - ppm.tx;\r\n y = cwy - ppm.ty;\r\n let dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n outer:\r\n if (u) {\r\n l2 *= psx;\r\n let cos = (tx * tx + ty * ty - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) cos = 1;\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n } else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n let aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n let c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n let q = Math.sqrt(d);\r\n if (c1 < 0) q = -q;\r\n q = -(c1 + q) / 2;\r\n let r0 = q / c2, r1 = c / q;\r\n let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n let minAngle = 0, minDist = Number.MAX_VALUE, minX = 0, minY = 0;\r\n let maxAngle = 0, maxDist = 0, maxX = 0, maxY = 0;\r\n x = l1 + a;\r\n d = x * x;\r\n if (d > maxDist) {\r\n maxAngle = 0;\r\n maxDist = d;\r\n maxX = x;\r\n }\r\n x = l1 - a;\r\n d = x * x;\r\n if (d < minDist) {\r\n minAngle = MathUtils.PI;\r\n minDist = d;\r\n minX = x;\r\n }\r\n let angle = Math.acos(-a * l1 / (aa - bb));\r\n x = a * Math.cos(angle) + l1;\r\n y = b * Math.sin(angle);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = angle;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = angle;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n } else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n let os = Math.atan2(cy, cx) * s2;\r\n let rotation = parent.rotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180) a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.scaleX, parent.scaleY, 0, 0);\r\n rotation = child.rotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.shearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180) a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.scaleX, child.scaleY, child.shearX, child.shearY);\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class IkConstraintData {\r\n name: string;\r\n bones = new Array();\r\n target: BoneData;\r\n bendDirection = 1;\r\n mix = 1;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Slot} from \"./Slot\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {PathAttachment} from \"./attachments\";\r\nimport {Utils, MathUtils} from \"./Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathConstraint implements Updatable {\r\n static NONE = -1; static BEFORE = -2; static AFTER = -3;\r\n\r\n data: PathConstraintData;\r\n bones: Array;\r\n target: Slot;\r\n position = 0; spacing = 0; rotateMix = 0; translateMix = 0;\r\n\r\n spaces = new Array(); positions = new Array();\r\n world = new Array(); curves = new Array(); lengths = new Array();\r\n segments = new Array();\r\n\r\n constructor (data: PathConstraintData, skeleton: Skeleton) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (let i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n\r\n apply () {\r\n this.update();\r\n }\r\n\r\n update () {\r\n let attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment)) return;\r\n\r\n let rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n let translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate) return;\r\n\r\n let data = this.data;\r\n let spacingMode = data.spacingMode;\r\n let lengthSpacing = spacingMode == SpacingMode.Length;\r\n let rotateMode = data.rotateMode;\r\n let tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\r\n let boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n let bones = this.bones;\r\n let spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = null;\r\n let spacing = this.spacing;\r\n if (scale || lengthSpacing) {\r\n if (scale) lengths = Utils.setArraySize(this.lengths, boneCount);\r\n for (let i = 0, n = spacesCount - 1; i < n;) {\r\n let bone = bones[i];\r\n let m = bone.matrix;\r\n let length = bone.data.length, x = length * m.a, y = length * m.b;\r\n length = Math.sqrt(x * x + y * y);\r\n if (scale) lengths[i] = length;\r\n spaces[++i] = lengthSpacing ? Math.max(0, length + spacing) : spacing;\r\n }\r\n } else {\r\n for (let i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n\r\n let positions = this.computeWorldPositions(attachment, spacesCount, tangents,\r\n data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\r\n let skeleton = this.target.bone.skeleton;\r\n let skeletonX = skeleton.x, skeletonY = skeleton.y;\r\n let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n let tip = rotateMode == RotateMode.Chain && offsetRotation == 0;\r\n for (let i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n let bone = bones[i];\r\n let m = bone.matrix;\r\n m.tx += (boneX - skeletonX - bone.worldX) * translateMix;\r\n m.ty += (boneY - skeletonY - bone.worldY) * translateMix;\r\n let x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n let length = lengths[i];\r\n if (length != 0) {\r\n let s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * rotateMix + 1;\r\n m.a *= s;\r\n m.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n let a = m.a, b = m.c, c = m.b, d = m.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a) - offsetRotation * MathUtils.degRad;\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n let length = bone.data.length;\r\n boneX += (length * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n m.a = cos * a - sin * c;\r\n m.c = cos * b - sin * d;\r\n m.b = sin * a + cos * c;\r\n m.d = sin * b + cos * d;\r\n }\r\n }\r\n }\r\n\r\n computeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean,\r\n percentSpacing: boolean) {\r\n let target = this.target;\r\n let position = this.position;\r\n let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = null;\r\n let closed = path.closed;\r\n let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n\r\n if (!path.constantSpeed) {\r\n let lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n let pathLength = lengths[curveCount];\r\n if (percentPosition) position *= pathLength;\r\n if (percentSpacing) {\r\n for (let i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n let space = spaces[i];\r\n position += space;\r\n let p = position;\r\n\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0) p += pathLength;\r\n curve = 0;\r\n } else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVerticesWith(target, 2, 4, world, 0);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n } else if (p > pathLength) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVerticesWith(target, verticesLength - 6, 4, world, 0);\r\n }\r\n this.addAfterPosition(p - pathLength, world, 0, out, o);\r\n continue;\r\n }\r\n\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n let length = lengths[curve];\r\n if (p > length) continue;\r\n if (curve == 0)\r\n p /= length;\r\n else {\r\n let prev = lengths[curve - 1];\r\n p = (p - prev) / (length - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVerticesWith(target, verticesLength - 4, 4, world, 0);\r\n path.computeWorldVerticesWith(target, 0, 4, world, 4);\r\n } else\r\n path.computeWorldVerticesWith(target, curve * 6 + 2, 8, world, 0);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\r\n tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVerticesWith(target, 2, verticesLength - 4, world, 0);\r\n path.computeWorldVerticesWith(target, 0, 2, world, verticesLength - 4);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n } else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVerticesWith(target, 2, verticesLength, world, 0);\r\n }\r\n\r\n // Curve lengths.\r\n let curves = Utils.setArraySize(this.curves, curveCount);\r\n let pathLength = 0;\r\n let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (let i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition) position *= pathLength;\r\n if (percentSpacing) {\r\n for (let i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n\r\n let segments = this.segments;\r\n let curveLength = 0;\r\n for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n let space = spaces[i];\r\n position += space;\r\n let p = position;\r\n\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0) p += pathLength;\r\n curve = 0;\r\n } else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n } else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n let length = curves[curve];\r\n if (p > length) continue;\r\n if (curve == 0)\r\n p /= length;\r\n else {\r\n let prev = curves[curve - 1];\r\n p = (p - prev) / (length - prev);\r\n }\r\n break;\r\n }\r\n\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n let ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n let length = segments[segment];\r\n if (p > length) continue;\r\n if (segment == 0)\r\n p /= length;\r\n else {\r\n let prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n\r\n addBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\r\n let x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n }\r\n\r\n addAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\r\n let x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n }\r\n\r\n addCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\r\n out: Array, o: number, tangents: boolean) {\r\n if (p == 0) p = 0.0001;\r\n let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {SlotData} from \"./SlotData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathConstraintData {\r\n name: string;\r\n bones = new Array();\r\n target: SlotData;\r\n positionMode: PositionMode;\r\n spacingMode: SpacingMode;\r\n rotateMode: RotateMode;\r\n offsetRotation: number;\r\n position: number; spacing: number; rotateMix: number; translateMix: number;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n\r\nexport enum PositionMode {\r\n Fixed, Percent\r\n}\r\n\r\nexport enum SpacingMode {\r\n Length, Fixed, Percent\r\n}\r\n\r\nexport enum RotateMode {\r\n Tangent, Chain, ChainScale\r\n}\r\n","import {Slot} from \"./Slot\";\r\nimport {Bone} from \"./Bone\";\r\nimport {IkConstraint} from \"./IkConstraint\";\r\nimport {TransformConstraint} from \"./TransformConstraint\";\r\nimport {PathConstraint} from \"./PathConstraint\";\r\nimport {Color, Utils, Vector2} from \"./Utils\";\r\nimport {Skin} from \"./Skin\";\r\nimport {SkeletonData} from \"./SkeletonData\";\r\nimport {Updatable} from \"./Updatable\";\r\nimport {Attachment, PathAttachment, RegionAttachment, MeshAttachment} from \"./attachments\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Skeleton {\r\n data: SkeletonData;\r\n bones: Array;\r\n slots: Array;\r\n drawOrder: Array;\r\n ikConstraints: Array; ikConstraintsSorted: Array;\r\n transformConstraints: Array;\r\n pathConstraints: Array;\r\n _updateCache = new Array();\r\n skin: Skin;\r\n color: Color;\r\n time = 0;\r\n flipX = false; flipY = false;\r\n x = 0; y = 0;\r\n\r\n constructor (data: SkeletonData) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n\r\n this.bones = new Array();\r\n for (let i = 0; i < data.bones.length; i++) {\r\n let boneData = data.bones[i];\r\n let bone: Bone;\r\n if (boneData.parent == null)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n let parent = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent);\r\n parent.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (let i = 0; i < data.slots.length; i++) {\r\n let slotData = data.slots[i];\r\n let bone = this.bones[slotData.boneData.index];\r\n let slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n\r\n this.ikConstraints = new Array();\r\n this.ikConstraintsSorted = new Array();\r\n for (let i = 0; i < data.ikConstraints.length; i++) {\r\n let ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n\r\n this.transformConstraints = new Array();\r\n for (let i = 0; i < data.transformConstraints.length; i++) {\r\n let transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n\r\n this.pathConstraints = new Array();\r\n for (let i = 0; i < data.pathConstraints.length; i++) {\r\n let pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n\r\n updateCache () {\r\n let updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n bones[i].sorted = false;\r\n\r\n // IK first, lowest hierarchy depth first.\r\n let ikConstraints = this.ikConstraintsSorted;\r\n ikConstraints.length = 0;\r\n for (let i = 0; i < this.ikConstraints.length; i++)\r\n ikConstraints.push(this.ikConstraints[i]);\r\n let ikCount = ikConstraints.length;\r\n for (let i = 0, level = 0, n = ikCount; i < n; i++) {\r\n let ik = ikConstraints[i];\r\n let bone = ik.bones[0].parent;\r\n for (level = 0; bone != null; level++)\r\n bone = bone.parent;\r\n ik.level = level;\r\n }\r\n for (let i = 1, ii = 0; i < ikCount; i++) {\r\n let ik = ikConstraints[i];\r\n let level = ik.level;\r\n for (ii = i - 1; ii >= 0; ii--) {\r\n let other = ikConstraints[ii];\r\n if (other.level < level) break;\r\n ikConstraints[ii + 1] = other;\r\n }\r\n ikConstraints[ii + 1] = ik;\r\n }\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let constraint = ikConstraints[i];\r\n let target = constraint.target;\r\n this.sortBone(target);\r\n\r\n let constrained = constraint.bones;\r\n let parent = constrained[0];\r\n this.sortBone(parent);\r\n\r\n updateCache.push(constraint);\r\n\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n }\r\n\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n\r\n let slot = constraint.target;\r\n let slotIndex = slot.data.index;\r\n let slotBone = slot.bone;\r\n if (this.skin != null) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (let ii = 0, nn = this.data.skins.length; ii < nn; ii++)\r\n this.sortPathConstraintAttachment(this.data.skins[ii], slotIndex, slotBone);\r\n\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n\r\n let constrained = constraint.bones;\r\n let boneCount = constrained.length;\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortBone(constrained[ii]);\r\n\r\n updateCache.push(constraint);\r\n\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (let ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n }\r\n\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n\r\n this.sortBone(constraint.target);\r\n\r\n let constrained = constraint.bones;\r\n let boneCount = constrained.length;\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortBone(constrained[ii]);\r\n\r\n updateCache.push(constraint);\r\n\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (let ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n }\r\n\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n }\r\n\r\n sortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\r\n let attachments = skin.attachments[slotIndex];\r\n if (!attachments) return;\r\n for (let key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n }\r\n\r\n sortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\r\n if (!(attachment instanceof PathAttachment)) return;\r\n let pathBones = (attachment).bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n let bones = this.bones;\r\n for (let i = 0; i < pathBones.length; i++) {\r\n let boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n\r\n sortBone (bone: Bone) {\r\n if (bone.sorted) return;\r\n let parent = bone.parent;\r\n if (parent != null) this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n }\r\n\r\n sortReset (bones: Array) {\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n if (bone.sorted) this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n }\r\n\r\n /** Updates the world transform for each bone and applies constraints. */\r\n updateWorldTransform () {\r\n let updateCache = this._updateCache;\r\n for (let i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n }\r\n\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n setToSetupPose () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n }\r\n\r\n /** Sets the bones and constraints to their setup pose values. */\r\n setBonesToSetupPose () {\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n\r\n let ikConstraints = this.ikConstraints;\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let constraint = ikConstraints[i];\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.mix = constraint.data.mix;\r\n }\r\n\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n let data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n let data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n }\r\n\r\n setSlotsToSetupPose () {\r\n let slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (let i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n }\r\n\r\n /** @return May return null. */\r\n getRootBone () {\r\n if (this.bones.length == 0) return null;\r\n return this.bones[0];\r\n }\r\n\r\n /** @return May be null. */\r\n findBone (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n if (bone.data.name == boneName) return bone;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return -1 if the bone was not found. */\r\n findBoneIndex (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName) return i;\r\n return -1;\r\n }\r\n\r\n /** @return May be null. */\r\n findSlot (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n if (slot.data.name == slotName) return slot;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return -1 if the bone was not found. */\r\n findSlotIndex (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName) return i;\r\n return -1;\r\n }\r\n\r\n /** Sets a skin by name.\r\n * @see #setSkin(Skin) */\r\n setSkinByName (skinName: string) {\r\n let skin = this.data.findSkin(skinName);\r\n if (skin == null) throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n }\r\n\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n * @param newSkin May be null. */\r\n setSkin (newSkin: Skin) {\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n let name = slot.data.attachmentName;\r\n if (name != null) {\r\n let attachment: Attachment = newSkin.getAttachment(i, name);\r\n if (attachment != null) slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachmentByName (slotName: string, attachmentName: string): Attachment {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachment (slotIndex: number, attachmentName: string): Attachment {\r\n if (attachmentName == null) throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n let attachment: Attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null) return attachment;\r\n }\r\n if (this.data.defaultSkin != null) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n }\r\n\r\n /** @param attachmentName May be null. */\r\n setAttachment (slotName: string, attachmentName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n let attachment: Attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n }\r\n\r\n /** @return May be null. */\r\n findIkConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let ikConstraints = this.ikConstraints;\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName) return ikConstraint;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return May be null. */\r\n findTransformConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return May be null. */\r\n findPathConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size The width and height of the AABB. */\r\n getBounds (offset: Vector2, size: Vector2) {\r\n if (offset == null) throw new Error(\"offset cannot be null.\");\r\n if (size == null) throw new Error(\"size cannot be null.\");\r\n let drawOrder = this.drawOrder;\r\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (let i = 0, n = drawOrder.length; i < n; i++) {\r\n let slot = drawOrder[i];\r\n let vertices: ArrayLike = null;\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment)\r\n vertices = (attachment).updateWorldVertices(slot, false);\r\n else if (attachment instanceof MeshAttachment) //\r\n vertices = (attachment).updateWorldVertices(slot, true);\r\n if (vertices != null) {\r\n for (let ii = 0, nn = vertices.length; ii < nn; ii += 8) {\r\n let x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n }\r\n\r\n update (delta: number) {\r\n this.time += delta;\r\n }\r\n}\r\n","import {Utils, Pool} from \"./Utils\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {BoundingBoxAttachment} from \"./attachments\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonBounds {\r\n minX = 0; minY = 0; maxX = 0; maxY = 0;\r\n boundingBoxes = new Array();\r\n polygons = new Array>();\r\n private polygonPool = new Pool>(() => {\r\n return Utils.newFloatArray(16);\r\n });\r\n\r\n update (skeleton: Skeleton, updateAabb: boolean) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n let boundingBoxes = this.boundingBoxes;\r\n let polygons = this.polygons;\r\n let polygonPool = this.polygonPool;\r\n let slots = skeleton.slots;\r\n let slotCount = slots.length;\r\n\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n\r\n for (let i = 0; i < slotCount; i++) {\r\n let slot = slots[i];\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof BoundingBoxAttachment) {\r\n let boundingBox = attachment as BoundingBoxAttachment;\r\n boundingBoxes.push(boundingBox);\r\n\r\n let polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, polygon);\r\n }\r\n }\r\n\r\n if (updateAabb) this.aabbCompute();\r\n }\r\n\r\n aabbCompute () {\r\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++) {\r\n let polygon = polygons[i];\r\n let vertices = polygon;\r\n for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n let x = vertices[ii];\r\n let y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box contains the point. */\r\n aabbContainsPoint (x: number, y: number) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the line segment. */\r\n aabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let minX = this.minX;\r\n let minY = this.minY;\r\n let maxX = this.maxX;\r\n let maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n let m = (y2 - y1) / (x2 - x1);\r\n let y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n let x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n return false;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\r\n aabbIntersectsSkeleton (bounds: SkeletonBounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\r\n * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\r\n containsPoint (x: number, y: number): BoundingBoxAttachment {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains the point. */\r\n containsPointPolygon (polygon: ArrayLike, x: number, y: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let prevIndex = nn - 2;\r\n let inside = false;\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let vertexY = vertices[ii + 1];\r\n let prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n let vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\r\n * is usually more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns\r\n * true. */\r\n intersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains any part of the line segment. */\r\n intersectsSegmentPolygon (polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let width12 = x1 - x2, height12 = y1 - y2;\r\n let det1 = x1 * y2 - y1 * x2;\r\n let x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let x4 = vertices[ii], y4 = vertices[ii + 1];\r\n let det2 = x3 * y4 - y3 * x4;\r\n let width34 = x3 - x4, height34 = y3 - y4;\r\n let det3 = width12 * height34 - height12 * width34;\r\n let x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n let y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n }\r\n\r\n /** Returns the polygon for the specified bounding box, or null. */\r\n getPolygon (boundingBox: BoundingBoxAttachment) {\r\n if (boundingBox == null) throw new Error(\"boundingBox cannot be null.\");\r\n let index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n }\r\n\r\n getWidth () {\r\n return this.maxX - this.minX;\r\n }\r\n\r\n getHeight () {\r\n return this.maxY - this.minY;\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Skin} from \"./Skin\";\r\nimport {EventData} from \"./EventData\";\r\nimport {Animation} from \"./Animation\";\r\nimport {IkConstraintData} from \"./IkConstraintData\";\r\nimport {TransformConstraintData} from \"./TransformConstraintData\";\r\nimport {PathConstraintData} from \"./PathConstraintData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonData {\r\n name: string;\r\n bones = new Array(); // Ordered parents first.\r\n slots = new Array(); // Setup pose draw order.\r\n skins = new Array();\r\n defaultSkin: Skin;\r\n events = new Array();\r\n animations = new Array();\r\n ikConstraints = new Array();\r\n transformConstraints = new Array();\r\n pathConstraints = new Array();\r\n width: number; height: number;\r\n version: string; hash: string; imagesPath: string;\r\n\r\n findBone (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n if (bone.name == boneName) return bone;\r\n }\r\n return null;\r\n }\r\n\r\n findBoneIndex (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName) return i;\r\n return -1;\r\n }\r\n\r\n findSlot (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n if (slot.name == slotName) return slot;\r\n }\r\n return null;\r\n }\r\n\r\n findSlotIndex (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName) return i;\r\n return -1;\r\n }\r\n\r\n findSkin (skinName: string) {\r\n if (skinName == null) throw new Error(\"skinName cannot be null.\");\r\n let skins = this.skins;\r\n for (let i = 0, n = skins.length; i < n; i++) {\r\n let skin = skins[i];\r\n if (skin.name == skinName) return skin;\r\n }\r\n return null;\r\n }\r\n\r\n findEvent (eventDataName: string) {\r\n if (eventDataName == null) throw new Error(\"eventDataName cannot be null.\");\r\n let events = this.events;\r\n for (let i = 0, n = events.length; i < n; i++) {\r\n let event = events[i];\r\n if (event.name == eventDataName) return event;\r\n }\r\n return null;\r\n }\r\n\r\n findAnimation (animationName: string) {\r\n if (animationName == null) throw new Error(\"animationName cannot be null.\");\r\n let animations = this.animations;\r\n for (let i = 0, n = animations.length; i < n; i++) {\r\n let animation = animations[i];\r\n if (animation.name == animationName) return animation;\r\n }\r\n return null;\r\n }\r\n\r\n findIkConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let ikConstraints = this.ikConstraints;\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let constraint = ikConstraints[i];\r\n if (constraint.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n findTransformConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n if (constraint.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n findPathConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n if (constraint.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n findPathConstraintIndex (pathConstraintName: string) {\r\n if (pathConstraintName == null) throw new Error(\"pathConstraintName cannot be null.\");\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName) return i;\r\n return -1;\r\n }\r\n}\r\n","import {SkeletonData} from \"./SkeletonData\";\r\nimport {BoneData} from \"./BoneData\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Event} from \"./Event\";\r\nimport {IkConstraintData} from \"./IkConstraintData\";\r\nimport {TransformConstraintData} from \"./TransformConstraintData\";\r\nimport {PathConstraintData, PositionMode, SpacingMode, RotateMode} from \"./PathConstraintData\";\r\nimport {Skin} from \"./Skin\";\r\nimport {EventData} from \"./EventData\";\r\nimport {Attachment, AttachmentLoader, MeshAttachment, VertexAttachment} from \"./attachments\";\r\nimport {Utils, Color} from \"./Utils\";\r\nimport {\r\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\r\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\r\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\r\n Animation, CurveTimeline\r\n} from \"./Animation\";\r\nimport {BlendMode} from \"./BlendMode\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonJson {\r\n attachmentLoader: AttachmentLoader;\r\n scale = 1;\r\n private linkedMeshes = new Array();\r\n\r\n constructor (attachmentLoader: AttachmentLoader) {\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n\r\n readSkeletonData (json: string | any ): SkeletonData {\r\n let scale = this.scale;\r\n let skeletonData = new SkeletonData();\r\n let root = typeof(json) === \"string\" ? JSON.parse(json) : json;\r\n\r\n // Skeleton\r\n let skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n\r\n // Bones\r\n if (root.bones) {\r\n for (let i = 0; i < root.bones.length; i++) {\r\n let boneMap = root.bones[i];\r\n\r\n let parent: BoneData = null;\r\n let parentName: string = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent = skeletonData.findBone(parentName);\r\n if (parent == null) throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n let data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.inheritRotation = this.getValue(boneMap, \"inheritRotation\", true);\r\n data.inheritScale = this.getValue(boneMap, \"inheritScale\", true);\r\n\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n\r\n // Slots.\r\n if (root.slots) {\r\n for (let i = 0; i < root.slots.length; i++) {\r\n let slotMap = root.slots[i];\r\n let slotName: string = slotMap.name;\r\n let boneName: string = slotMap.bone;\r\n let boneData = skeletonData.findBone(boneName);\r\n if (boneData == null) throw new Error(\"Slot bone not found: \" + boneName);\r\n let data = new SlotData(skeletonData.slots.length, slotName, boneData);\r\n\r\n let color: string = this.getValue(slotMap, \"color\", null);\r\n if (color != null) data.color.setFromString(color);\r\n\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n\r\n // IK constraints\r\n if (root.ik) {\r\n for (let i = 0; i < root.ik.length; i++) {\r\n let constraintMap = root.ik[i];\r\n let data = new IkConstraintData(constraintMap.name);\r\n\r\n for (let j = 0; j < constraintMap.bones.length; j++) {\r\n let boneName = constraintMap.bones[j];\r\n let bone = skeletonData.findBone(boneName);\r\n if (bone == null) throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n\r\n let targetName: string = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null) throw new Error(\"IK target bone not found: \" + targetName);\r\n\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (let i = 0; i < root.transform.length; i++) {\r\n let constraintMap = root.transform[i];\r\n let data = new TransformConstraintData(constraintMap.name);\r\n\r\n for (let j = 0; j < constraintMap.bones.length; j++) {\r\n let boneName = constraintMap.bones[j];\r\n let bone = skeletonData.findBone(boneName);\r\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n\r\n let targetName: string = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null) throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n\r\n // Path constraints.\r\n if (root.path) {\r\n for (let i = 0; i < root.path.length; i++) {\r\n let constraintMap = root.path[i];\r\n let data = new PathConstraintData(constraintMap.name);\r\n\r\n for (let j = 0; j < constraintMap.bones.length; j++) {\r\n let boneName = constraintMap.bones[j];\r\n let bone = skeletonData.findBone(boneName);\r\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n\r\n let targetName: string = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null) throw new Error(\"Path target slot not found: \" + targetName);\r\n\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed) data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n\r\n // Skins.\r\n if (root.skins) {\r\n for (let skinName in root.skins) {\r\n let skinMap = root.skins[skinName]\r\n let skin = new Skin(skinName);\r\n for (let slotName in skinMap) {\r\n let slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\r\n let slotMap = skinMap[slotName];\r\n for (let entryName in slotMap) {\r\n let attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName);\r\n if (attachment != null) skin.addAttachment(slotIndex, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\") skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n\r\n // Linked meshes.\r\n for (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n let linkedMesh = this.linkedMeshes[i];\r\n let skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null) throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent == null) throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.setParentMesh( parent);\r\n // linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n\r\n // Events.\r\n if (root.events) {\r\n for (let eventName in root.events) {\r\n let eventMap = root.events[eventName];\r\n let data = new EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", null);\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n\r\n // Animations.\r\n if (root.animations) {\r\n for (let animationName in root.animations) {\r\n let animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n\r\n return skeletonData;\r\n }\r\n\r\n readAttachment (map: any, skin: Skin, slotIndex: number, name: string): Attachment {\r\n let scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n\r\n let type = this.getValue(map, \"type\", \"region\");\r\n\r\n switch (type) {\r\n case \"region\": {\r\n let path = this.getValue(map, \"path\", name);\r\n let region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null) return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n\r\n let color: string = this.getValue(map, \"color\", null);\r\n if (color != null) region.color.setFromString(color);\r\n\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null) return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n let color: string = this.getValue(map, \"color\", null);\r\n if (color != null) box.color.setFromString(color);\r\n return box;\r\n }\r\n //weightedmesh is deprecated but who cares\r\n case \"weightedmesh\":\r\n case \"skinnedmesh\":\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n let path = this.getValue(map, \"path\", name);\r\n let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null) return null;\r\n mesh.path = path;\r\n\r\n let color = this.getValue(map, \"color\", null);\r\n if (color != null) mesh.color.setFromString(color);\r\n\r\n let parent: string = this.getValue(map, \"parent\", null);\r\n if (parent != null) {\r\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent));\r\n return mesh;\r\n }\r\n\r\n let uvs: Array = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = uvs;\r\n // mesh.updateUVs();\r\n\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n let path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null) return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n\r\n let vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n\r\n let lengths: Array = Utils.newArray(vertexCount / 3, 0);\r\n for (let i = 0; i < map.lengths.length; i++)\r\n lengths[i++] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n\r\n let color: string = this.getValue(map, \"color\", null);\r\n if (color != null) path.color.setFromString(color);\r\n return path;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n readVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\r\n let scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n let vertices: Array = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n if (scale != 1) {\r\n for (let i = 0, n = vertices.length; i < n; i++)\r\n vertices[i] *= scale;\r\n }\r\n attachment.vertices = Utils.toFloatArray(vertices);\r\n return;\r\n }\r\n let weights = new Array();\r\n let bones = new Array();\r\n for (let i = 0, n = vertices.length; i < n;) {\r\n let boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (let nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n }\r\n\r\n readAnimation (map: any, name: string, skeletonData: SkeletonData) {\r\n let scale = this.scale;\r\n let timelines = new Array();\r\n let duration = 0;\r\n\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (let slotName in map.slots) {\r\n let slotMap = map.slots[slotName];\r\n let slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\r\n for (let timelineName in slotMap) {\r\n let timelineMap = slotMap[timelineName];\r\n if (timelineName == \"color\") {\r\n let timeline = new ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n let color = new Color();\r\n color.setFromString(valueMap.color);\r\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\r\n\r\n } else if (timelineName = \"attachment\") {\r\n let timeline = new AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n } else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (let boneName in map.bones) {\r\n let boneMap = map.bones[boneName];\r\n let boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1) throw new Error(\"Bone not found: \" + boneName);\r\n for (let timelineName in boneMap) {\r\n let timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n let timeline = new RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\r\n\r\n } else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n let timeline: TranslateTimeline = null;\r\n let timelineScale = 1;\r\n if (timelineName === \"scale\")\r\n timeline = new ScaleTimeline(timelineMap.length);\r\n else if (timelineName === \"shear\")\r\n timeline = new ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n let x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\r\n\r\n } else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (let constraintName in map.ik) {\r\n let constraintMap = map.ik[constraintName];\r\n let constraint = skeletonData.findIkConstraint(constraintName);\r\n let timeline = new IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n let frameIndex = 0;\r\n for (let i = 0; i < constraintMap.length; i++) {\r\n let valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1),\r\n this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (let constraintName in map.transform) {\r\n let constraintMap = map.transform[constraintName];\r\n let constraint = skeletonData.findTransformConstraint(constraintName);\r\n let timeline = new TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n let frameIndex = 0;\r\n for (let i = 0; i < constraintMap.length; i++) {\r\n let valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\r\n this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration,\r\n timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n\r\n // Path constraint timelines.\r\n if (map.paths) {\r\n for (let constraintName in map.paths) {\r\n let constraintMap = map.paths[constraintName];\r\n let index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1) throw new Error(\"Path constraint not found: \" + constraintName);\r\n let data = skeletonData.pathConstraints[index];\r\n for (let timelineName in constraintMap) {\r\n let timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n let timeline: PathConstraintPositionTimeline = null;\r\n let timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) timelineScale = scale;\r\n } else {\r\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == PositionMode.Fixed) timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration,\r\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n } else if (timelineName === \"mix\") {\r\n let timeline = new PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\r\n this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration,\r\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Deform timelines.\r\n if (map.deform) {\r\n for (let deformName in map.deform) {\r\n let deformMap = map.deform[deformName];\r\n let skin = skeletonData.findSkin(deformName);\r\n if (skin == null) throw new Error(\"Skin not found: \" + deformName);\r\n for (let slotName in deformMap) {\r\n let slotMap = deformMap[slotName];\r\n let slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (let timelineName in slotMap) {\r\n let timelineMap = slotMap[timelineName];\r\n let attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null) throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n let weighted = attachment.bones != null;\r\n let vertices = attachment.vertices;\r\n let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n\r\n let timeline = new DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n\r\n let frameIndex = 0;\r\n for (let j = 0; j < timelineMap.length; j++) {\r\n let valueMap = timelineMap[j];\r\n let deform: ArrayLike;\r\n let verticesValue: Array = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n let start = this.getValue(valueMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (let i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (let i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n\r\n timeline.setFrame(frameIndex, valueMap.time, deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Draw order timeline.\r\n let drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null) drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n let timeline = new DrawOrderTimeline(drawOrderNode.length);\r\n let slotCount = skeletonData.slots.length;\r\n let frameIndex = 0;\r\n for (let j = 0; j < drawOrderNode.length; j++) {\r\n let drawOrderMap = drawOrderNode[j];\r\n let drawOrder: Array = null;\r\n let offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n let unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n let originalIndex = 0, unchangedIndex = 0;\r\n for (let i = 0; i < offsets.length; i++) {\r\n let offsetMap = offsets[i];\r\n let slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (let i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n\r\n // Event timeline.\r\n if (map.events) {\r\n let timeline = new EventTimeline(map.events.length);\r\n let frameIndex = 0;\r\n for (let i = 0; i < map.events.length; i++) {\r\n let eventMap = map.events[i];\r\n let eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null) throw new Error(\"Event not found: \" + eventMap.name);\r\n let event = new Event(eventMap.time, eventData);\r\n event.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n timeline.setFrame(frameIndex++, event);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n }\r\n\r\n readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {\r\n if (!map.curve) return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n let curve: Array = map.curve;\r\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n }\r\n }\r\n\r\n getValue (map: any, prop: string, defaultValue: any) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n }\r\n\r\n static blendModeFromString (str: string): number {\r\n if (str === 'multiply') return PIXI.BLEND_MODES.MULTIPLY;\r\n if (str === 'additive') return PIXI.BLEND_MODES.ADD;\r\n if (str === 'screen') return PIXI.BLEND_MODES.SCREEN;\r\n if (str === 'normal') return PIXI.BLEND_MODES.NORMAL;\r\n throw new Error(`Unknown blend mode: ${str}`);\r\n }\r\n\r\n static positionModeFromString (str: string) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\") return PositionMode.Fixed;\r\n if (str == \"percent\") return PositionMode.Percent;\r\n throw new Error(`Unknown position mode: ${str}`);\r\n }\r\n\r\n static spacingModeFromString (str: string) {\r\n str = str.toLowerCase();\r\n if (str == \"length\") return SpacingMode.Length;\r\n if (str == \"fixed\") return SpacingMode.Fixed;\r\n if (str == \"percent\") return SpacingMode.Percent;\r\n throw new Error(`Unknown position mode: ${str}`);\r\n }\r\n\r\n static rotateModeFromString (str: string) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\") return RotateMode.Tangent;\r\n if (str == \"chain\") return RotateMode.Chain;\r\n if (str == \"chainscale\") return RotateMode.ChainScale;\r\n throw new Error(`Unknown rotate mode: ${str}`);\r\n }\r\n}\r\n\r\nclass LinkedMesh {\r\n parent: string; skin: string;\r\n slotIndex: number;\r\n mesh: MeshAttachment;\r\n\r\n constructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n }\r\n}\r\n","import {Attachment} from \"./attachments\";\nimport {Skeleton} from \"./Skeleton\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Skin {\n name: string;\n attachments = new Array>();\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n\n addAttachment (slotIndex: number, name: string, attachment: Attachment) {\n if (attachment == null) throw new Error(\"attachment cannot be null.\");\n let attachments = this.attachments;\n if (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n if (!attachments[slotIndex]) attachments[slotIndex] = { };\n attachments[slotIndex][name] = attachment;\n }\n\n /** @return May be null. */\n getAttachment (slotIndex: number, name: string): Attachment {\n let dictionary = this.attachments[slotIndex];\n return dictionary ? dictionary[name] : null;\n }\n\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n attachAll (skeleton: Skeleton, oldSkin: Skin) {\n let slotIndex = 0;\n for (let i = 0; i < skeleton.slots.length; i++) {\n let slot = skeleton.slots[i];\n let slotAttachment = slot.getAttachment();\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\n let dictionary = oldSkin.attachments[slotIndex];\n for (let key in dictionary) {\n let skinAttachment:Attachment = dictionary[key];\n if (slotAttachment == skinAttachment) {\n let attachment = this.getAttachment(slotIndex, name);\n if (attachment != null) slot.setAttachment(attachment);\n break;\n }\n }\n }\n slotIndex++;\n }\n }\n}\n","import {Attachment} from \"./attachments\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Color} from \"./Utils\";\r\nimport {TextureRegion} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Slot {\r\n //this is for PIXI\r\n currentMesh: any;\r\n currentSprite: any;\r\n meshes: any;\r\n currentMeshName: String;\r\n sprites: any;\r\n currentSpriteName: String;\r\n blendMode: number;\r\n //assign hack region a bit later\r\n tempRegion: TextureRegion;\r\n tempAttachment: Attachment;\r\n\r\n //canon\r\n data: SlotData;\r\n bone: Bone;\r\n color: Color;\r\n attachment: Attachment;\r\n private attachmentTime: number;\r\n attachmentVertices = new Array();\r\n\r\n constructor (data: SlotData, bone: Bone) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (bone == null) throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.blendMode = data.blendMode;\r\n this.setToSetupPose();\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachment (): Attachment {\r\n return this.attachment;\r\n }\r\n\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n setAttachment (attachment: Attachment) {\r\n if (this.attachment == attachment) return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n }\r\n\r\n setAttachmentTime (time: number) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n }\r\n\r\n /** Returns the time since the attachment was set. */\r\n getAttachmentTime (): number {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n }\r\n\r\n setToSetupPose () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {Color} from \"./Utils\";\r\nimport {BlendMode} from \"./BlendMode\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SlotData {\r\n index: number;\r\n name: string;\r\n boneData: BoneData;\r\n color = new Color(1, 1, 1, 1);\r\n attachmentName: string;\r\n blendMode: number;\r\n\r\n constructor (index: number, name: string, boneData: BoneData) {\r\n if (index < 0) throw new Error(\"index must be >= 0.\");\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n if (boneData == null) throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n}\r\n","export abstract class Texture {\r\n protected _image: HTMLImageElement;\r\n\r\n constructor (image: HTMLImageElement) {\r\n this._image = image;\r\n }\r\n\r\n getImage (): HTMLImageElement {\r\n return this._image;\r\n }\r\n\r\n abstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\r\n abstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\r\n abstract dispose (): void;\r\n\r\n\r\n public static filterFromString (text: string): TextureFilter {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(`Unknown texture filter ${text}`);\r\n }\r\n }\r\n\r\n public static wrapFromString (text: string): TextureWrap {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(`Unknown texture wrap ${text}`);\r\n }\r\n }\r\n}\r\n\r\nexport enum TextureFilter {\r\n Nearest = 9728, // WebGLRenderingContext.NEAREST\r\n Linear = 9729, // WebGLRenderingContext.LINEAR\r\n MipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n MipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\r\n MipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\r\n MipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\r\n MipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n}\r\n\r\nexport enum TextureWrap {\r\n MirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\r\n ClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\r\n Repeat = 10497 // WebGLRenderingContext.REPEAT\r\n}\r\n\r\nexport class TextureRegion {\r\n texture: PIXI.Texture;\r\n\r\n //thats for overrides\r\n size: PIXI.Rectangle = null;\r\n\r\n get width(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.width;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get height(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.height;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get u(): number {\r\n return this.texture._uvs.x0;\r\n }\r\n\r\n get v(): number {\r\n return this.texture._uvs.y0;\r\n }\r\n\r\n get u2(): number {\r\n return this.texture._uvs.x2;\r\n }\r\n\r\n get v2(): number {\r\n return this.texture._uvs.y2;\r\n }\r\n\r\n get offsetX(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.x : 0;\r\n }\r\n\r\n get offsetY(): number {\r\n console.warn(\"Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on.\");\r\n return this.spineOffsetY;\r\n }\r\n\r\n get pixiOffsetY(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.y : 0;\r\n }\r\n\r\n get spineOffsetY(): number {\r\n var tex = this.texture;\r\n return this.originalHeight - this.height - (tex.trim ? tex.trim.y : 0);\r\n }\r\n\r\n get originalWidth(): number {\r\n var tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.crop.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get originalHeight(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.crop.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get x(): number {\r\n return this.texture.frame.x;\r\n }\r\n\r\n get y(): number {\r\n return this.texture.frame.y;\r\n }\r\n\r\n get rotate(): boolean {\r\n return this.texture.rotate !== 0;\r\n }\r\n}\r\n","import {Disposable, Map} from \"./Utils\";\r\nimport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TextureAtlas implements Disposable {\r\n pages = new Array();\r\n regions = new Array();\r\n\r\n constructor(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (atlasText) {\r\n this.addSpineAtlas(atlasText, textureLoader, callback);\r\n }\r\n }\r\n\r\n addTexture(name: string, texture: PIXI.Texture) {\r\n let pages = this.pages;\r\n let page: TextureAtlasPage = null;\r\n for (var i=0;i, stripExtension: boolean) {\r\n for (var key in textures) {\r\n if (textures.hasOwnProperty(key)) {\r\n this.addTexture(stripExtension && key.indexOf('.') !== -1 ? key.substr(0, key.lastIndexOf('.')) : key, textures[key]);\r\n }\r\n }\r\n }\r\n\r\n public addSpineAtlas(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n return this.load(atlasText, textureLoader, callback);\r\n }\r\n\r\n private load(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n\r\n let reader = new TextureAtlasReader(atlasText);\r\n let tuple = new Array(4);\r\n let page: TextureAtlasPage = null;\r\n\r\n let iterateParser = () => {\r\n while (true) {\r\n let line = reader.readLine();\r\n if (line == null) {\r\n return callback && callback(this);\r\n }\r\n line = line.trim();\r\n if (line.length == 0)\r\n page = null;\r\n else if (!page) {\r\n page = new TextureAtlasPage();\r\n page.name = line;\r\n\r\n if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker.\r\n page.width = parseInt(tuple[0]);\r\n page.height = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n }\r\n // page.format = Format[tuple[0]]; we don't need format in WebGL\r\n\r\n reader.readTuple(tuple);\r\n page.minFilter = Texture.filterFromString(tuple[0]);\r\n page.magFilter = Texture.filterFromString(tuple[1]);\r\n\r\n let direction = reader.readValue();\r\n page.uWrap = TextureWrap.ClampToEdge;\r\n page.vWrap = TextureWrap.ClampToEdge;\r\n if (direction == \"x\")\r\n page.uWrap = TextureWrap.Repeat;\r\n else if (direction == \"y\")\r\n page.vWrap = TextureWrap.Repeat;\r\n else if (direction == \"xy\")\r\n page.uWrap = page.vWrap = TextureWrap.Repeat;\r\n\r\n textureLoader(line, (texture: PIXI.BaseTexture) => {\r\n page.baseTexture = texture;\r\n if (!texture.hasLoaded) {\r\n texture.width = page.width;\r\n texture.height = page.height;\r\n }\r\n this.pages.push(page);\r\n page.setFilters();\r\n\r\n if (!page.width || !page.height) {\r\n page.width = texture.realWidth;\r\n page.height = texture.realHeight;\r\n if (!page.width || !page.height) {\r\n console.log(\"ERROR spine atlas page \" + page.name + \": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)\");\r\n }\r\n }\r\n iterateParser();\r\n });\r\n this.pages.push(page);\r\n break;\r\n } else {\r\n let region: TextureAtlasRegion = new TextureAtlasRegion();\r\n region.name = line;\r\n region.page = page;\r\n\r\n let rotate: number = reader.readValue() == \"true\" ? 6 : 0;\r\n\r\n reader.readTuple(tuple);\r\n let x = parseInt(tuple[0]);\r\n let y = parseInt(tuple[1]);\r\n\r\n reader.readTuple(tuple);\r\n let width = parseInt(tuple[0]);\r\n let height = parseInt(tuple[1]);\r\n\r\n let resolution = page.baseTexture.resolution;\r\n x /= resolution;\r\n y /= resolution;\r\n width /= resolution;\r\n height /= resolution;\r\n\r\n let frame = new PIXI.Rectangle(x, y, rotate ? height : width, rotate ? width : height);\r\n\r\n if (reader.readTuple(tuple) == 4) { // split is optional\r\n // region.splits = new Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits\r\n //region.pads = Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n reader.readTuple(tuple);\r\n }\r\n }\r\n\r\n let originalWidth = parseInt(tuple[0]) / resolution;\r\n let originalHeight = parseInt(tuple[1]) / resolution;\r\n reader.readTuple(tuple);\r\n let offsetX = parseInt(tuple[0]) / resolution;\r\n let offsetY = parseInt(tuple[1]) / resolution;\r\n\r\n let orig = new PIXI.Rectangle(0, 0, originalWidth, originalHeight);\r\n let trim = new PIXI.Rectangle(offsetX, originalHeight - height - offsetY, width, height);\r\n\r\n //TODO: pixiv3 uses different frame/crop/trim\r\n\r\n if (PIXI.VERSION[0] == '4') {\r\n // pixi v4.0.0\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame, orig, trim, rotate);\r\n } else {\r\n // pixi v3.0.11\r\n var frame2 = new PIXI.Rectangle(x, y, width, height);\r\n var crop = frame2.clone();\r\n trim.width = originalWidth;\r\n trim.height = originalHeight;\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame2, crop, trim, rotate);\r\n }\r\n\r\n region.index = parseInt(reader.readValue());\r\n region.texture._updateUvs();\r\n\r\n this.regions.push(region);\r\n }\r\n }\r\n }\r\n\r\n iterateParser();\r\n }\r\n\r\n findRegion(name: string): TextureAtlasRegion {\r\n for (let i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n dispose() {\r\n for (let i = 0; i < this.pages.length; i++) {\r\n this.pages[i].baseTexture.dispose();\r\n }\r\n }\r\n}\r\n\r\nclass TextureAtlasReader {\r\n lines: Array;\r\n index: number = 0;\r\n\r\n constructor(text: string) {\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n\r\n readLine(): string {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n }\r\n\r\n readValue(): string {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n return line.substring(colon + 1).trim();\r\n }\r\n\r\n readTuple(tuple: Array): number {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n let i = 0, lastMatch = colon + 1;\r\n for (; i < 3; i++) {\r\n let comma = line.indexOf(\",\", lastMatch);\r\n if (comma == -1) break;\r\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n }\r\n tuple[i] = line.substring(lastMatch).trim();\r\n return i + 1;\r\n }\r\n}\r\n\r\nexport class TextureAtlasPage {\r\n name: string;\r\n minFilter: TextureFilter;\r\n magFilter: TextureFilter;\r\n uWrap: TextureWrap;\r\n vWrap: TextureWrap;\r\n baseTexture: PIXI.BaseTexture;\r\n width: number;\r\n height: number;\r\n\r\n public setFilters() {\r\n let tex = this.baseTexture;\r\n let filter = this.minFilter;\r\n if (filter == TextureFilter.Linear) {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n } else if (this.minFilter == TextureFilter.Nearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.mipmap = true;\r\n if (filter == TextureFilter.MipMapNearestNearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class TextureAtlasRegion extends TextureRegion {\r\n page: TextureAtlasPage;\r\n name: string;\r\n index: number;\r\n}\r\n","import {Skin} from \"./Skin\";\r\nimport {AttachmentLoader, BoundingBoxAttachment, MeshAttachment, PathAttachment, RegionAttachment} from \"./attachments\";\r\nimport {TextureAtlas} from \"./TextureAtlas\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TextureAtlasAttachmentLoader implements AttachmentLoader {\r\n atlas: TextureAtlas;\r\n\r\n constructor (atlas: TextureAtlas) {\r\n this.atlas = atlas;\r\n }\r\n\r\n /** @return May be null to not load an attachment. */\r\n newRegionAttachment (skin: Skin, name: string, path: string): RegionAttachment {\r\n let region = this.atlas.findRegion(path);\r\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n let attachment = new RegionAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n }\r\n\r\n /** @return May be null to not load an attachment. */\r\n newMeshAttachment (skin: Skin, name: string, path: string) : MeshAttachment {\r\n let region = this.atlas.findRegion(path);\r\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n let attachment = new MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n }\r\n\r\n /** @return May be null to not load an attachment. */\r\n newBoundingBoxAttachment (skin: Skin, name: string) : BoundingBoxAttachment {\r\n return new BoundingBoxAttachment(name);\r\n }\r\n\r\n /** @return May be null to not load an attachment */\r\n newPathAttachment (skin: Skin, name: string): PathAttachment {\r\n return new PathAttachment(name);\r\n }\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {TransformConstraintData} from \"./TransformConstraintData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Vector2, MathUtils} from \"./Utils\";\r\nimport {Skeleton} from \"./Skeleton\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TransformConstraint implements Updatable {\r\n data: TransformConstraintData;\r\n bones: Array;\r\n target: Bone;\r\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\r\n temp = new Vector2();\r\n\r\n constructor (data: TransformConstraintData, skeleton: Skeleton) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (let i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n\r\n apply () {\r\n this.update();\r\n }\r\n\r\n update () {\r\n let rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n let target = this.target;\r\n let tm = target.matrix;\r\n let ta = tm.a, tb = tm.c, tc = tm.b, td = tm.d;\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n let m = bone.matrix;\r\n\r\n if (rotateMix > 0) {\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n let r = Math.atan2(tc, ta) - Math.atan2(c, a) + this.data.offsetRotation * MathUtils.degRad;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n let cos = Math.cos(r), sin = Math.sin(r);\r\n m.a = cos * a - sin * c;\r\n m.c = cos * b - sin * d;\r\n m.b = sin * a + cos * c;\r\n m.d = sin * b + cos * d;\r\n }\r\n\r\n if (translateMix > 0) {\r\n let temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n m.tx += (temp.x - bone.worldX) * translateMix;\r\n m.ty += (temp.y - bone.worldY) * translateMix;\r\n }\r\n\r\n if (scaleMix > 0) {\r\n let bs = Math.sqrt(m.a * m.a + m.b * m.b);\r\n let ts = Math.sqrt(ta * ta + tc * tc);\r\n let s = bs > 0.00001 ? (bs + (ts - bs + this.data.offsetScaleX) * scaleMix) / bs : 0;\r\n m.a *= s;\r\n m.b *= s;\r\n bs = Math.sqrt(m.c * m.c + m.d * m.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n s = bs > 0.00001 ? (bs + (ts - bs + this.data.offsetScaleY) * scaleMix) / bs : 0;\r\n m.c *= s;\r\n m.d *= s;\r\n }\r\n\r\n if (shearMix > 0) {\r\n let b = m.c, d = m.d;\r\n let by = Math.atan2(d, b);\r\n let r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(m.b, m.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r = by + (r + this.data.offsetShearY * MathUtils.degRad) * shearMix;\r\n let s = Math.sqrt(b * b + d * d);\r\n m.c = Math.cos(r) * s;\r\n m.d = Math.sin(r) * s;\r\n }\r\n }\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TransformConstraintData {\r\n name: string;\r\n bones = new Array();\r\n target: BoneData;\r\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\r\n offsetRotation = 0; offsetX = 0; offsetY = 0; offsetScaleX = 0; offsetScaleY = 0; offsetShearY = 0;\r\n\r\n constructor (name: string) {\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n}\r\n","import {Skeleton} from \"./Skeleton\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport interface Map {\r\n [key: string]: T;\r\n}\r\n\r\nexport interface Disposable {\r\n dispose (): void;\r\n}\r\n\r\nexport class Color {\r\n public static WHITE = new Color(1, 1, 1, 1);\r\n public static RED = new Color(1, 0, 0, 1);\r\n public static GREEN = new Color(0, 1, 0, 1);\r\n public static BLUE = new Color(0, 0, 1, 1);\r\n public static MAGENTA = new Color(1, 0, 1, 1);\r\n\r\n constructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\r\n }\r\n\r\n set (r: number, g: number, b: number, a: number) {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n this.clamp();\r\n return this;\r\n }\r\n\r\n setFromColor (c: Color) {\r\n this.r = c.r;\r\n this.g = c.g;\r\n this.b = c.b;\r\n this.a = c.a;\r\n return this;\r\n }\r\n\r\n setFromString (hex: string) {\r\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n return this;\r\n }\r\n\r\n add (r: number, g: number, b: number, a: number) {\r\n this.r += r;\r\n this.g += g;\r\n this.b += b;\r\n this.a += a;\r\n this.clamp();\r\n return this;\r\n }\r\n\r\n clamp () {\r\n if (this.r < 0) this.r = 0;\r\n else if (this.r > 1) this.r = 1;\r\n\r\n if (this.g < 0) this.g = 0;\r\n else if (this.g > 1) this.g = 1;\r\n\r\n if (this.b < 0) this.b = 0;\r\n else if (this.b > 1) this.b = 1;\r\n\r\n if (this.a < 0) this.a = 0;\r\n else if (this.a > 1) this.a = 1;\r\n return this;\r\n }\r\n}\r\n\r\nexport class MathUtils {\r\n static PI = 3.1415927;\r\n static PI2 = MathUtils.PI * 2;\r\n static radiansToDegrees = 180 / MathUtils.PI;\r\n static radDeg = MathUtils.radiansToDegrees;\r\n static degreesToRadians = MathUtils.PI / 180;\r\n static degRad = MathUtils.degreesToRadians;\r\n\r\n static clamp (value: number, min: number, max: number) {\r\n if (value < min) return min;\r\n if (value > max) return max;\r\n return value;\r\n }\r\n\r\n static cosDeg (degrees: number) {\r\n return Math.cos(degrees * MathUtils.degRad);\r\n }\r\n\r\n static sinDeg (degrees: number) {\r\n return Math.sin(degrees * MathUtils.degRad);\r\n }\r\n\r\n static signum (value: number): number {\r\n return value >= 0 ? 1 : -1;\r\n }\r\n\r\n static toInt (x: number) {\r\n return x > 0 ? Math.floor(x) : Math.ceil(x);\r\n }\r\n\r\n static cbrt (x: number) {\r\n var y = Math.pow(Math.abs(x), 1/3);\r\n return x < 0 ? -y : y;\r\n }\r\n}\r\n\r\nexport class Utils {\r\n static SUPPORTS_TYPED_ARRAYS = typeof(Float32Array) !== \"undefined\";\r\n\r\n static arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\r\n for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n dest[j] = source[i];\r\n }\r\n }\r\n\r\n static setArraySize (array: Array, size: number, value: any = 0): Array {\r\n let oldSize = array.length;\r\n if (oldSize == size) return array;\r\n array.length = size;\r\n if (oldSize < size) {\r\n for (let i = oldSize; i < size; i++) array[i] = value;\r\n }\r\n return array;\r\n }\r\n\r\n static newArray (size: number, defaultValue: T): Array {\r\n let array = new Array(size);\r\n for (let i = 0; i < size; i++) array[i] = defaultValue;\r\n return array;\r\n }\r\n\r\n static newFloatArray (size: number): ArrayLike {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n return new Float32Array(size)\r\n } else {\r\n let array = new Array(size);\r\n for (let i = 0; i < array.length; i++) array[i] = 0;\r\n return array;\r\n }\r\n }\r\n\r\n static toFloatArray (array: Array) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n }\r\n}\r\n\r\nexport class DebugUtils {\r\n static logBones(skeleton: Skeleton) {\r\n for (let i = 0; i < skeleton.bones.length; i++) {\r\n let bone = skeleton.bones[i];\r\n let m = bone.matrix;\r\n console.log(bone.data.name + \", \" + m.a + \", \" + m.b + \", \" + m.c + \", \" + m.d + \", \" + m.tx + \", \" + m.ty);\r\n }\r\n }\r\n}\r\n\r\nexport class Pool {\r\n private items = new Array();\r\n private instantiator: () => T;\r\n\r\n constructor (instantiator: () => T) {\r\n this.instantiator = instantiator;\r\n }\r\n\r\n obtain () {\r\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n }\r\n\r\n free (item: T) {\r\n this.items.push(item);\r\n }\r\n\r\n freeAll (items: ArrayLike) {\r\n for (let i = 0; i < items.length; i++) this.items[i] = items[i];\r\n }\r\n\r\n clear () {\r\n this.items.length = 0;\r\n }\r\n}\r\n\r\nexport class Vector2 {\r\n constructor (public x = 0, public y = 0) {\r\n }\r\n\r\n set (x: number, y: number): Vector2 {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n }\r\n\r\n length () {\r\n let x = this.x;\r\n let y = this.y;\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n normalize () {\r\n let len = this.length();\r\n if (len != 0) {\r\n this.x /= len;\r\n this.y /= len;\r\n }\r\n return this;\r\n }\r\n}\r\n\r\nexport class TimeKeeper {\r\n maxDelta = 0.064;\r\n framesPerSecond = 0;\r\n delta = 0;\r\n totalTime = 0;\r\n\r\n private lastTime = Date.now() / 1000;\r\n private frameCount = 0;\r\n private frameTime = 0;\r\n\r\n update () {\r\n var now = Date.now() / 1000;\r\n this.delta = now - this.lastTime;\r\n this.frameTime += this.delta;\r\n this.totalTime += this.delta;\r\n if (this.delta > this.maxDelta) this.delta = this.maxDelta;\r\n this.lastTime = now;\r\n\r\n this.frameCount++;\r\n if (this.frameTime > 1) {\r\n this.framesPerSecond = this.frameCount / this.frameTime;\r\n this.frameTime = 0;\r\n this.frameCount = 0;\r\n }\r\n }\r\n}\r\n","import {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport abstract class Attachment {\r\n name: string;\r\n\r\n constructor (name: string) {\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n}\r\n\r\nexport abstract class VertexAttachment extends Attachment {\r\n bones: Array;\r\n vertices: ArrayLike;\r\n worldVerticesLength = 0;\r\n\r\n constructor (name: string) {\r\n super(name);\r\n }\r\n\r\n computeWorldVertices (slot: Slot, worldVertices: ArrayLike) {\r\n this.computeWorldVerticesWith(slot, 0, this.worldVerticesLength, worldVertices, 0);\r\n }\r\n\r\n /** Transforms local vertices to world coordinates.\r\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\r\n * @param offset The worldVertices index to begin writing values. */\r\n computeWorldVerticesWith (slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number) {\r\n count += offset;\r\n let skeleton = slot.bone.skeleton;\r\n let x = skeleton.x, y = skeleton.y;\r\n let deformArray = slot.attachmentVertices;\r\n let vertices = this.vertices;\r\n let bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0) vertices = deformArray;\r\n let bone = slot.bone;\r\n let m = bone.matrix;\r\n x += m.tx;\r\n y += m.ty;\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n for (let v = start, w = offset; w < count; v += 2, w += 2) {\r\n let vx = vertices[v], vy = vertices[v + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n let v = 0, skip = 0;\r\n for (let i = 0; i < start; i += 2) {\r\n let n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n let skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (let w = offset, b = skip * 3; w < count; w += 2) {\r\n let wx = x, wy = y;\r\n let n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n let bone = skeletonBones[bones[v]];\r\n let m = bone.matrix;\r\n let vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\r\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n } else {\r\n let deform = deformArray;\r\n for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += 2) {\r\n let wx = x, wy = y;\r\n let n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n let bone = skeletonBones[bones[v]];\r\n let m = bone.matrix;\r\n let vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\r\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n }\r\n\r\n /** Returns true if a deform originally applied to the specified attachment should be applied to this attachment. */\r\n applyDeform (sourceAttachment: VertexAttachment) {\r\n return this == sourceAttachment;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum AttachmentType {\r\n Region, BoundingBox, Mesh, LinkedMesh, Path\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class BoundingBoxAttachment extends VertexAttachment {\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor(name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {TextureRegion} from \"../Texture\";\r\nimport {Color, Utils} from \"../Utils\";\r\nimport {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class MeshAttachment extends VertexAttachment {\r\n region: TextureRegion;\r\n path: string;\r\n regionUVs: ArrayLike;\r\n triangles: Array;\r\n color = new Color(1, 1, 1, 1);\r\n hullLength: number;\r\n private parentMesh: MeshAttachment;\r\n inheritDeform = false;\r\n tempColor = new Color(0, 0, 0, 0);\r\n\r\n constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\r\n return [];\r\n //nothing\r\n }\r\n\r\n updateUVs(region: TextureRegion, uvs: ArrayLike): ArrayLike {\r\n let regionUVs = this.regionUVs;\r\n let n = regionUVs.length;\r\n if (!uvs || uvs.length != n) {\r\n uvs = Utils.newFloatArray(n);\r\n }\r\n\r\n if (region == null) {\r\n return;\r\n }\r\n\r\n let texture = region.texture;\r\n let r = texture._uvs;\r\n let w1 = region.width, h1 = region.height, w2 = region.originalWidth, h2 = region.originalHeight;\r\n let x = region.offsetX, y = region.pixiOffsetY;\r\n\r\n for (let i = 0; i < n; i += 2) {\r\n let u = this.regionUVs[i], v = this.regionUVs[i + 1];\r\n u = (u * w2 - x) / w1;\r\n v = (v * h2 - y) / h1;\r\n uvs[i] = (r.x0 * (1 - u) + r.x1 * u) * (1 - v) + (r.x3 * (1 - u) + r.x2 * u) * v;\r\n uvs[i + 1] = (r.y0 * (1 - u) + r.y1 * u) * (1 - v) + (r.y3 * (1 - u) + r.y2 * u) * v;\r\n }\r\n\r\n return uvs;\r\n }\r\n\r\n applyDeform(sourceAttachment: VertexAttachment): boolean {\r\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n }\r\n\r\n getParentMesh() {\r\n return this.parentMesh;\r\n }\r\n\r\n /** @param parentMesh May be null. */\r\n setParentMesh(parentMesh: MeshAttachment) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n }\r\n }\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathAttachment extends VertexAttachment {\r\n lengths: Array;\r\n closed = false; constantSpeed = false;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor (name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {Attachment} from \"./Attachment\";\r\nimport {Color, Utils} from \"../Utils\";\r\nimport {TextureRegion} from \"../Texture\";\r\nimport {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class RegionAttachment extends Attachment {\r\n x = 0; y = 0; scaleX = 1; scaleY = 1; rotation = 0; width = 0; height = 0;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n path: string;\r\n region: TextureRegion;\r\n\r\n constructor (name:string) {\r\n super(name);\r\n }\r\n\r\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\r\n return [];\r\n //nothing\r\n }\r\n}\r\n","export {Attachment, VertexAttachment} from \"./Attachment\";\r\nexport {AttachmentLoader} from \"./AttachmentLoader\";\r\nexport {AttachmentType} from \"./AttachmentType\";\r\nexport {BoundingBoxAttachment} from \"./BoundingBoxAttachment\";\r\nexport {MeshAttachment} from \"./MeshAttachment\";\r\nexport {PathAttachment} from \"./PathAttachment\";\r\nexport {RegionAttachment} from \"./RegionAttachment\";\r\n","export * from \"./attachments\";\r\n\r\nexport {\r\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\r\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\r\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\r\n Animation, CurveTimeline\r\n} from \"./Animation\";\r\nexport {AnimationState} from \"./AnimationState\";\r\nexport {AnimationStateData} from \"./AnimationStateData\";\r\nexport {BlendMode} from \"./BlendMode\";\r\nexport {Bone} from \"./Bone\";\r\nexport {BoneData} from \"./BoneData\";\r\nexport {Event} from \"./Event\";\r\nexport {EventData} from \"./EventData\";\r\nexport {IkConstraint} from \"./IkConstraint\";\r\nexport {IkConstraintData} from \"./IkConstraintData\";\r\nexport {PathConstraint} from \"./PathConstraint\";\r\nexport {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\r\nexport {Skeleton} from \"./Skeleton\";\r\nexport {SkeletonBounds} from \"./SkeletonBounds\";\r\nexport {SkeletonData} from \"./SkeletonData\";\r\nexport {SkeletonJson} from \"./SkeletonJson\";\r\nexport {Skin} from \"./Skin\";\r\nexport {Slot} from \"./Slot\";\r\nexport {SlotData} from \"./SlotData\";\r\nexport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\r\nexport {TextureAtlas, TextureAtlasRegion} from \"./TextureAtlas\";\r\nexport {TextureAtlasAttachmentLoader} from \"./TextureAtlasAttachmentLoader\";\r\nexport {TransformConstraint} from \"./TransformConstraint\";\r\nexport {TransformConstraintData} from \"./TransformConstraintData\";\r\nexport {Updatable} from \"./Updatable\";\r\nexport {Disposable, Map, Utils, Pool, MathUtils, Color, Vector2} from \"./Utils\";\r\n","import * as spine from \"./core\";\r\n\r\nexport function atlasParser() {\r\n return function (resource: PIXI.loaders.Resource, next: () => any) {\r\n // skip if no data, its not json, or it isn't atlas data\r\n if (!resource.data || !resource.isJson || !resource.data.bones) {\r\n return next();\r\n }\r\n\r\n var metadataAtlas = resource.metadata ? resource.metadata.spineAtlas: null;\r\n if (metadataAtlas === false) {\r\n return next();\r\n }\r\n if (metadataAtlas && metadataAtlas.pages) {\r\n //its an atlas!\r\n var spineJsonParser = new spine.SkeletonJson(new spine.TextureAtlasAttachmentLoader(metadataAtlas));\r\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\r\n\r\n resource.spineData = skeletonData;\r\n resource.spineAtlas = metadataAtlas;\r\n\r\n return next();\r\n }\r\n\r\n var metadataAtlasSuffix = '.atlas';\r\n if (resource.metadata && resource.metadata.spineAtlasSuffix) {\r\n metadataAtlasSuffix = resource.metadata.spineAtlasSuffix;\r\n }\r\n\r\n /**\r\n * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files\r\n * that correspond to the spine file are in the same base URL and that the .json and .atlas files\r\n * have the same name\r\n */\r\n var atlasPath = resource.url.substr(0, resource.url.lastIndexOf('.')) + metadataAtlasSuffix;\r\n //remove the baseUrl\r\n atlasPath = atlasPath.replace(this.baseUrl, '');\r\n\r\n var atlasOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n xhrType: PIXI.loaders.Resource.XHR_RESPONSE_TYPE.TEXT,\r\n metadata: resource.metadata ? resource.metadata.spineMetadata : null\r\n };\r\n var imageOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n metadata: resource.metadata ? resource.metadata.imageMetadata: null\r\n };\r\n var baseUrl = resource.url.substr(0, resource.url.lastIndexOf('/') + 1);\r\n //remove the baseUrl\r\n baseUrl = baseUrl.replace(this.baseUrl, '');\r\n\r\n var adapter = imageLoaderAdapter(this, resource.name + '_atlas_page_', baseUrl, imageOptions);\r\n\r\n this.add(resource.name + '_atlas', atlasPath, atlasOptions, function () {\r\n new spine.TextureAtlas(this.xhr.responseText, adapter, function(spineAtlas) {\r\n var spineJsonParser = new spine.SkeletonJson(new spine.TextureAtlasAttachmentLoader(spineAtlas));\r\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\r\n\r\n resource.spineData = skeletonData;\r\n resource.spineAtlas = spineAtlas;\r\n\r\n next();\r\n });\r\n });\r\n };\r\n}\r\n\r\nexport function imageLoaderAdapter(loader: any, namePrefix: any, baseUrl: any, imageOptions: any) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\r\n {\r\n baseUrl += '/';\r\n }\r\n return function(line: String, callback: (baseTexture: PIXI.BaseTexture) => any) {\r\n var name = namePrefix + line;\r\n var url = baseUrl + line;\r\n loader.add(name, url, imageOptions, (resource: PIXI.loaders.Resource) => {\r\n callback(resource.texture.baseTexture);\r\n });\r\n }\r\n}\r\n\r\nexport function syncImageLoaderAdapter (baseUrl: any, crossOrigin: any) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\r\n {\r\n baseUrl += '/';\r\n }\r\n return function(line: any, callback: any) {\r\n callback(PIXI.BaseTexture.fromImage(line, crossOrigin));\r\n }\r\n}\r\n\r\nPIXI.loaders.Loader.addPixiMiddleware(atlasParser);\r\nPIXI.loader.use(atlasParser());\r\n","import * as core from \"./core\";\r\nimport * as loaders from \"./loaders\";\r\n\r\nexport {core, loaders}\r\nexport {Spine, SpineMesh, SpineSprite} from \"./Spine\";\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["../pixify/node_modules/browser-pack/_prelude.js","src/Spine.ts","src/core/Animation.ts","src/core/AnimationState.ts","src/core/AnimationStateData.ts","src/core/AtlasAttachmentLoader.ts","src/core/BlendMode.ts","src/core/Bone.ts","src/core/BoneData.ts","src/core/Event.ts","src/core/EventData.ts","src/core/IkConstraint.ts","src/core/IkConstraintData.ts","src/core/PathConstraint.ts","src/core/PathConstraintData.ts","src/core/Skeleton.ts","src/core/SkeletonBounds.ts","src/core/SkeletonData.ts","src/core/SkeletonJson.ts","src/core/Skin.ts","src/core/Slot.ts","src/core/SlotData.ts","src/core/Texture.ts","src/core/TextureAtlas.ts","src/core/TransformConstraint.ts","src/core/TransformConstraintData.ts","src/core/Utils.ts","src/core/attachments/Attachment.ts","src/core/attachments/AttachmentType.ts","src/core/attachments/BoundingBoxAttachment.ts","src/core/attachments/MeshAttachment.ts","src/core/attachments/PathAttachment.ts","src/core/attachments/RegionAttachment.ts","src/core/attachments/index.ts","src/core/index.ts","src/loaders.ts","src/index.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;ACAA,IAAY,KAAK,WAAM,QAAQ,CAAC,CAAA;AAIhC,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;AAGvC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AAExB,IAAI,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExB;IAAiC,+BAAW;IAGxC,qBAAY,GAAiB;QACzB,kBAAM,GAAG,CAAC,CAAC;IACf,CAAC;IACL,kBAAC;AAAD,CANA,AAMC,CANgC,IAAI,CAAC,MAAM,GAM3C;AANY,mBAAW,cAMvB,CAAA;AAED;IAA+B,6BAAc;IAGzC,mBAAY,OAAqB,EAAE,QAA4B,EAAE,GAAuB,EAAE,OAA2B,EAAE,QAAiB;QACpI,kBAAM,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IACL,gBAAC;AAAD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AC,UAAS,IAAY,EAAE,QAAgD;QAC1E,IAAI,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC;QAC7B,IAAI,GAAG,GAAG,OAAO,GAAG,IAAI,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,UAAC,QAA+B;YAChE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAA;AACL,CAAC;AAZe,0BAAkB,qBAYjC,CAAA;AAED,gCAAwC,OAAY,EAAE,WAAgB;IAClE,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAC/D,CAAC;QACG,OAAO,IAAI,GAAG,CAAC;IACnB,CAAC;IACD,MAAM,CAAC,UAAS,IAAS,EAAE,QAAa;QACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAA;AACL,CAAC;AARe,8BAAsB,yBAQrC,CAAA;AAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;AACnD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;;;AC5F/B,IAAY,IAAI,WAAM,QAAQ,CAAC,CAAA;AAGvB,YAAI;AAFZ,IAAY,OAAO,WAAM,WAAW,CAAC,CAAA;AAEvB,eAAO;AACrB,sBAA4C,SAAS,CAAC;AAA9C,8BAAK;AAAE,sCAAS;AAAE,0CAA4B","file":"pixi-spine.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o, uvs?: ArrayLike, indices?: ArrayLike, drawMode?: number) {\n super(texture, vertices, uvs, indices, drawMode);\n }\n}\n\n/**\n * A class that enables the you to import and run your spine animations in pixi.\n * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class\n * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\n *\n * ```js\n * var spineAnimation = new PIXI.Spine(spineData);\n * ```\n *\n * @class\n * @extends Container\n * @memberof PIXI.spine\n * @param spineData {object} The spine data loaded from a spine atlas.\n */\nexport class Spine extends PIXI.Container {\n static globalAutoUpdate: boolean = true;\n\n tintRgb: ArrayLike;\n spineData: spine.SkeletonData;\n skeleton: spine.Skeleton;\n stateData: spine.AnimationStateData;\n state: spine.AnimationState;\n slotContainers: Array;\n\n constructor(spineData: spine.SkeletonData) {\n super();\n\n if (!spineData) {\n throw new Error('The spineData param is required.');\n }\n\n if ((typeof spineData) === \"string\") {\n throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas(\"YOUR_RESOURCE_NAME\") from now on.');\n }\n\n /**\n * The spineData object\n *\n * @member {object}\n */\n this.spineData = spineData;\n\n /**\n * A spine Skeleton object\n *\n * @member {object}\n */\n this.skeleton = new spine.Skeleton(spineData);\n this.skeleton.updateWorldTransform();\n\n /**\n * A spine AnimationStateData object created from the spine data passed in the constructor\n *\n * @member {object}\n */\n this.stateData = new spine.AnimationStateData(spineData);\n\n /**\n * A spine AnimationState object created from the spine AnimationStateData object\n *\n * @member {object}\n */\n this.state = new spine.AnimationState(this.stateData);\n\n /**\n * An array of containers\n *\n * @member {Container[]}\n */\n this.slotContainers = [];\n\n for (var i = 0, n = this.skeleton.slots.length; i < n; i++) {\n var slot = this.skeleton.slots[i];\n var attachment : any = slot.attachment;\n var slotContainer = new PIXI.Container();\n this.slotContainers.push(slotContainer);\n this.addChild(slotContainer);\n\n if (attachment instanceof spine.RegionAttachment) {\n var spriteName = (attachment.region as TextureAtlasRegion).name;\n var sprite = this.createSprite(slot, attachment, spriteName);\n slot.currentSprite = sprite;\n slot.currentSpriteName = spriteName;\n slotContainer.addChild(sprite);\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = this.createMesh(slot, attachment);\n slot.currentMesh = mesh;\n slot.currentMeshName = attachment.name;\n slotContainer.addChild(mesh);\n }\n else {\n continue;\n }\n\n }\n\n /**\n * Should the Spine object update its transforms\n *\n * @member {boolean}\n */\n this.autoUpdate = true;\n\n /**\n * The tint applied to all spine slots. This is a [r,g,b] value. A value of [1,1,1] will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n */\n this.tintRgb = new Float32Array([1, 1, 1]);\n }\n\n /**\n * If this flag is set to true, the spine animation will be autoupdated every time\n * the object id drawn. The down side of this approach is that the delta time is\n * automatically calculated and you could miss out on cool effects like slow motion,\n * pause, skip ahead and the sorts. Most of these effects can be achieved even with\n * autoupdate enabled but are harder to achieve.\n *\n * @member {boolean}\n * @memberof PIXI.spine.Spine#\n * @default true\n */\n get autoUpdate(): boolean {\n return (this.updateTransform === Spine.prototype.autoUpdateTransform);\n }\n\n set autoUpdate(value: boolean) {\n this.updateTransform = value ? Spine.prototype.autoUpdateTransform : PIXI.Container.prototype.updateTransform;\n }\n\n /**\n * The tint applied to the spine object. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n * @default 0xFFFFFF\n */\n get tint(): number {\n return PIXI.utils.rgb2hex(this.tintRgb);\n }\n\n set tint(value: number) {\n this.tintRgb = PIXI.utils.hex2rgb(value, this.tintRgb);\n }\n\n /**\n * Update the spine skeleton and its animations by delta time (dt)\n *\n * @param dt {number} Delta time. Time by which the animation should be updated\n */\n update(dt: number) {\n this.state.update(dt);\n this.state.apply(this.skeleton);\n this.skeleton.updateWorldTransform();\n\n let drawOrder = this.skeleton.drawOrder;\n let slots = this.skeleton.slots;\n\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n this.children[i] = this.slotContainers[drawOrder[i].data.index];\n }\n\n var r0 = this.tintRgb[0];\n var g0 = this.tintRgb[1];\n var b0 = this.tintRgb[2];\n\n for (i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n var attachment = slot.attachment;\n var slotContainer = this.slotContainers[i];\n\n if (!attachment) {\n slotContainer.visible = false;\n continue;\n }\n\n var attColor = (attachment as any).color;\n if (attachment instanceof spine.RegionAttachment) {\n let region = (attachment as spine.RegionAttachment).region;\n if (region) {\n let ar = region as TextureAtlasRegion;\n if (!slot.currentSpriteName || slot.currentSpriteName !== ar.name) {\n var spriteName = ar.name;\n if (slot.currentSprite) {\n slot.currentSprite.visible = false;\n }\n slot.sprites = slot.sprites || {};\n if (slot.sprites[spriteName] !== undefined) {\n slot.sprites[spriteName].visible = true;\n }\n else {\n var sprite = this.createSprite(slot, attachment, spriteName);\n slotContainer.addChild(sprite);\n }\n slot.currentSprite = slot.sprites[spriteName];\n slot.currentSpriteName = spriteName;\n }\n }\n\n if (slotContainer.transform) {\n var transform = slotContainer.transform;\n let lt : PIXI.Matrix;\n if (slotContainer.transform.matrix2d) {\n //gameofbombs pixi fork\n lt = transform.matrix2d;\n transform._dirtyVersion++;\n transform.version = transform._dirtyVersion;\n transform.isStatic = true;\n transform.operMode = 0;\n } else {\n if (TransformBase) {\n //PIXI v4.0\n if (transform.position) {\n transform = new PIXI.TransformBase();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n } else {\n //PIXI v4.0rc\n if (!transform._dirtyLocal) {\n transform = new PIXI.TransformStatic();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n transform._dirtyParentVersion = -1;\n transform._dirtyLocal = 1;\n transform._versionLocal = 1;\n }\n }\n slot.bone.matrix.copy(lt);\n } else {\n //PIXI v3\n var lt = slotContainer.localTransform || new PIXI.Matrix();\n slot.bone.matrix.copy(lt);\n slotContainer.localTransform = lt;\n slotContainer.displayObjectUpdateTransform = SlotContainerUpdateTransformV3;\n }\n tempRgb[0] = r0 * slot.color.r * attColor.r;\n tempRgb[1] = g0 * slot.color.g * attColor.g;\n tempRgb[2] = b0 * slot.color.b * attColor.b;\n slot.currentSprite.tint = PIXI.utils.rgb2hex(tempRgb);\n slot.currentSprite.blendMode = slot.blendMode;\n }\n else if (attachment instanceof spine.MeshAttachment) {\n if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) {\n var meshName = attachment.name;\n if (slot.currentMesh) {\n slot.currentMesh.visible = false;\n }\n\n slot.meshes = slot.meshes || {};\n\n if (slot.meshes[meshName] !== undefined) {\n slot.meshes[meshName].visible = true;\n }\n else {\n var mesh = this.createMesh(slot, attachment);\n slotContainer.addChild(mesh);\n }\n\n slot.currentMesh = slot.meshes[meshName];\n slot.currentMeshName = meshName;\n }\n (attachment as VertexAttachment).computeWorldVertices(slot, slot.currentMesh.vertices);\n if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // slot.currentMesh.dirty++;\n //only for PIXI v4\n var tintRgb = slot.currentMesh.tintRgb;\n tintRgb[0] = r0 * slot.color.r * attColor.r;\n tintRgb[1] = g0 * slot.color.g * attColor.g;\n tintRgb[2] = b0 * slot.color.b * attColor.b;\n }\n slot.currentMesh.blendMode = slot.blendMode;\n }\n else {\n slotContainer.visible = false;\n continue;\n }\n slotContainer.visible = true;\n\n slotContainer.alpha = slot.color.a;\n }\n };\n\n private setSpriteRegion(attachment: spine.RegionAttachment, sprite: SpineSprite, region: spine.TextureRegion) {\n sprite.region = region;\n sprite.texture = region.texture;\n if (!region.size) {\n sprite.scale.x = attachment.scaleX * attachment.width / region.originalWidth;\n sprite.scale.y = -attachment.scaleY * attachment.height / region.originalHeight;\n } else {\n //hacked!\n sprite.scale.x = region.size.width / region.originalWidth;\n sprite.scale.y = -region.size.height / region.originalHeight;\n }\n }\n\n private setMeshRegion(attachment: spine.MeshAttachment, mesh: SpineMesh, region: spine.TextureRegion) {\n mesh.region = region;\n mesh.texture = region.texture;\n attachment.updateUVs(region, mesh.uvs);\n // if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // mesh.indexDirty++;\n // } else {\n // PIXI version 3\n mesh.dirty++;\n // }\n }\n\n protected lastTime: number;\n\n /**\n * When autoupdate is set to yes this function is used as pixi's updateTransform function\n *\n * @private\n */\n autoUpdateTransform() {\n if (Spine.globalAutoUpdate) {\n this.lastTime = this.lastTime || Date.now();\n var timeDelta = (Date.now() - this.lastTime) * 0.001;\n this.lastTime = Date.now();\n this.update(timeDelta);\n } else {\n this.lastTime = 0;\n }\n\n PIXI.Container.prototype.updateTransform.call(this);\n };\n\n /**\n * Create a new sprite to be used with spine.RegionAttachment\n *\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createSprite(slot: spine.Slot, attachment: spine.RegionAttachment, defName: string) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n var texture = region.texture;\n var sprite = new SpineSprite(texture);\n sprite.rotation = attachment.rotation * spine.MathUtils.degRad;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n sprite.position.x = attachment.x;\n sprite.position.y = attachment.y;\n sprite.alpha = attachment.color.a;\n\n sprite.region = attachment.region;\n this.setSpriteRegion(attachment, sprite, attachment.region);\n\n slot.sprites = slot.sprites || {};\n slot.sprites[defName] = sprite;\n return sprite;\n };\n\n /**\n * Creates a Strip from the spine data\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createMesh(slot: spine.Slot, attachment: spine.MeshAttachment) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n let strip = new SpineMesh(\n region.texture,\n new Float32Array(attachment.regionUVs.length),\n new Float32Array(attachment.regionUVs.length),\n new Uint16Array(attachment.triangles),\n PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);\n\n strip.canvasPadding = 1.5;\n\n strip.alpha = attachment.color.a;\n\n strip.region = attachment.region;\n this.setMeshRegion(attachment, strip, region);\n\n slot.meshes = slot.meshes || {};\n slot.meshes[attachment.name] = strip;\n return strip;\n };\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotIndex {number}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotIndex(slotIndex: number, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var slot = this.skeleton.slots[slotIndex];\n if (!slot) {\n return false;\n }\n var attachment: any = slot.attachment;\n var region: spine.TextureRegion = attachment.region;\n if (texture) {\n region = new spine.TextureRegion();\n region.texture = texture;\n region.size = size;\n }\n if (slot.currentSprite && slot.currentSprite.region != region) {\n this.setSpriteRegion(attachment, slot.currentSprite, region);\n slot.currentSprite.region = region;\n } else\n if (slot.currentMesh && slot.currentMesh.region != region) {\n this.setMeshRegion(attachment, slot.currentMesh, region);\n } else {\n slot.tempRegion = region;\n slot.tempAttachment = attachment;\n }\n return true;\n }\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotName {string}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotName = function (slotName: String, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var index = this.skeleton.findSlotIndex(slotName);\n if (index == -1) {\n return false;\n }\n return this.hackTextureBySlotIndex(index, texture, size);\n }\n}\n\nfunction SlotContainerUpdateTransformV3() {\n var pt = this.parent.worldTransform;\n var wt = this.worldTransform;\n var lt = this.localTransform;\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n this._currentBounds = null;\n}\n","import {Event} from \"./Event\";\nimport {Skeleton} from \"./Skeleton\";\nimport {PathConstraint} from \"./PathConstraint\";\nimport {Utils, MathUtils, Color, ArrayLike} from \"./Utils\";\nimport {TransformConstraint} from \"./TransformConstraint\";\nimport {IkConstraint} from \"./IkConstraint\";\nimport {VertexAttachment, Attachment} from \"./attachments\";\nimport {Slot} from \"./Slot\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Animation {\n name: string;\n timelines: Array;\n duration: number;\n\n constructor (name: string, timelines: Array, duration: number) {\n if (name == null) throw new Error(\"name cannot be null.\");\n if (timelines == null) throw new Error(\"timelines cannot be null.\");\n this.name = name;\n this.timelines = timelines;\n this.duration = duration;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array) {\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n\n if (loop && this.duration != 0) {\n time %= this.duration;\n if (lastTime > 0) lastTime %= this.duration;\n }\n\n let timelines = this.timelines;\n for (let i = 0, n = timelines.length; i < n; i++)\n timelines[i].apply(skeleton, lastTime, time, events, 1);\n }\n\n mix (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number) {\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n\n if (loop && this.duration != 0) {\n time %= this.duration;\n if (lastTime > 0) lastTime %= this.duration;\n }\n\n let timelines = this.timelines;\n for (let i = 0, n = timelines.length; i < n; i++)\n timelines[i].apply(skeleton, lastTime, time, events, alpha);\n }\n\n static binarySearch (values: ArrayLike, target: number, step: number = 1) {\n let low = 0;\n let high = values.length / step - 2;\n if (high == 0) return step;\n let current = high >>> 1;\n while (true) {\n if (values[(current + 1) * step] <= target)\n low = current + 1;\n else\n high = current;\n if (low == high) return (low + 1) * step;\n current = (low + high) >>> 1;\n }\n }\n\n static linearSearch (values: ArrayLike, target: number, step: number) {\n for (let i = 0, last = values.length - step; i <= last; i += step)\n if (values[i] > target) return i;\n return -1;\n }\n}\n\nexport interface Timeline {\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\n}\n\nexport abstract class CurveTimeline implements Timeline {\n static LINEAR = 0; static STEPPED = 1; static BEZIER = 2;\n static BEZIER_SIZE = 10 * 2 - 1;\n\n private curves: ArrayLike; // type, x, y, ...\n\n constructor (frameCount: number) {\n if (frameCount <= 0) throw new Error(\"frameCount must be > 0: \" + frameCount);\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\n }\n\n getFrameCount () {\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\n }\n\n setLinear (frameIndex: number) {\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\n }\n\n setStepped (frameIndex: number) {\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\n }\n\n getCurveType (frameIndex: number): number {\n let index = frameIndex * CurveTimeline.BEZIER_SIZE;\n if (index == this.curves.length) return CurveTimeline.LINEAR;\n let type = this.curves[index];\n if (type == CurveTimeline.LINEAR) return CurveTimeline.LINEAR;\n if (type == CurveTimeline.STEPPED) return CurveTimeline.STEPPED;\n return CurveTimeline.BEZIER;\n }\n\n /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\n * the difference between the keyframe's values. */\n setCurve (frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number) {\n let tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\n let dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\n let ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\n let dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\n\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\n let curves = this.curves;\n curves[i++] = CurveTimeline.BEZIER;\n\n let x = dfx, y = dfy;\n for (let n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n curves[i] = x;\n curves[i + 1] = y;\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n x += dfx;\n y += dfy;\n }\n }\n\n getCurvePercent (frameIndex: number, percent: number) {\n percent = MathUtils.clamp(percent, 0, 1);\n let curves = this.curves;\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\n let type = curves[i];\n if (type == CurveTimeline.LINEAR) return percent;\n if (type == CurveTimeline.STEPPED) return 0;\n i++;\n let x = 0;\n for (let start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n x = curves[i];\n if (x >= percent) {\n let prevX: number, prevY: number;\n if (i == start) {\n prevX = 0;\n prevY = 0;\n } else {\n prevX = curves[i - 2];\n prevY = curves[i - 1];\n }\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\n }\n }\n let y = curves[i - 1];\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\n }\n\n abstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\n}\n\nexport class RotateTimeline extends CurveTimeline {\n static ENTRIES = 2;\n static PREV_TIME = -2; static PREV_ROTATION = -1;\n static ROTATION = 1;\n\n boneIndex: number;\n frames: ArrayLike; // time, degrees, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount << 1);\n }\n\n /** Sets the time and angle of the specified keyframe. */\n setFrame (frameIndex: number, time: number, degrees: number) {\n frameIndex <<= 1;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\n let amount = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION] - bone.rotation;\n while (amount > 180)\n amount -= 360;\n while (amount < -180)\n amount += 360;\n bone.rotation += amount * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\n let prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent((frame >> 1) - 1,\n 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\n\n let amount = frames[frame + RotateTimeline.ROTATION] - prevRotation;\n while (amount > 180)\n amount -= 360;\n while (amount < -180)\n amount += 360;\n amount = bone.data.rotation + (prevRotation + amount * percent) - bone.rotation;\n while (amount > 180)\n amount -= 360;\n while (amount < -180)\n amount += 360;\n bone.rotation += amount * alpha;\n }\n}\n\nexport class TranslateTimeline extends CurveTimeline {\n static ENTRIES = 3;\n static PREV_TIME = -3; static PREV_X = -2; static PREV_Y = -1;\n static X = 1; static Y = 2;\n\n boneIndex: number;\n frames: ArrayLike; // time, x, y, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, x: number, y: number) {\n frameIndex *= TranslateTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TranslateTimeline.X] = x;\n this.frames[frameIndex + TranslateTimeline.Y] = y;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\n bone.x += (bone.data.x + frames[frames.length + TranslateTimeline.PREV_X] - bone.x) * alpha;\n bone.y += (bone.data.y + frames[frames.length + TranslateTimeline.PREV_Y] - bone.y) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\n let prevX = frames[frame + TranslateTimeline.PREV_X];\n let prevY = frames[frame + TranslateTimeline.PREV_Y];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\n\n bone.x += (bone.data.x + prevX + (frames[frame + TranslateTimeline.X] - prevX) * percent - bone.x) * alpha;\n bone.y += (bone.data.y + prevY + (frames[frame + TranslateTimeline.Y] - prevY) * percent - bone.y) * alpha;\n }\n}\n\nexport class ScaleTimeline extends TranslateTimeline {\n constructor (frameCount: number) {\n super(frameCount);\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\n bone.scaleX += (bone.data.scaleX * frames[frames.length + ScaleTimeline.PREV_X] - bone.scaleX) * alpha;\n bone.scaleY += (bone.data.scaleY * frames[frames.length + ScaleTimeline.PREV_Y] - bone.scaleY) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\n let prevX = frames[frame + ScaleTimeline.PREV_X];\n let prevY = frames[frame + ScaleTimeline.PREV_Y];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\n\n bone.scaleX += (bone.data.scaleX * (prevX + (frames[frame + ScaleTimeline.X] - prevX) * percent) - bone.scaleX) * alpha;\n bone.scaleY += (bone.data.scaleY * (prevY + (frames[frame + ScaleTimeline.Y] - prevY) * percent) - bone.scaleY) * alpha;\n }\n}\n\nexport class ShearTimeline extends TranslateTimeline {\n constructor (frameCount: number) {\n super(frameCount);\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\n bone.shearX += (bone.data.shearX + frames[frames.length + ShearTimeline.PREV_X] - bone.shearX) * alpha;\n bone.shearY += (bone.data.shearY + frames[frames.length + ShearTimeline.PREV_Y] - bone.shearY) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\n let prevX = frames[frame + ShearTimeline.PREV_X];\n let prevY = frames[frame + ShearTimeline.PREV_Y];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\n\n bone.shearX += (bone.data.shearX + (prevX + (frames[frame + ShearTimeline.X] - prevX) * percent) - bone.shearX) * alpha;\n bone.shearY += (bone.data.shearY + (prevY + (frames[frame + ShearTimeline.Y] - prevY) * percent) - bone.shearY) * alpha;\n }\n}\n\nexport class ColorTimeline extends CurveTimeline {\n static ENTRIES = 5;\n static PREV_TIME = -5; static PREV_R = -4; static PREV_G = -3; static PREV_B = -2; static PREV_A = -1;\n static R = 1; static G = 2; static B = 3; static A = 4;\n\n slotIndex: number;\n frames: ArrayLike; // time, r, g, b, a, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, r: number, g: number, b: number, a: number) {\n frameIndex *= ColorTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + ColorTimeline.R] = r;\n this.frames[frameIndex + ColorTimeline.G] = g;\n this.frames[frameIndex + ColorTimeline.B] = b;\n this.frames[frameIndex + ColorTimeline.A] = a;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let r = 0, g = 0, b = 0, a = 0;\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n r = frames[i + ColorTimeline.PREV_R];\n g = frames[i + ColorTimeline.PREV_G];\n b = frames[i + ColorTimeline.PREV_B];\n a = frames[i + ColorTimeline.PREV_A];\n } else {\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\n r = frames[frame + ColorTimeline.PREV_R];\n g = frames[frame + ColorTimeline.PREV_G];\n b = frames[frame + ColorTimeline.PREV_B];\n a = frames[frame + ColorTimeline.PREV_A];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\n\n r += (frames[frame + ColorTimeline.R] - r) * percent;\n g += (frames[frame + ColorTimeline.G] - g) * percent;\n b += (frames[frame + ColorTimeline.B] - b) * percent;\n a += (frames[frame + ColorTimeline.A] - a) * percent;\n }\n let color: Color = skeleton.slots[this.slotIndex].color;\n if (alpha < 1)\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n else\n color.set(r, g, b, a);\n }\n}\n\nexport class AttachmentTimeline implements Timeline {\n slotIndex: number;\n frames: ArrayLike // time, ...\n attachmentNames: Array;\n\n constructor (frameCount: number) {\n this.frames = Utils.newFloatArray(frameCount);\n this.attachmentNames = new Array(frameCount);\n }\n\n getFrameCount () {\n return this.frames.length;\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, attachmentName: string) {\n this.frames[frameIndex] = time;\n this.attachmentNames[frameIndex] = attachmentName;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frameIndex = 0;\n if (time >= frames[frames.length - 1]) // Time is after last frame.\n frameIndex = frames.length - 1;\n else\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\n\n let attachmentName = this.attachmentNames[frameIndex];\n skeleton.slots[this.slotIndex]\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n }\n}\n\nexport class EventTimeline implements Timeline {\n frames: ArrayLike; // time, ...\n events: Array;\n\n constructor (frameCount: number) {\n this.frames = Utils.newFloatArray(frameCount);\n this.events = new Array(frameCount);\n }\n\n getFrameCount () {\n return this.frames.length;\n }\n\n /** Sets the time of the specified keyframe. */\n setFrame (frameIndex: number, event: Event) {\n this.frames[frameIndex] = event.time;\n this.events[frameIndex] = event;\n }\n\n /** Fires events for frames > lastTime and <= time. */\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n if (firedEvents == null) return;\n let frames = this.frames;\n let frameCount = this.frames.length;\n\n if (lastTime > time) { // Fire events after last time for looped animations.\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha);\n lastTime = -1;\n } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\n return;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frame = 0;\n if (lastTime < frames[0])\n frame = 0;\n else {\n frame = Animation.binarySearch(frames, lastTime);\n let frameTime = frames[frame];\n while (frame > 0) { // Fire multiple events with the same frame.\n if (frames[frame - 1] != frameTime) break;\n frame--;\n }\n }\n for (; frame < frameCount && time >= frames[frame]; frame++)\n firedEvents.push(this.events[frame]);\n }\n}\n\nexport class DrawOrderTimeline implements Timeline {\n frames: ArrayLike; // time, ...\n drawOrders: Array>;\n\n constructor (frameCount: number) {\n this.frames = Utils.newFloatArray(frameCount);\n this.drawOrders = new Array>(frameCount);\n }\n\n getFrameCount () {\n return this.frames.length;\n }\n\n /** Sets the time of the specified keyframe.\n * @param drawOrder May be null to use bind pose draw order. */\n setFrame (frameIndex: number, time: number, drawOrder: Array) {\n this.frames[frameIndex] = time;\n this.drawOrders[frameIndex] = drawOrder;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frame = 0;\n if (time >= frames[frames.length - 1]) // Time is after last frame.\n frame = frames.length - 1;\n else\n frame = Animation.binarySearch(frames, time) - 1;\n\n let drawOrder: Array = skeleton.drawOrder;\n let slots: Array = skeleton.slots;\n let drawOrderToSetupIndex = this.drawOrders[frame];\n if (drawOrderToSetupIndex == null)\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\n else {\n for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\n }\n }\n}\n\nexport class DeformTimeline extends CurveTimeline {\n frames: ArrayLike; // time, ...\n frameVertices: Array>;\n slotIndex: number;\n attachment: VertexAttachment;\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount);\n this.frameVertices = new Array>(frameCount);\n }\n\n /** Sets the time of the specified keyframe. */\n setFrame (frameIndex: number, time: number, vertices: ArrayLike) {\n this.frames[frameIndex] = time;\n this.frameVertices[frameIndex] = vertices;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let slot: Slot = skeleton.slots[this.slotIndex];\n let slotAttachment: Attachment = slot.getAttachment();\n if (!(slotAttachment instanceof VertexAttachment) || !(slotAttachment).applyDeform(this.attachment)) return;\n\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frameVertices = this.frameVertices;\n let vertexCount = frameVertices[0].length;\n\n let verticesArray: Array = slot.attachmentVertices;\n if (verticesArray.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.\n let vertices: Array = Utils.setArraySize(verticesArray, vertexCount);\n\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\n let lastVertices = frameVertices[frames.length - 1];\n if (alpha < 1) {\n for (let i = 0; i < vertexCount; i++)\n vertices[i] += (lastVertices[i] - vertices[i]) * alpha;\n } else\n Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time);\n let prevVertices = frameVertices[frame - 1];\n let nextVertices = frameVertices[frame];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\n\n if (alpha < 1) {\n for (let i = 0; i < vertexCount; i++) {\n let prev = prevVertices[i];\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;\n }\n } else {\n for (let i = 0; i < vertexCount; i++) {\n let prev = prevVertices[i];\n vertices[i] = prev + (nextVertices[i] - prev) * percent;\n }\n }\n }\n}\n\nexport class IkConstraintTimeline extends CurveTimeline {\n static ENTRIES = 3;\n static PREV_TIME = -3; static PREV_MIX = -2; static PREV_BEND_DIRECTION = -1;\n static MIX = 1; static BEND_DIRECTION = 2;\n\n ikConstraintIndex: number;\n frames: ArrayLike; // time, mix, bendDirection, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\n }\n\n /** Sets the time, mix and bend direction of the specified keyframe. */\n setFrame (frameIndex: number, time: number, mix: number, bendDirection: number) {\n frameIndex *= IkConstraintTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: IkConstraint = skeleton.ikConstraints[this.ikConstraintIndex];\n\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\n constraint.bendDirection = Math.floor(frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]);\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\n let mix = frames[frame + IkConstraintTimeline.PREV_MIX];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\n\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\n constraint.bendDirection = Math.floor(frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]);\n }\n}\n\nexport class TransformConstraintTimeline extends CurveTimeline {\n static ENTRIES = 5;\n static PREV_TIME = -5; static PREV_ROTATE = -4; static PREV_TRANSLATE = -3; static PREV_SCALE = -2; static PREV_SHEAR = -1;\n static ROTATE = 1; static TRANSLATE = 2; static SCALE = 3; static SHEAR = 4;\n\n transformConstraintIndex: number;\n frames: ArrayLike; // time, rotate mix, translate mix, scale mix, shear mix, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\n }\n\n /** Sets the time and mixes of the specified keyframe. */\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number) {\n frameIndex *= TransformConstraintTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: TransformConstraint = skeleton.transformConstraints[this.transformConstraintIndex];\n\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.rotateMix += (frames[i + TransformConstraintTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\n constraint.translateMix += (frames[i + TransformConstraintTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\n constraint.scaleMix += (frames[i + TransformConstraintTimeline.PREV_SCALE] - constraint.scaleMix) * alpha;\n constraint.shearMix += (frames[i + TransformConstraintTimeline.PREV_SHEAR] - constraint.shearMix) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\n\n let rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\n let translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\n let scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\n let shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\n constraint.rotateMix += (rotate + (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\n constraint.translateMix += (translate + (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\n * alpha;\n constraint.scaleMix += (scale + (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent - constraint.scaleMix) * alpha;\n constraint.shearMix += (shear + (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent - constraint.shearMix) * alpha;\n }\n}\n\nexport class PathConstraintPositionTimeline extends CurveTimeline {\n static ENTRIES = 2;\n static PREV_TIME = -2; static PREV_VALUE = -1;\n static VALUE = 1;\n\n pathConstraintIndex: number;\n\n frames: ArrayLike; // time, position, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, value: number) {\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\n\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.position += (frames[i + PathConstraintPositionTimeline.PREV_VALUE] - constraint.position) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\n let position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\n\n constraint.position += (position + (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent - constraint.position) * alpha;\n }\n}\n\nexport class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {\n constructor (frameCount: number) {\n super(frameCount);\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\n\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.spacing += (frames[i + PathConstraintSpacingTimeline.PREV_VALUE] - constraint.spacing) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\n let spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\n\n constraint.spacing += (spacing + (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent - constraint.spacing) * alpha;\n }\n}\n\nexport class PathConstraintMixTimeline extends CurveTimeline {\n static ENTRIES = 3;\n static PREV_TIME = -3; static PREV_ROTATE = -2; static PREV_TRANSLATE = -1;\n static ROTATE = 1; static TRANSLATE = 2;\n\n pathConstraintIndex: number;\n\n frames: ArrayLike; // time, rotate mix, translate mix, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\n }\n\n /** Sets the time and mixes of the specified keyframe. */\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number) {\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\n\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.rotateMix += (frames[i + PathConstraintMixTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\n constraint.translateMix += (frames[i + PathConstraintMixTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\n let rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\n let translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\n\n constraint.rotateMix += (rotate + (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\n constraint.translateMix += (translate + (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\n * alpha;\n }\n}\n","import {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils, Utils} from \"./Utils\";\r\nimport {Animation} from \"./Animation\";\r\nimport {AnimationStateData} from \"./AnimationStateData\";\r\nimport {Event} from \"./Event\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class AnimationState {\r\n data: AnimationStateData;\r\n tracks = new Array();\r\n events = new Array();\r\n timeScale = 1;\r\n\r\n constructor (data: AnimationStateData = null) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n }\r\n\r\n update (delta: number) {\r\n delta *= this.timeScale;\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n let next = current.next;\r\n if (next != null) {\r\n let nextTime = current.lastTime - next.delay;\r\n if (nextTime >= 0) {\r\n let nextDelta = delta * next.timeScale;\r\n next.time = nextTime + nextDelta; // For start event to see correct time.\r\n current.time += delta * current.timeScale; // For end event to see correct time.\r\n this.setCurrent(i, next);\r\n next.time -= nextDelta; // Prevent increasing time twice, below.\r\n current = next;\r\n }\r\n } else if (!current.loop && current.lastTime >= current.endTime) {\r\n // End non-looping animation when it reaches its end time and there is no next entry.\r\n this.clearTrack(i);\r\n continue;\r\n }\r\n\r\n current.time += delta * current.timeScale;\r\n if (current.previous != null) {\r\n let previousDelta = delta * current.previous.timeScale;\r\n current.previous.time += previousDelta;\r\n current.mixTime += previousDelta;\r\n }\r\n }\r\n }\r\n\r\n apply (skeleton: Skeleton) {\r\n let events = this.events;\r\n\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n events.length = 0;\r\n\r\n let time = current.time;\r\n let lastTime = current.lastTime;\r\n let endTime = current.endTime;\r\n let loop = current.loop;\r\n if (!loop && time > endTime) time = endTime;\r\n\r\n let previous = current.previous;\r\n if (previous == null)\r\n current.animation.mix(skeleton, lastTime, time, loop, events, current.mix);\r\n else {\r\n let previousTime = previous.time;\r\n if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime;\r\n previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null);\r\n\r\n let alpha = current.mixTime / current.mixDuration * current.mix;\r\n if (alpha >= 1) {\r\n alpha = 1;\r\n current.previous = null;\r\n }\r\n current.animation.mix(skeleton, lastTime, time, loop, events, alpha);\r\n }\r\n\r\n for (let ii = 0, nn = events.length; ii < nn; ii++) {\r\n let event = events[ii];\r\n if (current.onEvent) current.onEvent(i, event);\r\n if (this.onEvent) this.onEvent(i, event);\r\n }\r\n\r\n // Check if completed the animation or a loop iteration.\r\n if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) {\r\n let count = MathUtils.toInt(time / endTime);\r\n if (current.onComplete) current.onComplete(i, count);\r\n if (this.onComplete) this.onComplete(i, count);\r\n }\r\n\r\n current.lastTime = current.time;\r\n }\r\n }\r\n\r\n clearTracks () {\r\n for (let i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n }\r\n\r\n clearTrack (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return;\r\n let current = this.tracks[trackIndex];\r\n if (current == null) return;\r\n\r\n if (current.onEnd) current.onEnd(trackIndex);\r\n if (this.onEnd) this.onEnd(trackIndex);\r\n\r\n this.tracks[trackIndex] = null;\r\n\r\n this.freeAll(current);\r\n }\r\n\r\n freeAll (entry: TrackEntry) {\r\n while (entry != null) {\r\n let next = entry.next;\r\n entry = next;\r\n }\r\n }\r\n\r\n expandToIndex (index: number) {\r\n if (index < this.tracks.length) return this.tracks[index];\r\n Utils.setArraySize(this.tracks, index - this.tracks.length + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n }\r\n\r\n setCurrent (index: number, entry: TrackEntry) {\r\n let current = this.expandToIndex(index);\r\n if (current != null) {\r\n let previous = current.previous;\r\n current.previous = null;\r\n\r\n if (entry.onEnd) entry.onEnd(index);\r\n if (this.onEnd) this.onEnd(index);\r\n\r\n entry.mixDuration = this.data.getMix(current.animation, entry.animation);\r\n if (entry.mixDuration > 0) {\r\n entry.mixTime = 0;\r\n // If a mix is in progress, mix from the closest animation.\r\n if (previous != null && current.mixTime / current.mixDuration < 0.5) {\r\n entry.previous = previous;\r\n previous = current;\r\n } else\r\n entry.previous = current;\r\n }\r\n }\r\n\r\n this.tracks[index] = entry;\r\n\r\n if (entry.onStart) entry.onStart(index);\r\n if (this.onStart) this.onStart(index);\r\n }\r\n\r\n /** @see #setAnimation(int, Animation, boolean) */\r\n setAnimation (trackIndex: number, animationName: string, loop: boolean) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n }\r\n\r\n /** Set the current animation. Any queued animations are cleared. */\r\n setAnimationWith (trackIndex: number, animation: Animation, loop: boolean) {\r\n let current = this.expandToIndex(trackIndex);\r\n if (current != null) this.freeAll(current.next);\r\n\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n this.setCurrent(trackIndex, entry);\r\n return entry;\r\n }\r\n\r\n /** {@link #addAnimation(int, Animation, boolean, float)} */\r\n addAnimation (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n }\r\n\r\n hasAnimation(animationName: string): boolean\r\n {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n\r\n /** Adds an animation to be played delay seconds after the current or last queued animation.\r\n * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */\r\n addAnimationWith (trackIndex: number, animation: Animation, loop: boolean, delay: number) {\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n\r\n let last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n last.next = entry;\r\n } else\r\n this.tracks[trackIndex] = entry;\r\n\r\n if (delay <= 0) {\r\n if (last != null)\r\n delay += last.endTime - this.data.getMix(last.animation, animation);\r\n else\r\n delay = 0;\r\n }\r\n entry.delay = delay;\r\n\r\n return entry;\r\n }\r\n\r\n /** @return May be null. */\r\n getCurrent (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return null;\r\n return this.tracks[trackIndex];\r\n }\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n private static deprecatedWarning1: boolean = false;\r\n setAnimationByName (trackIndex: number, animationName: string, loop: boolean) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n }\r\n\r\n private static deprecatedWarning2: boolean = false;\r\n addAnimationByName (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n }\r\n\r\n private static deprecatedWarning3: boolean = false;\r\n hasAnimationByName (animationName: string): boolean\r\n {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n}\r\n\r\nexport class TrackEntry {\r\n next: TrackEntry; previous: TrackEntry;\r\n animation: Animation;\r\n loop = false;\r\n delay = 0; time = 0; lastTime = -1; endTime = 0; timeScale = 1;\r\n mixTime = 0; mixDuration = 0;\r\n mix = 1;\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n reset () {\r\n this.next = null;\r\n this.previous = null;\r\n this.animation = null;\r\n this.timeScale = 1;\r\n this.lastTime = -1; // Trigger events on frame zero.\r\n this.time = 0;\r\n }\r\n\r\n /** Returns true if the current time is greater than the end time, regardless of looping. */\r\n isComplete () : boolean {\r\n return this.time >= this.endTime;\r\n }\r\n}\r\n","import {Animation} from \"./Animation\";\nimport {SkeletonData} from \"./SkeletonData\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class AnimationStateData {\n skeletonData: SkeletonData;\n animationToMixTime: Map = { };\n defaultMix = 0;\n\n constructor (skeletonData: SkeletonData) {\n if (skeletonData == null) throw new Error(\"skeletonData cannot be null.\");\n this.skeletonData = skeletonData;\n }\n\n setMix (fromName: string, toName: string, duration: number) {\n let from = this.skeletonData.findAnimation(fromName);\n if (from == null) throw new Error(\"Animation not found: \" + fromName);\n let to = this.skeletonData.findAnimation(toName);\n if (to == null) throw new Error(\"Animation not found: \" + toName);\n this.setMixWith(from, to, duration);\n }\n\n private static deprecatedWarning1: boolean = false;\n setMixByName(fromName: string, toName: string, duration: number) {\n if (!AnimationStateData.deprecatedWarning1) {\n AnimationStateData.deprecatedWarning1 = true;\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\n }\n this.setMix(fromName, toName, duration);\n }\n\n setMixWith (from: Animation, to: Animation, duration: number) {\n if (from == null) throw new Error(\"from cannot be null.\");\n if (to == null) throw new Error(\"to cannot be null.\");\n let key = from.name + to.name;\n this.animationToMixTime[key] = duration;\n }\n\n getMix (from: Animation, to: Animation) {\n let key = from.name + to.name;\n let value = this.animationToMixTime[key];\n return value === undefined ? this.defaultMix : value;\n }\n}\n","import {Skin} from \"./Skin\";\nimport {AttachmentLoader, BoundingBoxAttachment, MeshAttachment, PathAttachment, RegionAttachment} from \"./attachments\";\nimport {TextureAtlas} from \"./TextureAtlas\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class AtlasAttachmentLoader implements AttachmentLoader {\n atlas: TextureAtlas;\n\n constructor (atlas: TextureAtlas) {\n this.atlas = atlas;\n }\n\n /** @return May be null to not load an attachment. */\n newRegionAttachment (skin: Skin, name: string, path: string): RegionAttachment {\n let region = this.atlas.findRegion(path);\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\n let attachment = new RegionAttachment(name);\n attachment.region = region;\n return attachment;\n }\n\n /** @return May be null to not load an attachment. */\n newMeshAttachment (skin: Skin, name: string, path: string) : MeshAttachment {\n let region = this.atlas.findRegion(path);\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\n let attachment = new MeshAttachment(name);\n attachment.region = region;\n return attachment;\n }\n\n /** @return May be null to not load an attachment. */\n newBoundingBoxAttachment (skin: Skin, name: string) : BoundingBoxAttachment {\n return new BoundingBoxAttachment(name);\n }\n\n /** @return May be null to not load an attachment */\n newPathAttachment (skin: Skin, name: string): PathAttachment {\n return new PathAttachment(name);\n }\n}\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum BlendMode {\r\n Normal,\r\n Additive,\r\n Multiply,\r\n Screen\r\n}\r\n","import {Updatable} from \"./Updatable\";\nimport {BoneData, TransformMode} from \"./BoneData\";\nimport {Skeleton} from \"./Skeleton\";\nimport {MathUtils, Vector2} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Bone implements Updatable {\n static yDown: boolean = false;\n //be careful! Spine b,c is c,b in pixi matrix\n matrix = new PIXI.Matrix();\n\n get worldX(): number {\n return this.matrix.tx;\n }\n\n get worldY(): number {\n return this.matrix.ty;\n }\n\n data: BoneData;\n skeleton: Skeleton;\n parent: Bone;\n children = new Array();\n x = 0; y = 0; rotation = 0; scaleX = 0; scaleY = 0; shearX = 0; shearY = 0;\n ax = 0; ay = 0; arotation = 0; ascaleX = 0; ascaleY = 0; ashearX = 0; ashearY = 0;\n appliedValid = false;\n\n sorted = false;\n\n /** @param parent May be null. */\n constructor (data: BoneData, skeleton: Skeleton, parent: Bone) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.skeleton = skeleton;\n this.parent = parent;\n this.setToSetupPose();\n }\n\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\n update () {\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n }\n\n /** Computes the world transform using the parent bone and this bone's local transform. */\n updateWorldTransform () {\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n }\n\n /** Computes the world transform using the parent bone and the specified local transform. */\n updateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\n this.ax = x;\n this.ay = y;\n this.arotation = rotation;\n this.ascaleX = scaleX;\n this.ascaleY = scaleY;\n this.ashearX = shearX;\n this.ashearY = shearY;\n this.appliedValid = true;\n\n let parent = this.parent;\n let m = this.matrix;\n if (parent == null) { // Root bone.\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n let skeleton = this.skeleton;\n if (skeleton.flipX) {\n x = -x;\n la = -la;\n lb = -lb;\n }\n if (skeleton.flipY !== Bone.yDown) {\n y = -y;\n lc = -lc;\n ld = -ld;\n }\n m.a = la;\n m.c = lb;\n m.b = lc;\n m.d = ld;\n m.tx = x + skeleton.x;\n m.ty = y + skeleton.y;\n return;\n }\n\n let pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\n m.tx = pa * x + pb * y + parent.matrix.tx;\n m.ty = pc * x + pd * y + parent.matrix.ty;\n switch (this.data.transformMode) {\n case TransformMode.Normal: {\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n m.a = pa * la + pb * lc;\n m.c = pa * lb + pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n return;\n }\n case TransformMode.OnlyTranslation: {\n let rotationY = rotation + 90 + shearY;\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\n break;\n }\n case TransformMode.NoRotationOrReflection: {\n let s = pa * pa + pc * pc;\n let prx = 0;\n if (s > 0.0001) {\n s = Math.abs(pa * pd - pb * pc) / s;\n pb = pc * s;\n pd = pa * s;\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\n } else {\n pa = 0;\n pc = 0;\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\n }\n let rx = rotation + shearX - prx;\n let ry = rotation + shearY - prx + 90;\n let la = MathUtils.cosDeg(rx) * scaleX;\n let lb = MathUtils.cosDeg(ry) * scaleY;\n let lc = MathUtils.sinDeg(rx) * scaleX;\n let ld = MathUtils.sinDeg(ry) * scaleY;\n m.a = pa * la - pb * lc;\n m.c = pa * lb - pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n break;\n }\n case TransformMode.NoScale:\n case TransformMode.NoScaleOrReflection: {\n let cos = MathUtils.cosDeg(rotation);\n let sin = MathUtils.sinDeg(rotation);\n let za = pa * cos + pb * sin;\n let zc = pc * cos + pd * sin;\n let s = Math.sqrt(za * za + zc * zc);\n if (s > 0.00001) s = 1 / s;\n za *= s;\n zc *= s;\n s = Math.sqrt(za * za + zc * zc);\n let r = Math.PI / 2 + Math.atan2(zc, za);\n let zb = Math.cos(r) * s;\n let zd = Math.sin(r) * s;\n let la = MathUtils.cosDeg(shearX) * scaleX;\n let lb = MathUtils.cosDeg(90 + shearY) * scaleY;\n let lc = MathUtils.sinDeg(shearX) * scaleX;\n let ld = MathUtils.sinDeg(90 + shearY) * scaleY;\n m.a = za * la + zb * lc;\n m.c = za * lb + zb * ld;\n m.b = zc * la + zd * lc;\n m.d = zc * lb + zd * ld;\n if (this.data.transformMode != TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : (this.skeleton.flipX != this.skeleton.flipY) != Bone.yDown) {\n m.b = -m.b;\n m.d = -m.d;\n }\n return;\n }\n //old < 3.5 stuff\n case TransformMode.InheritRotation: {\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n\n pa = 1;\n pb = 0;\n pc = 0;\n pd = 1;\n do {\n let cos = MathUtils.cosDeg(parent.arotation), sin = MathUtils.sinDeg(parent.arotation);\n let temp = pa * cos + pb * sin;\n pb = pb * cos - pa * sin;\n pa = temp;\n temp = pc * cos + pd * sin;\n pd = pd * cos - pc * sin;\n pc = temp;\n\n if (parent.data.transformMode === TransformMode.InheritScale ||\n parent.data.transformMode === TransformMode.OnlyTranslation) break;\n parent = parent.parent;\n } while (parent != null);\n m.a = pa * la + pb * lc;\n m.c = pa * lb + pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n break;\n }\n //old < 3.5 stuff\n case TransformMode.InheritScale: {\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n\n pa = 1;\n pb = 0;\n pc = 0;\n pd = 1;\n do {\n let cos = MathUtils.cosDeg(parent.arotation), sin = MathUtils.sinDeg(parent.arotation);\n let psx = parent.scaleX, psy = parent.scaleY;\n let za = cos * psx, zb = sin * psy, zc = sin * psx, zd = cos * psy;\n let temp = pa * za + pb * zc;\n pb = pb * zd - pa * zb;\n pa = temp;\n temp = pc * za + pd * zc;\n pd = pd * zd - pc * zb;\n pc = temp;\n\n if (psx >= 0) sin = -sin;\n temp = pa * cos + pb * sin;\n pb = pb * cos - pa * sin;\n pa = temp;\n temp = pc * cos + pd * sin;\n pd = pd * cos - pc * sin;\n pc = temp;\n\n if (parent.data.transformMode === TransformMode.InheritRotation ||\n parent.data.transformMode === TransformMode.OnlyTranslation) break;\n parent = parent.parent;\n } while (parent != null);\n m.a = pa * la + pb * lc;\n m.c = pa * lb + pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n break;\n }\n }\n if (this.skeleton.flipX) {\n m.a = -m.a;\n m.c = -m.c;\n }\n if (this.skeleton.flipY != Bone.yDown) {\n m.b = -m.b;\n m.d = -m.d;\n }\n }\n\n setToSetupPose () {\n let data = this.data;\n this.x = data.x;\n this.y = data.y;\n this.rotation = data.rotation;\n this.scaleX = data.scaleX;\n this.scaleY = data.scaleY;\n this.shearX = data.shearX;\n this.shearY = data.shearY;\n }\n\n getWorldRotationX () {\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\n }\n\n getWorldRotationY () {\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\n }\n\n getWorldScaleX () {\n let m = this.matrix;\n return Math.sqrt(m.a * m.a + m.c * m.c);\n }\n\n getWorldScaleY () {\n let m = this.matrix;\n return Math.sqrt(m.b * m.b + m.d * m.d);\n }\n\n worldToLocalRotationX () {\n let parent = this.parent;\n if (parent == null) return this.arotation;\n let pm = parent.matrix, m = this.matrix;\n return Math.atan2(pm.a * m.b - pm.b * m.a, pm.d * m.a - pm.c * m.b) * MathUtils.radDeg;\n }\n\n worldToLocalRotationY () {\n let parent = this.parent;\n if (parent == null) return this.arotation;\n let pm = parent.matrix, m = this.matrix;\n return Math.atan2(pm.a * m.d - pm.b * m.c, pm.d * m.c - pm.c * m.d) * MathUtils.radDeg;\n }\n\n rotateWorld (degrees: number) {\n let m = this.matrix;\n let a = this.matrix.a, b = m.c, c = m.b, d = m.d;\n let cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\n m.a = cos * a - sin * c;\n m.c = cos * b - sin * d;\n m.b = sin * a + cos * c;\n m.d = sin * b + cos * d;\n this.appliedValid = false;\n }\n\n /** Computes the individual applied transform values from the world transform. This can be useful to perform processing using\n * the applied transform after the world transform has been modified directly (eg, by a constraint).\n *

\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */\n updateAppliedTransform () {\n this.appliedValid = true;\n let parent = this.parent;\n let m = this.matrix;\n if (parent == null) {\n this.ax = m.tx;\n this.ay = m.ty;\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\n this.ashearX = 0;\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\n return;\n }\n let pm = parent.matrix;\n let pid = 1 / (pm.a * pm.d - pm.b * pm.c);\n let dx = m.tx - pm.tx, dy = m.ty - pm.ty;\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\n let ia = pid * pm.d;\n let id = pid * pm.a;\n let ib = pid * pm.c;\n let ic = pid * pm.b;\n let ra = ia * m.a - ib * m.b;\n let rb = ia * m.c - ib * m.d;\n let rc = id * m.b - ic * m.a;\n let rd = id * m.d - ic * m.c;\n this.ashearX = 0;\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\n if (this.ascaleX > 0.0001) {\n let det = ra * rd - rb * rc;\n this.ascaleY = det / this.ascaleX;\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\n } else {\n this.ascaleX = 0;\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\n this.ashearY = 0;\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\n }\n }\n\n worldToLocal (world: Vector2) {\n let m = this.matrix;\n let a = m.a, b = m.c, c = m.b, d = m.d;\n let invDet = 1 / (a * d - b * c);\n let x = world.x - m.tx, y = world.y - m.ty;\n world.x = (x * d * invDet - y * b * invDet);\n world.y = (y * a * invDet - x * c * invDet);\n return world;\n }\n\n localToWorld (local: Vector2) {\n let m = this.matrix;\n let x = local.x, y = local.y;\n local.x = x * m.a + y * m.c + m.tx;\n local.y = x * m.b + y * m.d + m.ty;\n return local;\n }\n}\n","/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class BoneData {\n index: number;\n name: string;\n parent: BoneData;\n length: number;\n x = 0; y = 0; rotation = 0; scaleX = 1; scaleY = 1; shearX = 0; shearY = 0;\n transformMode = TransformMode.Normal;\n\n constructor (index: number, name: string, parent: BoneData) {\n if (index < 0) throw new Error(\"index must be >= 0.\");\n if (name == null) throw new Error(\"name cannot be null.\");\n this.index = index;\n this.name = name;\n this.parent = parent;\n }\n}\n\nexport enum TransformMode {\n Normal, OnlyTranslation, NoRotationOrReflection, NoScale, NoScaleOrReflection, InheritRotation, InheritScale\n}\n","import {EventData} from \"./EventData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Event {\r\n data: EventData;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n time: number;\r\n\r\n constructor (time: number, data: EventData) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class EventData {\r\n name: string;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n","import {IkConstraintData} from \"./IkConstraintData\";\nimport {Bone} from \"./Bone\";\nimport {Skeleton} from \"./Skeleton\";\nimport {MathUtils} from \"./Utils\";\nimport {Constraint} from \"./Constraint\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class IkConstraint implements Constraint {\n data: IkConstraintData;\n bones: Array;\n target: Bone;\n mix = 1;\n bendDirection = 0;\n\n level = 0;\n\n constructor (data: IkConstraintData, skeleton: Skeleton) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.mix = data.mix;\n this.bendDirection = data.bendDirection;\n\n this.bones = new Array();\n for (let i = 0; i < data.bones.length; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findBone(data.target.name);\n }\n\n getOrder () {\n return this.data.order;\n }\n\n apply () {\n this.update();\n }\n\n update () {\n let target = this.target;\n let bones = this.bones;\n switch (bones.length) {\n case 1:\n this.apply1(bones[0], target.worldX, target.worldY, this.mix);\n break;\n case 2:\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix);\n break;\n }\n }\n\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\n * coordinate system. */\n apply1 (bone: Bone, targetX: number, targetY: number, alpha: number) {\n if (!bone.appliedValid) bone.updateAppliedTransform();\n let pp = bone.parent.matrix;\n let id = 1 / (pp.a * pp.d - pp.b * pp.c);\n let x = targetX - pp.tx, y = targetY - pp.ty;\n let tx = (x * pp.d - y * pp.c) * id - bone.ax, ty = (y * pp.a - x * pp.b) * id - bone.ay;\n let rotationIK = Math.atan2(ty, tx) * MathUtils.radDeg - bone.ashearX - bone.arotation;\n if (bone.ascaleX < 0) rotationIK += 180;\n if (rotationIK > 180)\n rotationIK -= 360;\n else if (rotationIK < -180) rotationIK += 360;\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, bone.ascaleX, bone.ascaleY, bone.ashearX,\n bone.ashearY);\n }\n\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\n * target is specified in the world coordinate system.\n * @param child A direct descendant of the parent bone. */\n apply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number) {\n if (alpha == 0) {\n child.updateWorldTransform();\n return;\n }\n if (!parent.appliedValid) parent.updateAppliedTransform();\n if (!child.appliedValid) child.updateAppliedTransform();\n let px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, csx = child.ascaleX;\n\n let os1 = 0, os2 = 0, s2 = 0;\n if (psx < 0) {\n psx = -psx;\n os1 = 180;\n s2 = -1;\n } else {\n os1 = 0;\n s2 = 1;\n }\n if (psy < 0) {\n psy = -psy;\n s2 = -s2;\n }\n if (csx < 0) {\n csx = -csx;\n os2 = 180;\n } else\n os2 = 0;\n let pm = parent.matrix;\n let cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pm.a, b = pm.c, c = pm.b, d = pm.d;\n let u = Math.abs(psx - psy) <= 0.0001;\n if (!u) {\n cy = 0;\n cwx = a * cx + pm.tx;\n cwy = c * cx + pm.ty;\n } else {\n cy = child.ay;\n cwx = a * cx + b * cy + pm.tx;\n cwy = c * cx + d * cy + pm.ty;\n }\n let pp = parent.parent;\n let ppm = parent.parent.matrix;\n a = ppm.a;\n b = ppm.c;\n c = ppm.b;\n d = ppm.d;\n let id = 1 / (a * d - b * c), x = targetX - ppm.tx, y = targetY - ppm.ty;\n let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n x = cwx - ppm.tx;\n y = cwy - ppm.ty;\n let dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\n outer:\n if (u) {\n l2 *= psx;\n let cos = (tx * tx + ty * ty - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n if (cos < -1)\n cos = -1;\n else if (cos > 1) cos = 1;\n a2 = Math.acos(cos) * bendDir;\n a = l1 + l2 * cos;\n b = l2 * Math.sin(a2);\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n } else {\n a = psx * l2;\n b = psy * l2;\n let aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = Math.atan2(ty, tx);\n c = bb * l1 * l1 + aa * dd - aa * bb;\n let c1 = -2 * bb * l1, c2 = bb - aa;\n d = c1 * c1 - 4 * c2 * c;\n if (d >= 0) {\n let q = Math.sqrt(d);\n if (c1 < 0) q = -q;\n q = -(c1 + q) / 2;\n let r0 = q / c2, r1 = c / q;\n let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n if (r * r <= dd) {\n y = Math.sqrt(dd - r * r) * bendDir;\n a1 = ta - Math.atan2(y, r);\n a2 = Math.atan2(y / psy, (r - l1) / psx);\n break outer;\n }\n }\n let minAngle = 0, minDist = Number.MAX_VALUE, minX = 0, minY = 0;\n let maxAngle = 0, maxDist = 0, maxX = 0, maxY = 0;\n x = l1 + a;\n d = x * x;\n if (d > maxDist) {\n maxAngle = 0;\n maxDist = d;\n maxX = x;\n }\n x = l1 - a;\n d = x * x;\n if (d < minDist) {\n minAngle = MathUtils.PI;\n minDist = d;\n minX = x;\n }\n let angle = Math.acos(-a * l1 / (aa - bb));\n x = a * Math.cos(angle) + l1;\n y = b * Math.sin(angle);\n d = x * x + y * y;\n if (d < minDist) {\n minAngle = angle;\n minDist = d;\n minX = x;\n minY = y;\n }\n if (d > maxDist) {\n maxAngle = angle;\n maxDist = d;\n maxX = x;\n maxY = y;\n }\n if (dd <= (minDist + maxDist) / 2) {\n a1 = ta - Math.atan2(minY * bendDir, minX);\n a2 = minAngle * bendDir;\n } else {\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\n a2 = maxAngle * bendDir;\n }\n }\n let os = Math.atan2(cy, cx) * s2;\n let rotation = parent.arotation;\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\n if (a1 > 180)\n a1 -= 360;\n else if (a1 < -180) a1 += 360;\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.ascaleX, parent.ascaleY, 0, 0);\n rotation = child.arotation;\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\n if (a2 > 180)\n a2 -= 360;\n else if (a2 < -180) a2 += 360;\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n }\n}\n","import {BoneData} from \"./BoneData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class IkConstraintData {\n name: string;\n order = 0;\n bones = new Array();\n target: BoneData;\n bendDirection = 1;\n mix = 1;\n\n constructor (name: string) {\n this.name = name;\n }\n}\n","import {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\nimport {Bone} from \"./Bone\";\nimport {Slot} from \"./Slot\";\nimport {Skeleton} from \"./Skeleton\";\nimport {PathAttachment} from \"./attachments\";\nimport {Utils, MathUtils} from \"./Utils\";\nimport {Constraint} from \"./Constraint\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class PathConstraint implements Constraint {\n static NONE = -1; static BEFORE = -2; static AFTER = -3;\n\n data: PathConstraintData;\n bones: Array;\n target: Slot;\n position = 0; spacing = 0; rotateMix = 0; translateMix = 0;\n\n spaces = new Array(); positions = new Array();\n world = new Array(); curves = new Array(); lengths = new Array();\n segments = new Array();\n\n constructor (data: PathConstraintData, skeleton: Skeleton) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.bones = new Array();\n for (let i = 0, n = data.bones.length; i < n; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findSlot(data.target.name);\n this.position = data.position;\n this.spacing = data.spacing;\n this.rotateMix = data.rotateMix;\n this.translateMix = data.translateMix;\n }\n\n apply () {\n this.update();\n }\n\n update () {\n let attachment = this.target.getAttachment();\n if (!(attachment instanceof PathAttachment)) return;\n\n let rotateMix = this.rotateMix, translateMix = this.translateMix;\n let translate = translateMix > 0, rotate = rotateMix > 0;\n if (!translate && !rotate) return;\n\n let data = this.data;\n let spacingMode = data.spacingMode;\n let lengthSpacing = spacingMode == SpacingMode.Length;\n let rotateMode = data.rotateMode;\n let tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\n let boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n let bones = this.bones;\n let spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = null;\n let spacing = this.spacing;\n if (scale || lengthSpacing) {\n if (scale) lengths = Utils.setArraySize(this.lengths, boneCount);\n for (let i = 0, n = spacesCount - 1; i < n;) {\n let bone = bones[i];\n let m = bone.matrix;\n let length = bone.data.length, x = length * m.a, y = length * m.b;\n length = Math.sqrt(x * x + y * y);\n if (scale) lengths[i] = length;\n spaces[++i] = lengthSpacing ? Math.max(0, length + spacing) : spacing;\n }\n } else {\n for (let i = 1; i < spacesCount; i++)\n spaces[i] = spacing;\n }\n\n let positions = this.computeWorldPositions(attachment, spacesCount, tangents,\n data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\n let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n let tip = rotateMode == RotateMode.Chain && offsetRotation == 0;\n for (let i = 0, p = 3; i < boneCount; i++, p += 3) {\n let bone = bones[i];\n let m = bone.matrix;\n m.tx += (boneX - m.tx) * translateMix;\n m.ty += (boneY - m.ty) * translateMix;\n let x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\n if (scale) {\n let length = lengths[i];\n if (length != 0) {\n let s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * rotateMix + 1;\n m.a *= s;\n m.b *= s;\n }\n }\n boneX = x;\n boneY = y;\n if (rotate) {\n let a = m.a, b = m.c, c = m.b, d = m.d, r = 0, cos = 0, sin = 0;\n if (tangents)\n r = positions[p - 1];\n else if (spaces[i + 1] == 0)\n r = positions[p + 2];\n else\n r = Math.atan2(dy, dx);\n r -= Math.atan2(c, a) - offsetRotation * MathUtils.degRad;\n if (tip) {\n cos = Math.cos(r);\n sin = Math.sin(r);\n let length = bone.data.length;\n boneX += (length * (cos * a - sin * c) - dx) * rotateMix;\n boneY += (length * (sin * a + cos * c) - dy) * rotateMix;\n }\n if (r > MathUtils.PI)\n r -= MathUtils.PI2;\n else if (r < -MathUtils.PI) //\n r += MathUtils.PI2;\n r *= rotateMix;\n cos = Math.cos(r);\n sin = Math.sin(r);\n m.a = cos * a - sin * c;\n m.c = cos * b - sin * d;\n m.b = sin * a + cos * c;\n m.d = sin * b + cos * d;\n }\n bone.appliedValid = false;\n }\n }\n\n computeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean,\n percentSpacing: boolean) {\n let target = this.target;\n let position = this.position;\n let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = null;\n let closed = path.closed;\n let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n\n if (!path.constantSpeed) {\n let lengths = path.lengths;\n curveCount -= closed ? 1 : 2;\n let pathLength = lengths[curveCount];\n if (percentPosition) position *= pathLength;\n if (percentSpacing) {\n for (let i = 0; i < spacesCount; i++)\n spaces[i] *= pathLength;\n }\n world = Utils.setArraySize(this.world, 8);\n for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n let space = spaces[i];\n position += space;\n let p = position;\n\n if (closed) {\n p %= pathLength;\n if (p < 0) p += pathLength;\n curve = 0;\n } else if (p < 0) {\n if (prevCurve != PathConstraint.BEFORE) {\n prevCurve = PathConstraint.BEFORE;\n path.computeWorldVerticesWith(target, 2, 4, world, 0);\n }\n this.addBeforePosition(p, world, 0, out, o);\n continue;\n } else if (p > pathLength) {\n if (prevCurve != PathConstraint.AFTER) {\n prevCurve = PathConstraint.AFTER;\n path.computeWorldVerticesWith(target, verticesLength - 6, 4, world, 0);\n }\n this.addAfterPosition(p - pathLength, world, 0, out, o);\n continue;\n }\n\n // Determine curve containing position.\n for (;; curve++) {\n let length = lengths[curve];\n if (p > length) continue;\n if (curve == 0)\n p /= length;\n else {\n let prev = lengths[curve - 1];\n p = (p - prev) / (length - prev);\n }\n break;\n }\n if (curve != prevCurve) {\n prevCurve = curve;\n if (closed && curve == curveCount) {\n path.computeWorldVerticesWith(target, verticesLength - 4, 4, world, 0);\n path.computeWorldVerticesWith(target, 0, 4, world, 4);\n } else\n path.computeWorldVerticesWith(target, curve * 6 + 2, 8, world, 0);\n }\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\n tangents || (i > 0 && space == 0));\n }\n return out;\n }\n\n // World vertices.\n if (closed) {\n verticesLength += 2;\n world = Utils.setArraySize(this.world, verticesLength);\n path.computeWorldVerticesWith(target, 2, verticesLength - 4, world, 0);\n path.computeWorldVerticesWith(target, 0, 2, world, verticesLength - 4);\n world[verticesLength - 2] = world[0];\n world[verticesLength - 1] = world[1];\n } else {\n curveCount--;\n verticesLength -= 4;\n world = Utils.setArraySize(this.world, verticesLength);\n path.computeWorldVerticesWith(target, 2, verticesLength, world, 0);\n }\n\n // Curve lengths.\n let curves = Utils.setArraySize(this.curves, curveCount);\n let pathLength = 0;\n let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n for (let i = 0, w = 2; i < curveCount; i++, w += 6) {\n cx1 = world[w];\n cy1 = world[w + 1];\n cx2 = world[w + 2];\n cy2 = world[w + 3];\n x2 = world[w + 4];\n y2 = world[w + 5];\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n ddfx = tmpx * 2 + dddfx;\n ddfy = tmpy * 2 + dddfy;\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx;\n dfy += ddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx + dddfx;\n dfy += ddfy + dddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n curves[i] = pathLength;\n x1 = x2;\n y1 = y2;\n }\n if (percentPosition) position *= pathLength;\n if (percentSpacing) {\n for (let i = 0; i < spacesCount; i++)\n spaces[i] *= pathLength;\n }\n\n let segments = this.segments;\n let curveLength = 0;\n for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n let space = spaces[i];\n position += space;\n let p = position;\n\n if (closed) {\n p %= pathLength;\n if (p < 0) p += pathLength;\n curve = 0;\n } else if (p < 0) {\n this.addBeforePosition(p, world, 0, out, o);\n continue;\n } else if (p > pathLength) {\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n continue;\n }\n\n // Determine curve containing position.\n for (;; curve++) {\n let length = curves[curve];\n if (p > length) continue;\n if (curve == 0)\n p /= length;\n else {\n let prev = curves[curve - 1];\n p = (p - prev) / (length - prev);\n }\n break;\n }\n\n // Curve segment lengths.\n if (curve != prevCurve) {\n prevCurve = curve;\n let ii = curve * 6;\n x1 = world[ii];\n y1 = world[ii + 1];\n cx1 = world[ii + 2];\n cy1 = world[ii + 3];\n cx2 = world[ii + 4];\n cy2 = world[ii + 5];\n x2 = world[ii + 6];\n y2 = world[ii + 7];\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n ddfx = tmpx * 2 + dddfx;\n ddfy = tmpy * 2 + dddfy;\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n segments[0] = curveLength;\n for (ii = 1; ii < 8; ii++) {\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[ii] = curveLength;\n }\n dfx += ddfx;\n dfy += ddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[8] = curveLength;\n dfx += ddfx + dddfx;\n dfy += ddfy + dddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[9] = curveLength;\n segment = 0;\n }\n\n // Weight by segment length.\n p *= curveLength;\n for (;; segment++) {\n let length = segments[segment];\n if (p > length) continue;\n if (segment == 0)\n p /= length;\n else {\n let prev = segments[segment - 1];\n p = segment + (p - prev) / (length - prev);\n }\n break;\n }\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\n }\n return out;\n }\n\n addBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\n let x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n out[o] = x1 + p * Math.cos(r);\n out[o + 1] = y1 + p * Math.sin(r);\n out[o + 2] = r;\n }\n\n addAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\n let x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n out[o] = x1 + p * Math.cos(r);\n out[o + 1] = y1 + p * Math.sin(r);\n out[o + 2] = r;\n }\n\n addCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\n out: Array, o: number, tangents: boolean) {\n if (p == 0 || isNaN(p)) p = 0.0001;\n let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n out[o] = x;\n out[o + 1] = y;\n if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n }\n\n getOrder () {\n return this.data.order;\n }\n}\n","import {BoneData} from \"./BoneData\";\nimport {SlotData} from \"./SlotData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class PathConstraintData {\n name: string;\n order = 0;\n bones = new Array();\n target: SlotData;\n positionMode: PositionMode;\n spacingMode: SpacingMode;\n rotateMode: RotateMode;\n offsetRotation: number;\n position: number; spacing: number; rotateMix: number; translateMix: number;\n\n constructor (name: string) {\n this.name = name;\n }\n}\n\nexport enum PositionMode {\n Fixed, Percent\n}\n\nexport enum SpacingMode {\n Length, Fixed, Percent\n}\n\nexport enum RotateMode {\n Tangent, Chain, ChainScale\n}\n","import {Slot} from \"./Slot\";\nimport {Bone} from \"./Bone\";\nimport {IkConstraint} from \"./IkConstraint\";\nimport {TransformConstraint} from \"./TransformConstraint\";\nimport {PathConstraint} from \"./PathConstraint\";\nimport {Color, Utils, Vector2} from \"./Utils\";\nimport {Skin} from \"./Skin\";\nimport {SkeletonData} from \"./SkeletonData\";\nimport {Updatable} from \"./Updatable\";\nimport {Attachment, PathAttachment, RegionAttachment, MeshAttachment} from \"./attachments\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Skeleton {\n data: SkeletonData;\n bones: Array;\n slots: Array;\n drawOrder: Array;\n ikConstraints: Array;\n transformConstraints: Array;\n pathConstraints: Array;\n _updateCache = new Array();\n updateCacheReset = new Array();\n skin: Skin;\n color: Color;\n time = 0;\n flipX = false; flipY = false;\n x = 0; y = 0;\n\n constructor (data: SkeletonData) {\n if (data == null) throw new Error(\"data cannot be null.\");\n this.data = data;\n\n this.bones = new Array();\n for (let i = 0; i < data.bones.length; i++) {\n let boneData = data.bones[i];\n let bone: Bone;\n if (boneData.parent == null)\n bone = new Bone(boneData, this, null);\n else {\n let parent = this.bones[boneData.parent.index];\n bone = new Bone(boneData, this, parent);\n parent.children.push(bone);\n }\n this.bones.push(bone);\n }\n\n this.slots = new Array();\n this.drawOrder = new Array();\n for (let i = 0; i < data.slots.length; i++) {\n let slotData = data.slots[i];\n let bone = this.bones[slotData.boneData.index];\n let slot = new Slot(slotData, bone);\n this.slots.push(slot);\n this.drawOrder.push(slot);\n }\n\n this.ikConstraints = new Array();\n for (let i = 0; i < data.ikConstraints.length; i++) {\n let ikConstraintData = data.ikConstraints[i];\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\n }\n\n this.transformConstraints = new Array();\n for (let i = 0; i < data.transformConstraints.length; i++) {\n let transformConstraintData = data.transformConstraints[i];\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\n }\n\n this.pathConstraints = new Array();\n for (let i = 0; i < data.pathConstraints.length; i++) {\n let pathConstraintData = data.pathConstraints[i];\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\n }\n\n this.color = new Color(1, 1, 1, 1);\n this.updateCache();\n }\n\n updateCache () {\n let updateCache = this._updateCache;\n updateCache.length = 0;\n\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n bones[i].sorted = false;\n\n let ikConstraints = this.ikConstraints;\n let transformConstraints = this.transformConstraints;\n let pathConstraints = this.pathConstraints;\n let ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\n let constraintCount = ikCount + transformCount + pathCount;\n\n outer:\n for (let i = 0; i < constraintCount; i++) {\n for (let ii = 0; ii < ikCount; ii++) {\n let constraint = ikConstraints[ii];\n if (constraint.data.order == i) {\n this.sortIkConstraint(constraint);\n continue outer;\n }\n }\n for (let ii = 0; ii < transformCount; ii++) {\n let constraint = transformConstraints[ii];\n if (constraint.data.order == i) {\n this.sortTransformConstraint(constraint);\n continue outer;\n }\n }\n for (let ii = 0; ii < pathCount; ii++) {\n let constraint = pathConstraints[ii];\n if (constraint.data.order == i) {\n this.sortPathConstraint(constraint);\n continue outer;\n }\n }\n }\n\n for (let i = 0, n = bones.length; i < n; i++)\n this.sortBone(bones[i]);\n }\n\n sortIkConstraint (constraint: IkConstraint) {\n let target = constraint.target;\n this.sortBone(target);\n\n let constrained = constraint.bones;\n let parent = constrained[0];\n this.sortBone(parent);\n\n if (constrained.length > 1) {\n let child = constrained[constrained.length - 1];\n if (!(this._updateCache.indexOf(child) > -1)) this.updateCacheReset.push(child);\n }\n\n this._updateCache.push(constraint);\n\n this.sortReset(parent.children);\n constrained[constrained.length - 1].sorted = true;\n }\n\n sortPathConstraint (constraint: PathConstraint) {\n let slot = constraint.target;\n let slotIndex = slot.data.index;\n let slotBone = slot.bone;\n if (this.skin != null) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\n for (let ii = 0, nn = this.data.skins.length; ii < nn; ii++)\n this.sortPathConstraintAttachment(this.data.skins[ii], slotIndex, slotBone);\n\n let attachment = slot.getAttachment();\n if (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\n\n let constrained = constraint.bones;\n let boneCount = constrained.length;\n for (let ii = 0; ii < boneCount; ii++)\n this.sortBone(constrained[ii]);\n\n this._updateCache.push(constraint);\n\n for (let ii = 0; ii < boneCount; ii++)\n this.sortReset(constrained[ii].children);\n for (let ii = 0; ii < boneCount; ii++)\n constrained[ii].sorted = true;\n }\n\n sortTransformConstraint (constraint: TransformConstraint) {\n this.sortBone(constraint.target);\n\n let constrained = constraint.bones;\n let boneCount = constrained.length;\n for (let ii = 0; ii < boneCount; ii++)\n this.sortBone(constrained[ii]);\n\n this._updateCache.push(constraint);\n\n for (let ii = 0; ii < boneCount; ii++)\n this.sortReset(constrained[ii].children);\n for (let ii = 0; ii < boneCount; ii++)\n constrained[ii].sorted = true;\n }\n\n sortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\n let attachments = skin.attachments[slotIndex];\n if (!attachments) return;\n for (let key in attachments) {\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\n }\n }\n\n sortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\n if (!(attachment instanceof PathAttachment)) return;\n let pathBones = (attachment).bones;\n if (pathBones == null)\n this.sortBone(slotBone);\n else {\n let bones = this.bones;\n let i = 0;\n while (i < pathBones.length) {\n let boneCount = pathBones[i++];\n for (let n = i + boneCount; i < n; i++) {\n let boneIndex = pathBones[i];\n this.sortBone(bones[boneIndex]);\n }\n }\n }\n }\n\n sortBone (bone: Bone) {\n if (bone.sorted) return;\n let parent = bone.parent;\n if (parent != null) this.sortBone(parent);\n bone.sorted = true;\n this._updateCache.push(bone);\n }\n\n sortReset (bones: Array) {\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n if (bone.sorted) this.sortReset(bone.children);\n bone.sorted = false;\n }\n }\n\n /** Updates the world transform for each bone and applies constraints. */\n updateWorldTransform () {\n let updateCacheReset = this.updateCacheReset;\n for (let i = 0, n = updateCacheReset.length; i < n; i++) {\n let bone = updateCacheReset[i] as Bone;\n bone.ax = bone.x;\n bone.ay = bone.y;\n bone.arotation = bone.rotation;\n bone.ascaleX = bone.scaleX;\n bone.ascaleY = bone.scaleY;\n bone.ashearX = bone.shearX;\n bone.ashearY = bone.shearY;\n bone.appliedValid = true;\n }\n let updateCache = this._updateCache;\n for (let i = 0, n = updateCache.length; i < n; i++)\n updateCache[i].update();\n }\n\n /** Sets the bones, constraints, and slots to their setup pose values. */\n setToSetupPose () {\n this.setBonesToSetupPose();\n this.setSlotsToSetupPose();\n }\n\n /** Sets the bones and constraints to their setup pose values. */\n setBonesToSetupPose () {\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n bones[i].setToSetupPose();\n\n let ikConstraints = this.ikConstraints;\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\n let constraint = ikConstraints[i];\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.mix = constraint.data.mix;\n }\n\n let transformConstraints = this.transformConstraints;\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\n let constraint = transformConstraints[i];\n let data = constraint.data;\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n constraint.scaleMix = data.scaleMix;\n constraint.shearMix = data.shearMix;\n }\n\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\n let constraint = pathConstraints[i];\n let data = constraint.data;\n constraint.position = data.position;\n constraint.spacing = data.spacing;\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n }\n }\n\n setSlotsToSetupPose () {\n let slots = this.slots;\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n for (let i = 0, n = slots.length; i < n; i++)\n slots[i].setToSetupPose();\n }\n\n /** @return May return null. */\n getRootBone () {\n if (this.bones.length == 0) return null;\n return this.bones[0];\n }\n\n /** @return May be null. */\n findBone (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n if (bone.data.name == boneName) return bone;\n }\n return null;\n }\n\n /** @return -1 if the bone was not found. */\n findBoneIndex (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n if (bones[i].data.name == boneName) return i;\n return -1;\n }\n\n /** @return May be null. */\n findSlot (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n if (slot.data.name == slotName) return slot;\n }\n return null;\n }\n\n /** @return -1 if the bone was not found. */\n findSlotIndex (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++)\n if (slots[i].data.name == slotName) return i;\n return -1;\n }\n\n /** Sets a skin by name.\n * @see #setSkin(Skin) */\n setSkinByName (skinName: string) {\n let skin = this.data.findSkin(skinName);\n if (skin == null) throw new Error(\"Skin not found: \" + skinName);\n this.setSkin(skin);\n }\n\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\n * old skin, each slot's setup mode attachment is attached from the new skin.\n * @param newSkin May be null. */\n setSkin (newSkin: Skin) {\n if (newSkin != null) {\n if (this.skin != null)\n newSkin.attachAll(this, this.skin);\n else {\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n let name = slot.data.attachmentName;\n if (name != null) {\n let attachment: Attachment = newSkin.getAttachment(i, name);\n if (attachment != null) slot.setAttachment(attachment);\n }\n }\n }\n }\n this.skin = newSkin;\n }\n\n /** @return May be null. */\n getAttachmentByName (slotName: string, attachmentName: string): Attachment {\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\n }\n\n /** @return May be null. */\n getAttachment (slotIndex: number, attachmentName: string): Attachment {\n if (attachmentName == null) throw new Error(\"attachmentName cannot be null.\");\n if (this.skin != null) {\n let attachment: Attachment = this.skin.getAttachment(slotIndex, attachmentName);\n if (attachment != null) return attachment;\n }\n if (this.data.defaultSkin != null) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n return null;\n }\n\n /** @param attachmentName May be null. */\n setAttachment (slotName: string, attachmentName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n if (slot.data.name == slotName) {\n let attachment: Attachment = null;\n if (attachmentName != null) {\n attachment = this.getAttachment(i, attachmentName);\n if (attachment == null)\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\n }\n slot.setAttachment(attachment);\n return;\n }\n }\n throw new Error(\"Slot not found: \" + slotName);\n }\n\n /** @return May be null. */\n findIkConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let ikConstraints = this.ikConstraints;\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\n let ikConstraint = ikConstraints[i];\n if (ikConstraint.data.name == constraintName) return ikConstraint;\n }\n return null;\n }\n\n /** @return May be null. */\n findTransformConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let transformConstraints = this.transformConstraints;\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\n let constraint = transformConstraints[i];\n if (constraint.data.name == constraintName) return constraint;\n }\n return null;\n }\n\n /** @return May be null. */\n findPathConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\n let constraint = pathConstraints[i];\n if (constraint.data.name == constraintName) return constraint;\n }\n return null;\n }\n\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\n * @param size The width and height of the AABB. */\n getBounds (offset: Vector2, size: Vector2) {\n if (offset == null) throw new Error(\"offset cannot be null.\");\n if (size == null) throw new Error(\"size cannot be null.\");\n let drawOrder = this.drawOrder;\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n for (let i = 0, n = drawOrder.length; i < n; i++) {\n let slot = drawOrder[i];\n let vertices: ArrayLike = null;\n let attachment = slot.getAttachment();\n if (attachment instanceof RegionAttachment)\n vertices = (attachment).updateWorldVertices(slot, false);\n else if (attachment instanceof MeshAttachment) //\n vertices = (attachment).updateWorldVertices(slot, true);\n if (vertices != null) {\n for (let ii = 0, nn = vertices.length; ii < nn; ii += 8) {\n let x = vertices[ii], y = vertices[ii + 1];\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x);\n maxY = Math.max(maxY, y);\n }\n }\n }\n offset.set(minX, minY);\n size.set(maxX - minX, maxY - minY);\n }\n\n update (delta: number) {\n this.time += delta;\n }\n}\n","import {Utils, Pool} from \"./Utils\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {BoundingBoxAttachment} from \"./attachments\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonBounds {\r\n minX = 0; minY = 0; maxX = 0; maxY = 0;\r\n boundingBoxes = new Array();\r\n polygons = new Array>();\r\n private polygonPool = new Pool>(() => {\r\n return Utils.newFloatArray(16);\r\n });\r\n\r\n update (skeleton: Skeleton, updateAabb: boolean) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n let boundingBoxes = this.boundingBoxes;\r\n let polygons = this.polygons;\r\n let polygonPool = this.polygonPool;\r\n let slots = skeleton.slots;\r\n let slotCount = slots.length;\r\n\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n\r\n for (let i = 0; i < slotCount; i++) {\r\n let slot = slots[i];\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof BoundingBoxAttachment) {\r\n let boundingBox = attachment as BoundingBoxAttachment;\r\n boundingBoxes.push(boundingBox);\r\n\r\n let polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, polygon);\r\n }\r\n }\r\n\r\n if (updateAabb) this.aabbCompute();\r\n }\r\n\r\n aabbCompute () {\r\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++) {\r\n let polygon = polygons[i];\r\n let vertices = polygon;\r\n for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n let x = vertices[ii];\r\n let y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box contains the point. */\r\n aabbContainsPoint (x: number, y: number) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the line segment. */\r\n aabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let minX = this.minX;\r\n let minY = this.minY;\r\n let maxX = this.maxX;\r\n let maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n let m = (y2 - y1) / (x2 - x1);\r\n let y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n let x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n return false;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\r\n aabbIntersectsSkeleton (bounds: SkeletonBounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\r\n * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\r\n containsPoint (x: number, y: number): BoundingBoxAttachment {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains the point. */\r\n containsPointPolygon (polygon: ArrayLike, x: number, y: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let prevIndex = nn - 2;\r\n let inside = false;\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let vertexY = vertices[ii + 1];\r\n let prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n let vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\r\n * is usually more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns\r\n * true. */\r\n intersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains any part of the line segment. */\r\n intersectsSegmentPolygon (polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let width12 = x1 - x2, height12 = y1 - y2;\r\n let det1 = x1 * y2 - y1 * x2;\r\n let x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let x4 = vertices[ii], y4 = vertices[ii + 1];\r\n let det2 = x3 * y4 - y3 * x4;\r\n let width34 = x3 - x4, height34 = y3 - y4;\r\n let det3 = width12 * height34 - height12 * width34;\r\n let x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n let y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n }\r\n\r\n /** Returns the polygon for the specified bounding box, or null. */\r\n getPolygon (boundingBox: BoundingBoxAttachment) {\r\n if (boundingBox == null) throw new Error(\"boundingBox cannot be null.\");\r\n let index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n }\r\n\r\n getWidth () {\r\n return this.maxX - this.minX;\r\n }\r\n\r\n getHeight () {\r\n return this.maxY - this.minY;\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\nimport {SlotData} from \"./SlotData\";\nimport {Skin} from \"./Skin\";\nimport {EventData} from \"./EventData\";\nimport {Animation} from \"./Animation\";\nimport {IkConstraintData} from \"./IkConstraintData\";\nimport {TransformConstraintData} from \"./TransformConstraintData\";\nimport {PathConstraintData} from \"./PathConstraintData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class SkeletonData {\n name: string;\n bones = new Array(); // Ordered parents first.\n slots = new Array(); // Setup pose draw order.\n skins = new Array();\n defaultSkin: Skin;\n events = new Array();\n animations = new Array();\n ikConstraints = new Array();\n transformConstraints = new Array();\n pathConstraints = new Array();\n width: number; height: number;\n version: string; hash: string;\n\n // Nonessential\n fps = 0;\n imagesPath: string;\n\n findBone (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n if (bone.name == boneName) return bone;\n }\n return null;\n }\n\n findBoneIndex (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n if (bones[i].name == boneName) return i;\n return -1;\n }\n\n findSlot (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n if (slot.name == slotName) return slot;\n }\n return null;\n }\n\n findSlotIndex (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++)\n if (slots[i].name == slotName) return i;\n return -1;\n }\n\n findSkin (skinName: string) {\n if (skinName == null) throw new Error(\"skinName cannot be null.\");\n let skins = this.skins;\n for (let i = 0, n = skins.length; i < n; i++) {\n let skin = skins[i];\n if (skin.name == skinName) return skin;\n }\n return null;\n }\n\n findEvent (eventDataName: string) {\n if (eventDataName == null) throw new Error(\"eventDataName cannot be null.\");\n let events = this.events;\n for (let i = 0, n = events.length; i < n; i++) {\n let event = events[i];\n if (event.name == eventDataName) return event;\n }\n return null;\n }\n\n findAnimation (animationName: string) {\n if (animationName == null) throw new Error(\"animationName cannot be null.\");\n let animations = this.animations;\n for (let i = 0, n = animations.length; i < n; i++) {\n let animation = animations[i];\n if (animation.name == animationName) return animation;\n }\n return null;\n }\n\n findIkConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let ikConstraints = this.ikConstraints;\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\n let constraint = ikConstraints[i];\n if (constraint.name == constraintName) return constraint;\n }\n return null;\n }\n\n findTransformConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let transformConstraints = this.transformConstraints;\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\n let constraint = transformConstraints[i];\n if (constraint.name == constraintName) return constraint;\n }\n return null;\n }\n\n findPathConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\n let constraint = pathConstraints[i];\n if (constraint.name == constraintName) return constraint;\n }\n return null;\n }\n\n findPathConstraintIndex (pathConstraintName: string) {\n if (pathConstraintName == null) throw new Error(\"pathConstraintName cannot be null.\");\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++)\n if (pathConstraints[i].name == pathConstraintName) return i;\n return -1;\n }\n}\n","import {SkeletonData} from \"./SkeletonData\";\nimport {BoneData, TransformMode} from \"./BoneData\";\nimport {SlotData} from \"./SlotData\";\nimport {Event} from \"./Event\";\nimport {IkConstraintData} from \"./IkConstraintData\";\nimport {TransformConstraintData} from \"./TransformConstraintData\";\nimport {PathConstraintData, PositionMode, SpacingMode, RotateMode} from \"./PathConstraintData\";\nimport {Skin} from \"./Skin\";\nimport {EventData} from \"./EventData\";\nimport {Attachment, AttachmentLoader, MeshAttachment, VertexAttachment} from \"./attachments\";\nimport {Utils, Color, ArrayLike} from \"./Utils\";\nimport {\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\n Animation, CurveTimeline\n} from \"./Animation\";\nimport {BlendMode} from \"./BlendMode\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class SkeletonJson {\n attachmentLoader: AttachmentLoader;\n scale = 1;\n private linkedMeshes = new Array();\n\n constructor (attachmentLoader: AttachmentLoader) {\n this.attachmentLoader = attachmentLoader;\n }\n\n readSkeletonData (json: string | any ): SkeletonData {\n let scale = this.scale;\n let skeletonData = new SkeletonData();\n let root = typeof(json) === \"string\" ? JSON.parse(json) : json;\n\n // Skeleton\n let skeletonMap = root.skeleton;\n if (skeletonMap != null) {\n skeletonData.hash = skeletonMap.hash;\n skeletonData.version = skeletonMap.spine;\n skeletonData.width = skeletonMap.width;\n skeletonData.height = skeletonMap.height;\n skeletonData.fps = skeletonMap.fps;\n skeletonData.imagesPath = skeletonMap.images;\n }\n\n // Bones\n if (root.bones) {\n for (let i = 0; i < root.bones.length; i++) {\n let boneMap = root.bones[i];\n\n let parent: BoneData = null;\n let parentName: string = this.getValue(boneMap, \"parent\", null);\n if (parentName != null) {\n parent = skeletonData.findBone(parentName);\n if (parent == null) throw new Error(\"Parent bone not found: \" + parentName);\n }\n let data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\n\n //this is legacy\n if (boneMap.hasOwnProperty(\"inheritScale\") || boneMap.hasOwnProperty(\"inheritRotation\")) {\n //before 3.5\n data.transformMode = SkeletonJson.transformModeLegacy(\n this.getValue(boneMap, \"inheritRotation\", true),\n this.getValue(boneMap, \"inheritScale\", true));\n } else {\n //after 3.5\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\n }\n\n skeletonData.bones.push(data);\n }\n }\n\n // Slots.\n if (root.slots) {\n for (let i = 0; i < root.slots.length; i++) {\n let slotMap = root.slots[i];\n let slotName: string = slotMap.name;\n let boneName: string = slotMap.bone;\n let boneData = skeletonData.findBone(boneName);\n if (boneData == null) throw new Error(\"Slot bone not found: \" + boneName);\n let data = new SlotData(skeletonData.slots.length, slotName, boneData);\n\n let color: string = this.getValue(slotMap, \"color\", null);\n if (color != null) data.color.setFromString(color);\n\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\n skeletonData.slots.push(data);\n }\n }\n\n // IK constraints\n if (root.ik) {\n for (let i = 0; i < root.ik.length; i++) {\n let constraintMap = root.ik[i];\n let data = new IkConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n\n for (let j = 0; j < constraintMap.bones.length; j++) {\n let boneName = constraintMap.bones[j];\n let bone = skeletonData.findBone(boneName);\n if (bone == null) throw new Error(\"IK bone not found: \" + boneName);\n data.bones.push(bone);\n }\n\n let targetName: string = constraintMap.target;\n data.target = skeletonData.findBone(targetName);\n if (data.target == null) throw new Error(\"IK target bone not found: \" + targetName);\n\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n data.mix = this.getValue(constraintMap, \"mix\", 1);\n\n skeletonData.ikConstraints.push(data);\n }\n }\n\n // Transform constraints.\n if (root.transform) {\n for (let i = 0; i < root.transform.length; i++) {\n let constraintMap = root.transform[i];\n let data = new TransformConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n\n for (let j = 0; j < constraintMap.bones.length; j++) {\n let boneName = constraintMap.bones[j];\n let bone = skeletonData.findBone(boneName);\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\n data.bones.push(bone);\n }\n\n let targetName: string = constraintMap.target;\n data.target = skeletonData.findBone(targetName);\n if (data.target == null) throw new Error(\"Transform constraint target bone not found: \" + targetName);\n\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\n\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\n\n skeletonData.transformConstraints.push(data);\n }\n }\n\n // Path constraints.\n if (root.path) {\n for (let i = 0; i < root.path.length; i++) {\n let constraintMap = root.path[i];\n let data = new PathConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n\n for (let j = 0; j < constraintMap.bones.length; j++) {\n let boneName = constraintMap.bones[j];\n let bone = skeletonData.findBone(boneName);\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\n data.bones.push(bone);\n }\n\n let targetName: string = constraintMap.target;\n data.target = skeletonData.findSlot(targetName);\n if (data.target == null) throw new Error(\"Path target slot not found: \" + targetName);\n\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\n data.position = this.getValue(constraintMap, \"position\", 0);\n if (data.positionMode == PositionMode.Fixed) data.position *= scale;\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\n\n skeletonData.pathConstraints.push(data);\n }\n }\n\n // Skins.\n if (root.skins) {\n for (let skinName in root.skins) {\n let skinMap = root.skins[skinName]\n let skin = new Skin(skinName);\n for (let slotName in skinMap) {\n let slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\n let slotMap = skinMap[slotName];\n for (let entryName in slotMap) {\n let attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName);\n if (attachment != null) skin.addAttachment(slotIndex, entryName, attachment);\n }\n }\n skeletonData.skins.push(skin);\n if (skin.name == \"default\") skeletonData.defaultSkin = skin;\n }\n }\n\n // Linked meshes.\n for (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\n let linkedMesh = this.linkedMeshes[i];\n let skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n if (skin == null) throw new Error(\"Skin not found: \" + linkedMesh.skin);\n let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n if (parent == null) throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\n linkedMesh.mesh.setParentMesh( parent);\n // linkedMesh.mesh.updateUVs();\n }\n this.linkedMeshes.length = 0;\n\n // Events.\n if (root.events) {\n for (let eventName in root.events) {\n let eventMap = root.events[eventName];\n let data = new EventData(eventName);\n data.intValue = this.getValue(eventMap, \"int\", 0);\n data.floatValue = this.getValue(eventMap, \"float\", 0);\n data.stringValue = this.getValue(eventMap, \"string\", null);\n skeletonData.events.push(data);\n }\n }\n\n // Animations.\n if (root.animations) {\n for (let animationName in root.animations) {\n let animationMap = root.animations[animationName];\n this.readAnimation(animationMap, animationName, skeletonData);\n }\n }\n\n return skeletonData;\n }\n\n readAttachment (map: any, skin: Skin, slotIndex: number, name: string): Attachment {\n let scale = this.scale;\n name = this.getValue(map, \"name\", name);\n\n let type = this.getValue(map, \"type\", \"region\");\n\n switch (type) {\n case \"region\": {\n let path = this.getValue(map, \"path\", name);\n let region = this.attachmentLoader.newRegionAttachment(skin, name, path);\n if (region == null) return null;\n region.path = path;\n region.x = this.getValue(map, \"x\", 0) * scale;\n region.y = this.getValue(map, \"y\", 0) * scale;\n region.scaleX = this.getValue(map, \"scaleX\", 1);\n region.scaleY = this.getValue(map, \"scaleY\", 1);\n region.rotation = this.getValue(map, \"rotation\", 0);\n region.width = map.width * scale;\n region.height = map.height * scale;\n\n let color: string = this.getValue(map, \"color\", null);\n if (color != null) region.color.setFromString(color);\n\n return region;\n }\n case \"boundingbox\": {\n let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n if (box == null) return null;\n this.readVertices(map, box, map.vertexCount << 1);\n let color: string = this.getValue(map, \"color\", null);\n if (color != null) box.color.setFromString(color);\n return box;\n }\n //weightedmesh is deprecated but who cares\n case \"weightedmesh\":\n case \"skinnedmesh\":\n case \"mesh\":\n case \"linkedmesh\": {\n let path = this.getValue(map, \"path\", name);\n let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\n if (mesh == null) return null;\n mesh.path = path;\n\n let color = this.getValue(map, \"color\", null);\n if (color != null) mesh.color.setFromString(color);\n\n let parent: string = this.getValue(map, \"parent\", null);\n if (parent != null) {\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent));\n return mesh;\n }\n\n let uvs: Array = map.uvs;\n this.readVertices(map, mesh, uvs.length);\n mesh.triangles = map.triangles;\n mesh.regionUVs = uvs;\n // mesh.updateUVs();\n\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\n return mesh;\n }\n case \"path\": {\n let path = this.attachmentLoader.newPathAttachment(skin, name);\n if (path == null) return null;\n path.closed = this.getValue(map, \"closed\", false);\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\n\n let vertexCount = map.vertexCount;\n this.readVertices(map, path, vertexCount << 1);\n\n let lengths: Array = Utils.newArray(vertexCount / 3, 0);\n for (let i = 0; i < map.lengths.length; i++)\n lengths[i++] = map.lengths[i] * scale;\n path.lengths = lengths;\n\n let color: string = this.getValue(map, \"color\", null);\n if (color != null) path.color.setFromString(color);\n return path;\n }\n }\n return null;\n }\n\n readVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\n let scale = this.scale;\n attachment.worldVerticesLength = verticesLength;\n let vertices: Array = map.vertices;\n if (verticesLength == vertices.length) {\n if (scale != 1) {\n for (let i = 0, n = vertices.length; i < n; i++)\n vertices[i] *= scale;\n }\n attachment.vertices = Utils.toFloatArray(vertices);\n return;\n }\n let weights = new Array();\n let bones = new Array();\n for (let i = 0, n = vertices.length; i < n;) {\n let boneCount = vertices[i++];\n bones.push(boneCount);\n for (let nn = i + boneCount * 4; i < nn; i += 4) {\n bones.push(vertices[i]);\n weights.push(vertices[i + 1] * scale);\n weights.push(vertices[i + 2] * scale);\n weights.push(vertices[i + 3]);\n }\n }\n attachment.bones = bones;\n attachment.vertices = Utils.toFloatArray(weights);\n }\n\n readAnimation (map: any, name: string, skeletonData: SkeletonData) {\n let scale = this.scale;\n let timelines = new Array();\n let duration = 0;\n\n // Slot timelines.\n if (map.slots) {\n for (let slotName in map.slots) {\n let slotMap = map.slots[slotName];\n let slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\n for (let timelineName in slotMap) {\n let timelineMap = slotMap[timelineName];\n if (timelineName == \"color\") {\n let timeline = new ColorTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n let color = new Color();\n color.setFromString(valueMap.color);\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\n\n } else if (timelineName = \"attachment\") {\n let timeline = new AttachmentTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n } else\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\n }\n }\n }\n\n // Bone timelines.\n if (map.bones) {\n for (let boneName in map.bones) {\n let boneMap = map.bones[boneName];\n let boneIndex = skeletonData.findBoneIndex(boneName);\n if (boneIndex == -1) throw new Error(\"Bone not found: \" + boneName);\n for (let timelineName in boneMap) {\n let timelineMap = boneMap[timelineName];\n if (timelineName === \"rotate\") {\n let timeline = new RotateTimeline(timelineMap.length);\n timeline.boneIndex = boneIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\n\n } else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\n let timeline: TranslateTimeline = null;\n let timelineScale = 1;\n if (timelineName === \"scale\")\n timeline = new ScaleTimeline(timelineMap.length);\n else if (timelineName === \"shear\")\n timeline = new ShearTimeline(timelineMap.length);\n else {\n timeline = new TranslateTimeline(timelineMap.length);\n timelineScale = scale;\n }\n timeline.boneIndex = boneIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n let x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\n\n } else\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\n }\n }\n }\n\n // IK constraint timelines.\n if (map.ik) {\n for (let constraintName in map.ik) {\n let constraintMap = map.ik[constraintName];\n let constraint = skeletonData.findIkConstraint(constraintName);\n let timeline = new IkConstraintTimeline(constraintMap.length);\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\n let frameIndex = 0;\n for (let i = 0; i < constraintMap.length; i++) {\n let valueMap = constraintMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1),\n this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\n }\n }\n\n // Transform constraint timelines.\n if (map.transform) {\n for (let constraintName in map.transform) {\n let constraintMap = map.transform[constraintName];\n let constraint = skeletonData.findTransformConstraint(constraintName);\n let timeline = new TransformConstraintTimeline(constraintMap.length);\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\n let frameIndex = 0;\n for (let i = 0; i < constraintMap.length; i++) {\n let valueMap = constraintMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\n this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration,\n timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\n }\n }\n\n // Path constraint timelines.\n if (map.paths) {\n for (let constraintName in map.paths) {\n let constraintMap = map.paths[constraintName];\n let index = skeletonData.findPathConstraintIndex(constraintName);\n if (index == -1) throw new Error(\"Path constraint not found: \" + constraintName);\n let data = skeletonData.pathConstraints[index];\n for (let timelineName in constraintMap) {\n let timelineMap = constraintMap[timelineName];\n if (timelineName === \"position\" || timelineName === \"spacing\") {\n let timeline: PathConstraintPositionTimeline = null;\n let timelineScale = 1;\n if (timelineName === \"spacing\") {\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) timelineScale = scale;\n } else {\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\n if (data.positionMode == PositionMode.Fixed) timelineScale = scale;\n }\n timeline.pathConstraintIndex = index;\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration,\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\n } else if (timelineName === \"mix\") {\n let timeline = new PathConstraintMixTimeline(timelineMap.length);\n timeline.pathConstraintIndex = index;\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\n this.getValue(valueMap, \"translateMix\", 1));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration,\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\n }\n }\n }\n }\n\n // Deform timelines.\n if (map.deform) {\n for (let deformName in map.deform) {\n let deformMap = map.deform[deformName];\n let skin = skeletonData.findSkin(deformName);\n if (skin == null) throw new Error(\"Skin not found: \" + deformName);\n for (let slotName in deformMap) {\n let slotMap = deformMap[slotName];\n let slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotMap.name);\n for (let timelineName in slotMap) {\n let timelineMap = slotMap[timelineName];\n let attachment = skin.getAttachment(slotIndex, timelineName);\n if (attachment == null) throw new Error(\"Deform attachment not found: \" + timelineMap.name);\n let weighted = attachment.bones != null;\n let vertices = attachment.vertices;\n let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n let timeline = new DeformTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n timeline.attachment = attachment;\n\n let frameIndex = 0;\n for (let j = 0; j < timelineMap.length; j++) {\n let valueMap = timelineMap[j];\n let deform: ArrayLike;\n let verticesValue: Array = this.getValue(valueMap, \"vertices\", null);\n if (verticesValue == null)\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n else {\n deform = Utils.newFloatArray(deformLength);\n let start = this.getValue(valueMap, \"offset\", 0);\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n if (scale != 1) {\n for (let i = start, n = i + verticesValue.length; i < n; i++)\n deform[i] *= scale;\n }\n if (!weighted) {\n for (let i = 0; i < deformLength; i++)\n deform[i] += vertices[i];\n }\n }\n\n timeline.setFrame(frameIndex, valueMap.time, deform);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n }\n }\n }\n\n // Draw order timeline.\n let drawOrderNode = map.drawOrder;\n if (drawOrderNode == null) drawOrderNode = map.draworder;\n if (drawOrderNode != null) {\n let timeline = new DrawOrderTimeline(drawOrderNode.length);\n let slotCount = skeletonData.slots.length;\n let frameIndex = 0;\n for (let j = 0; j < drawOrderNode.length; j++) {\n let drawOrderMap = drawOrderNode[j];\n let drawOrder: Array = null;\n let offsets = this.getValue(drawOrderMap, \"offsets\", null);\n if (offsets != null) {\n drawOrder = Utils.newArray(slotCount, -1);\n let unchanged = Utils.newArray(slotCount - offsets.length, 0);\n let originalIndex = 0, unchangedIndex = 0;\n for (let i = 0; i < offsets.length; i++) {\n let offsetMap = offsets[i];\n let slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + offsetMap.slot);\n // Collect unchanged items.\n while (originalIndex != slotIndex)\n unchanged[unchangedIndex++] = originalIndex++;\n // Set changed items.\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n }\n // Collect remaining unchanged items.\n while (originalIndex < slotCount)\n unchanged[unchangedIndex++] = originalIndex++;\n // Fill in unchanged items.\n for (let i = slotCount - 1; i >= 0; i--)\n if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex];\n }\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n\n // Event timeline.\n if (map.events) {\n let timeline = new EventTimeline(map.events.length);\n let frameIndex = 0;\n for (let i = 0; i < map.events.length; i++) {\n let eventMap = map.events[i];\n let eventData = skeletonData.findEvent(eventMap.name);\n if (eventData == null) throw new Error(\"Event not found: \" + eventMap.name);\n let event = new Event(eventMap.time, eventData);\n event.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\n event.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\n event.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\n timeline.setFrame(frameIndex++, event);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n\n if (isNaN(duration)) {\n throw new Error(\"Error while parsing animation, duration is NaN\");\n }\n\n skeletonData.animations.push(new Animation(name, timelines, duration));\n }\n\n readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {\n if (!map.curve) return;\n if (map.curve === \"stepped\")\n timeline.setStepped(frameIndex);\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\n let curve: Array = map.curve;\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\n }\n }\n\n getValue (map: any, prop: string, defaultValue: any) {\n return map[prop] !== undefined ? map[prop] : defaultValue;\n }\n\n static blendModeFromString (str: string): number {\n if (str === 'multiply') return PIXI.BLEND_MODES.MULTIPLY;\n if (str === 'additive') return PIXI.BLEND_MODES.ADD;\n if (str === 'screen') return PIXI.BLEND_MODES.SCREEN;\n if (str === 'normal') return PIXI.BLEND_MODES.NORMAL;\n throw new Error(`Unknown blend mode: ${str}`);\n }\n\n static positionModeFromString (str: string) {\n str = str.toLowerCase();\n if (str == \"fixed\") return PositionMode.Fixed;\n if (str == \"percent\") return PositionMode.Percent;\n throw new Error(`Unknown position mode: ${str}`);\n }\n\n static spacingModeFromString (str: string) {\n str = str.toLowerCase();\n if (str == \"length\") return SpacingMode.Length;\n if (str == \"fixed\") return SpacingMode.Fixed;\n if (str == \"percent\") return SpacingMode.Percent;\n throw new Error(`Unknown position mode: ${str}`);\n }\n\n static rotateModeFromString (str: string) {\n str = str.toLowerCase();\n if (str == \"tangent\") return RotateMode.Tangent;\n if (str == \"chain\") return RotateMode.Chain;\n if (str == \"chainscale\") return RotateMode.ChainScale;\n throw new Error(`Unknown rotate mode: ${str}`);\n }\n\n static transformModeFromString(str: string) {\n str = str.toLowerCase();\n if (str == \"normal\") return TransformMode.Normal;\n if (str == \"onlytranslation\") return TransformMode.OnlyTranslation;\n if (str == \"norotationorreflection\") return TransformMode.NoRotationOrReflection;\n if (str == \"noscale\") return TransformMode.NoScale;\n if (str == \"noscaleorreflection\") return TransformMode.NoScaleOrReflection;\n throw new Error(`Unknown transform mode: ${str}`);\n }\n\n static transformModeLegacy(inheritRotation: boolean, inheritScale: boolean) {\n if (inheritRotation && inheritScale) {\n return TransformMode.Normal;\n } else if (inheritRotation) {\n return TransformMode.InheritRotation;\n } else if (inheritScale) {\n return TransformMode.InheritScale;\n } else {\n return TransformMode.OnlyTranslation;\n }\n }\n}\n\nclass LinkedMesh {\n parent: string; skin: string;\n slotIndex: number;\n mesh: MeshAttachment;\n\n constructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string) {\n this.mesh = mesh;\n this.skin = skin;\n this.slotIndex = slotIndex;\n this.parent = parent;\n }\n}\n","import {Attachment} from \"./attachments\";\nimport {Skeleton} from \"./Skeleton\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Skin {\n name: string;\n attachments = new Array>();\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n\n addAttachment (slotIndex: number, name: string, attachment: Attachment) {\n if (attachment == null) throw new Error(\"attachment cannot be null.\");\n let attachments = this.attachments;\n if (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n if (!attachments[slotIndex]) attachments[slotIndex] = { };\n attachments[slotIndex][name] = attachment;\n }\n\n /** @return May be null. */\n getAttachment (slotIndex: number, name: string): Attachment {\n let dictionary = this.attachments[slotIndex];\n return dictionary ? dictionary[name] : null;\n }\n\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n attachAll (skeleton: Skeleton, oldSkin: Skin) {\n let slotIndex = 0;\n for (let i = 0; i < skeleton.slots.length; i++) {\n let slot = skeleton.slots[i];\n let slotAttachment = slot.getAttachment();\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\n let dictionary = oldSkin.attachments[slotIndex];\n for (let key in dictionary) {\n let skinAttachment:Attachment = dictionary[key];\n if (slotAttachment == skinAttachment) {\n let attachment = this.getAttachment(slotIndex, name);\n if (attachment != null) slot.setAttachment(attachment);\n break;\n }\n }\n }\n slotIndex++;\n }\n }\n}\n","import {Attachment} from \"./attachments\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Color} from \"./Utils\";\r\nimport {TextureRegion} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Slot {\r\n //this is for PIXI\r\n currentMesh: any;\r\n currentSprite: any;\r\n meshes: any;\r\n currentMeshName: String;\r\n sprites: any;\r\n currentSpriteName: String;\r\n blendMode: number;\r\n //assign hack region a bit later\r\n tempRegion: TextureRegion;\r\n tempAttachment: Attachment;\r\n\r\n //canon\r\n data: SlotData;\r\n bone: Bone;\r\n color: Color;\r\n attachment: Attachment;\r\n private attachmentTime: number;\r\n attachmentVertices = new Array();\r\n\r\n constructor (data: SlotData, bone: Bone) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (bone == null) throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.blendMode = data.blendMode;\r\n this.setToSetupPose();\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachment (): Attachment {\r\n return this.attachment;\r\n }\r\n\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n setAttachment (attachment: Attachment) {\r\n if (this.attachment == attachment) return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n }\r\n\r\n setAttachmentTime (time: number) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n }\r\n\r\n /** Returns the time since the attachment was set. */\r\n getAttachmentTime (): number {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n }\r\n\r\n setToSetupPose () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {Color} from \"./Utils\";\r\nimport {BlendMode} from \"./BlendMode\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SlotData {\r\n index: number;\r\n name: string;\r\n boneData: BoneData;\r\n color = new Color(1, 1, 1, 1);\r\n attachmentName: string;\r\n blendMode: number;\r\n\r\n constructor (index: number, name: string, boneData: BoneData) {\r\n if (index < 0) throw new Error(\"index must be >= 0.\");\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n if (boneData == null) throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n}\r\n","export abstract class Texture {\r\n protected _image: HTMLImageElement;\r\n\r\n constructor (image: HTMLImageElement) {\r\n this._image = image;\r\n }\r\n\r\n getImage (): HTMLImageElement {\r\n return this._image;\r\n }\r\n\r\n abstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\r\n abstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\r\n abstract dispose (): void;\r\n\r\n\r\n public static filterFromString (text: string): TextureFilter {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(`Unknown texture filter ${text}`);\r\n }\r\n }\r\n\r\n public static wrapFromString (text: string): TextureWrap {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(`Unknown texture wrap ${text}`);\r\n }\r\n }\r\n}\r\n\r\nexport enum TextureFilter {\r\n Nearest = 9728, // WebGLRenderingContext.NEAREST\r\n Linear = 9729, // WebGLRenderingContext.LINEAR\r\n MipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n MipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\r\n MipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\r\n MipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\r\n MipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n}\r\n\r\nexport enum TextureWrap {\r\n MirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\r\n ClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\r\n Repeat = 10497 // WebGLRenderingContext.REPEAT\r\n}\r\n\r\nexport class TextureRegion {\r\n texture: PIXI.Texture;\r\n\r\n //thats for overrides\r\n size: PIXI.Rectangle = null;\r\n\r\n get width(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.width;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get height(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.height;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get u(): number {\r\n return this.texture._uvs.x0;\r\n }\r\n\r\n get v(): number {\r\n return this.texture._uvs.y0;\r\n }\r\n\r\n get u2(): number {\r\n return this.texture._uvs.x2;\r\n }\r\n\r\n get v2(): number {\r\n return this.texture._uvs.y2;\r\n }\r\n\r\n get offsetX(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.x : 0;\r\n }\r\n\r\n get offsetY(): number {\r\n console.warn(\"Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on.\");\r\n return this.spineOffsetY;\r\n }\r\n\r\n get pixiOffsetY(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.y : 0;\r\n }\r\n\r\n get spineOffsetY(): number {\r\n var tex = this.texture;\r\n return this.originalHeight - this.height - (tex.trim ? tex.trim.y : 0);\r\n }\r\n\r\n get originalWidth(): number {\r\n var tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.crop.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get originalHeight(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.crop.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get x(): number {\r\n return this.texture.frame.x;\r\n }\r\n\r\n get y(): number {\r\n return this.texture.frame.y;\r\n }\r\n\r\n get rotate(): boolean {\r\n return this.texture.rotate !== 0;\r\n }\r\n}\r\n","import {Disposable, Map} from \"./Utils\";\r\nimport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TextureAtlas implements Disposable {\r\n pages = new Array();\r\n regions = new Array();\r\n\r\n constructor(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (atlasText) {\r\n this.addSpineAtlas(atlasText, textureLoader, callback);\r\n }\r\n }\r\n\r\n addTexture(name: string, texture: PIXI.Texture) {\r\n let pages = this.pages;\r\n let page: TextureAtlasPage = null;\r\n for (var i=0;i, stripExtension: boolean) {\r\n for (var key in textures) {\r\n if (textures.hasOwnProperty(key)) {\r\n this.addTexture(stripExtension && key.indexOf('.') !== -1 ? key.substr(0, key.lastIndexOf('.')) : key, textures[key]);\r\n }\r\n }\r\n }\r\n\r\n public addSpineAtlas(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n return this.load(atlasText, textureLoader, callback);\r\n }\r\n\r\n private load(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n\r\n let reader = new TextureAtlasReader(atlasText);\r\n let tuple = new Array(4);\r\n let page: TextureAtlasPage = null;\r\n\r\n let iterateParser = () => {\r\n while (true) {\r\n let line = reader.readLine();\r\n if (line == null) {\r\n return callback && callback(this);\r\n }\r\n line = line.trim();\r\n if (line.length == 0)\r\n page = null;\r\n else if (!page) {\r\n page = new TextureAtlasPage();\r\n page.name = line;\r\n\r\n if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker.\r\n page.width = parseInt(tuple[0]);\r\n page.height = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n }\r\n // page.format = Format[tuple[0]]; we don't need format in WebGL\r\n\r\n reader.readTuple(tuple);\r\n page.minFilter = Texture.filterFromString(tuple[0]);\r\n page.magFilter = Texture.filterFromString(tuple[1]);\r\n\r\n let direction = reader.readValue();\r\n page.uWrap = TextureWrap.ClampToEdge;\r\n page.vWrap = TextureWrap.ClampToEdge;\r\n if (direction == \"x\")\r\n page.uWrap = TextureWrap.Repeat;\r\n else if (direction == \"y\")\r\n page.vWrap = TextureWrap.Repeat;\r\n else if (direction == \"xy\")\r\n page.uWrap = page.vWrap = TextureWrap.Repeat;\r\n\r\n textureLoader(line, (texture: PIXI.BaseTexture) => {\r\n page.baseTexture = texture;\r\n if (!texture.hasLoaded) {\r\n texture.width = page.width;\r\n texture.height = page.height;\r\n }\r\n this.pages.push(page);\r\n page.setFilters();\r\n\r\n if (!page.width || !page.height) {\r\n page.width = texture.realWidth;\r\n page.height = texture.realHeight;\r\n if (!page.width || !page.height) {\r\n console.log(\"ERROR spine atlas page \" + page.name + \": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)\");\r\n }\r\n }\r\n iterateParser();\r\n });\r\n this.pages.push(page);\r\n break;\r\n } else {\r\n let region: TextureAtlasRegion = new TextureAtlasRegion();\r\n region.name = line;\r\n region.page = page;\r\n\r\n let rotate: number = reader.readValue() == \"true\" ? 6 : 0;\r\n\r\n reader.readTuple(tuple);\r\n let x = parseInt(tuple[0]);\r\n let y = parseInt(tuple[1]);\r\n\r\n reader.readTuple(tuple);\r\n let width = parseInt(tuple[0]);\r\n let height = parseInt(tuple[1]);\r\n\r\n let resolution = page.baseTexture.resolution;\r\n x /= resolution;\r\n y /= resolution;\r\n width /= resolution;\r\n height /= resolution;\r\n\r\n let frame = new PIXI.Rectangle(x, y, rotate ? height : width, rotate ? width : height);\r\n\r\n if (reader.readTuple(tuple) == 4) { // split is optional\r\n // region.splits = new Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits\r\n //region.pads = Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n reader.readTuple(tuple);\r\n }\r\n }\r\n\r\n let originalWidth = parseInt(tuple[0]) / resolution;\r\n let originalHeight = parseInt(tuple[1]) / resolution;\r\n reader.readTuple(tuple);\r\n let offsetX = parseInt(tuple[0]) / resolution;\r\n let offsetY = parseInt(tuple[1]) / resolution;\r\n\r\n let orig = new PIXI.Rectangle(0, 0, originalWidth, originalHeight);\r\n let trim = new PIXI.Rectangle(offsetX, originalHeight - height - offsetY, width, height);\r\n\r\n //TODO: pixiv3 uses different frame/crop/trim\r\n\r\n if (PIXI.VERSION[0] == '4') {\r\n // pixi v4.0.0\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame, orig, trim, rotate);\r\n } else {\r\n // pixi v3.0.11\r\n var frame2 = new PIXI.Rectangle(x, y, width, height);\r\n var crop = frame2.clone();\r\n trim.width = originalWidth;\r\n trim.height = originalHeight;\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame2, crop, trim, rotate);\r\n }\r\n\r\n region.index = parseInt(reader.readValue());\r\n region.texture._updateUvs();\r\n\r\n this.regions.push(region);\r\n }\r\n }\r\n }\r\n\r\n iterateParser();\r\n }\r\n\r\n findRegion(name: string): TextureAtlasRegion {\r\n for (let i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n dispose() {\r\n for (let i = 0; i < this.pages.length; i++) {\r\n this.pages[i].baseTexture.dispose();\r\n }\r\n }\r\n}\r\n\r\nclass TextureAtlasReader {\r\n lines: Array;\r\n index: number = 0;\r\n\r\n constructor(text: string) {\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n\r\n readLine(): string {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n }\r\n\r\n readValue(): string {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n return line.substring(colon + 1).trim();\r\n }\r\n\r\n readTuple(tuple: Array): number {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n let i = 0, lastMatch = colon + 1;\r\n for (; i < 3; i++) {\r\n let comma = line.indexOf(\",\", lastMatch);\r\n if (comma == -1) break;\r\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n }\r\n tuple[i] = line.substring(lastMatch).trim();\r\n return i + 1;\r\n }\r\n}\r\n\r\nexport class TextureAtlasPage {\r\n name: string;\r\n minFilter: TextureFilter;\r\n magFilter: TextureFilter;\r\n uWrap: TextureWrap;\r\n vWrap: TextureWrap;\r\n baseTexture: PIXI.BaseTexture;\r\n width: number;\r\n height: number;\r\n\r\n public setFilters() {\r\n let tex = this.baseTexture;\r\n let filter = this.minFilter;\r\n if (filter == TextureFilter.Linear) {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n } else if (this.minFilter == TextureFilter.Nearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.mipmap = true;\r\n if (filter == TextureFilter.MipMapNearestNearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class TextureAtlasRegion extends TextureRegion {\r\n page: TextureAtlasPage;\r\n name: string;\r\n index: number;\r\n}\r\n","import {TransformConstraintData} from \"./TransformConstraintData\";\nimport {Bone} from \"./Bone\";\nimport {Vector2, MathUtils} from \"./Utils\";\nimport {Skeleton} from \"./Skeleton\";\nimport {Constraint} from \"./Constraint\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class TransformConstraint implements Constraint {\n data: TransformConstraintData;\n bones: Array;\n target: Bone;\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\n temp = new Vector2();\n\n constructor (data: TransformConstraintData, skeleton: Skeleton) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.rotateMix = data.rotateMix;\n this.translateMix = data.translateMix;\n this.scaleMix = data.scaleMix;\n this.shearMix = data.shearMix;\n this.bones = new Array();\n for (let i = 0; i < data.bones.length; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findBone(data.target.name);\n }\n\n apply () {\n this.update();\n }\n\n update () {\n let rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\n let target = this.target;\n let ta = target.matrix.a, tb = target.matrix.c, tc = target.matrix.b, td = target.matrix.d;\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n let m = bone.matrix;\n let modified = false;\n\n if (rotateMix != 0) {\n let a = m.a, b = m.c, c = m.b, d = m.d;\n let r = Math.atan2(tc, ta) - Math.atan2(c, a) + this.data.offsetRotation * MathUtils.degRad;\n if (r > MathUtils.PI)\n r -= MathUtils.PI2;\n else if (r < -MathUtils.PI)\n r += MathUtils.PI2;\n r *= rotateMix;\n let cos = Math.cos(r), sin = Math.sin(r);\n m.a = cos * a - sin * c;\n m.c = cos * b - sin * d;\n m.b = sin * a + cos * c;\n m.d = sin * b + cos * d;\n modified = true;\n }\n\n if (translateMix != 0) {\n let temp = this.temp;\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n m.tx += (temp.x - m.tx) * translateMix;\n m.ty += (temp.y - m.ty) * translateMix;\n modified = true;\n }\n\n if (scaleMix > 0) {\n let s = Math.sqrt(m.a * m.a + m.b * m.b);\n let ts = Math.sqrt(ta * ta + tc * tc);\n if (s > 0.00001) s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\n m.a *= s;\n m.b *= s;\n s = Math.sqrt(m.c * m.c + m.d * m.d);\n ts = Math.sqrt(tb * tb + td * td);\n if (s > 0.00001) s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\n m.c *= s;\n m.d *= s;\n modified = true;\n }\n\n if (shearMix > 0) {\n let b = m.c, d = m.d;\n let by = Math.atan2(d, b);\n let r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(m.b, m.a));\n if (r > MathUtils.PI)\n r -= MathUtils.PI2;\n else if (r < -MathUtils.PI)\n r += MathUtils.PI2;\n r = by + (r + this.data.offsetShearY * MathUtils.degRad) * shearMix;\n let s = Math.sqrt(b * b + d * d);\n m.c = Math.cos(r) * s;\n m.d = Math.sin(r) * s;\n modified = true;\n }\n\n if (modified) bone.appliedValid = false;\n }\n }\n\n getOrder () {\n return this.data.order;\n }\n}\n","import {BoneData} from \"./BoneData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class TransformConstraintData {\n name: string;\n order = 0;\n bones = new Array();\n target: BoneData;\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\n offsetRotation = 0; offsetX = 0; offsetY = 0; offsetScaleX = 0; offsetScaleY = 0; offsetShearY = 0;\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n}\n","import {Skeleton} from \"./Skeleton\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport interface Map {\n [key: string]: T;\n}\n\nexport interface Disposable {\n dispose (): void;\n}\n\nexport class Color {\n public static WHITE = new Color(1, 1, 1, 1);\n public static RED = new Color(1, 0, 0, 1);\n public static GREEN = new Color(0, 1, 0, 1);\n public static BLUE = new Color(0, 0, 1, 1);\n public static MAGENTA = new Color(1, 0, 1, 1);\n\n constructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\n }\n\n set (r: number, g: number, b: number, a: number) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n this.clamp();\n return this;\n }\n\n setFromColor (c: Color) {\n this.r = c.r;\n this.g = c.g;\n this.b = c.b;\n this.a = c.a;\n return this;\n }\n\n setFromString (hex: string) {\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\n return this;\n }\n\n add (r: number, g: number, b: number, a: number) {\n this.r += r;\n this.g += g;\n this.b += b;\n this.a += a;\n this.clamp();\n return this;\n }\n\n clamp () {\n if (this.r < 0) this.r = 0;\n else if (this.r > 1) this.r = 1;\n\n if (this.g < 0) this.g = 0;\n else if (this.g > 1) this.g = 1;\n\n if (this.b < 0) this.b = 0;\n else if (this.b > 1) this.b = 1;\n\n if (this.a < 0) this.a = 0;\n else if (this.a > 1) this.a = 1;\n return this;\n }\n}\n\nexport class MathUtils {\n static PI = 3.1415927;\n static PI2 = MathUtils.PI * 2;\n static radiansToDegrees = 180 / MathUtils.PI;\n static radDeg = MathUtils.radiansToDegrees;\n static degreesToRadians = MathUtils.PI / 180;\n static degRad = MathUtils.degreesToRadians;\n\n static clamp (value: number, min: number, max: number) {\n if (value < min) return min;\n if (value > max) return max;\n return value;\n }\n\n static cosDeg (degrees: number) {\n return Math.cos(degrees * MathUtils.degRad);\n }\n\n static sinDeg (degrees: number) {\n return Math.sin(degrees * MathUtils.degRad);\n }\n\n static signum (value: number): number {\n return value >= 0 ? 1 : -1;\n }\n\n static toInt (x: number) {\n return x > 0 ? Math.floor(x) : Math.ceil(x);\n }\n\n static cbrt (x: number) {\n var y = Math.pow(Math.abs(x), 1/3);\n return x < 0 ? -y : y;\n }\n}\n\nexport class Utils {\n static SUPPORTS_TYPED_ARRAYS = typeof(Float32Array) !== \"undefined\";\n\n static arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\n for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n dest[j] = source[i];\n }\n }\n\n static setArraySize (array: Array, size: number, value: any = 0): Array {\n let oldSize = array.length;\n if (oldSize == size) return array;\n array.length = size;\n if (oldSize < size) {\n for (let i = oldSize; i < size; i++) array[i] = value;\n }\n return array;\n }\n\n static newArray (size: number, defaultValue: T): Array {\n let array = new Array(size);\n for (let i = 0; i < size; i++) array[i] = defaultValue;\n return array;\n }\n\n static newFloatArray (size: number): ArrayLike {\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\n return new Float32Array(size)\n } else {\n let array = new Array(size);\n for (let i = 0; i < array.length; i++) array[i] = 0;\n return array;\n }\n }\n\n static toFloatArray (array: Array) {\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n }\n}\n\nexport class DebugUtils {\n static logBones(skeleton: Skeleton) {\n for (let i = 0; i < skeleton.bones.length; i++) {\n let bone = skeleton.bones[i];\n let m = bone.matrix;\n console.log(bone.data.name + \", \" + m.a + \", \" + m.b + \", \" + m.c + \", \" + m.d + \", \" + m.tx + \", \" + m.ty);\n }\n }\n}\n\nexport class Pool {\n private items = new Array();\n private instantiator: () => T;\n\n constructor (instantiator: () => T) {\n this.instantiator = instantiator;\n }\n\n obtain () {\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\n }\n\n free (item: T) {\n this.items.push(item);\n }\n\n freeAll (items: ArrayLike) {\n for (let i = 0; i < items.length; i++) this.items[i] = items[i];\n }\n\n clear () {\n this.items.length = 0;\n }\n}\n\nexport class Vector2 {\n constructor (public x = 0, public y = 0) {\n }\n\n set (x: number, y: number): Vector2 {\n this.x = x;\n this.y = y;\n return this;\n }\n\n length () {\n let x = this.x;\n let y = this.y;\n return Math.sqrt(x * x + y * y);\n }\n\n normalize () {\n let len = this.length();\n if (len != 0) {\n this.x /= len;\n this.y /= len;\n }\n return this;\n }\n}\n\nexport class TimeKeeper {\n maxDelta = 0.064;\n framesPerSecond = 0;\n delta = 0;\n totalTime = 0;\n\n private lastTime = Date.now() / 1000;\n private frameCount = 0;\n private frameTime = 0;\n\n update () {\n var now = Date.now() / 1000;\n this.delta = now - this.lastTime;\n this.frameTime += this.delta;\n this.totalTime += this.delta;\n if (this.delta > this.maxDelta) this.delta = this.maxDelta;\n this.lastTime = now;\n\n this.frameCount++;\n if (this.frameTime > 1) {\n this.framesPerSecond = this.frameCount / this.frameTime;\n this.frameTime = 0;\n this.frameCount = 0;\n }\n }\n}\n\nexport interface ArrayLike {\n length: number;\n [n: number]: T;\n}\n","import {Slot} from \"../Slot\";\nimport {ArrayLike} from \"../Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport abstract class Attachment {\n name: string;\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n}\n\nexport abstract class VertexAttachment extends Attachment {\n bones: Array;\n vertices: ArrayLike;\n worldVerticesLength = 0;\n\n constructor (name: string) {\n super(name);\n }\n\n computeWorldVertices (slot: Slot, worldVertices: ArrayLike) {\n this.computeWorldVerticesWith(slot, 0, this.worldVerticesLength, worldVertices, 0);\n }\n\n /** Transforms local vertices to world coordinates.\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\n * @param offset The worldVertices index to begin writing values. */\n computeWorldVerticesWith (slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number) {\n count += offset;\n let skeleton = slot.bone.skeleton;\n let deformArray = slot.attachmentVertices;\n let vertices = this.vertices;\n let bones = this.bones;\n if (bones == null) {\n if (deformArray.length > 0) vertices = deformArray;\n let bone = slot.bone;\n let m = bone.matrix;\n let x = m.tx;\n let y = m.ty;\n let a = m.a, b = m.c, c = m.b, d = m.d;\n for (let v = start, w = offset; w < count; v += 2, w += 2) {\n let vx = vertices[v], vy = vertices[v + 1];\n worldVertices[w] = vx * a + vy * b + x;\n worldVertices[w + 1] = vx * c + vy * d + y;\n }\n return;\n }\n let v = 0, skip = 0;\n for (let i = 0; i < start; i += 2) {\n let n = bones[v];\n v += n + 1;\n skip += n;\n }\n let skeletonBones = skeleton.bones;\n if (deformArray.length == 0) {\n for (let w = offset, b = skip * 3; w < count; w += 2) {\n let wx = 0, wy = 0;\n let n = bones[v++];\n n += v;\n for (; v < n; v++, b += 3) {\n let bone = skeletonBones[bones[v]];\n let m = bone.matrix;\n let vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\n }\n worldVertices[w] = wx;\n worldVertices[w + 1] = wy;\n }\n } else {\n let deform = deformArray;\n for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += 2) {\n let wx = 0, wy = 0;\n let n = bones[v++];\n n += v;\n for (; v < n; v++, b += 3, f += 2) {\n let bone = skeletonBones[bones[v]];\n let m = bone.matrix;\n let vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\n }\n worldVertices[w] = wx;\n worldVertices[w + 1] = wy;\n }\n }\n }\n\n /** Returns true if a deform originally applied to the specified attachment should be applied to this attachment. */\n applyDeform (sourceAttachment: VertexAttachment) {\n return this == sourceAttachment;\n }\n}\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum AttachmentType {\r\n Region, BoundingBox, Mesh, LinkedMesh, Path\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class BoundingBoxAttachment extends VertexAttachment {\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor(name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\nimport {TextureRegion} from \"../Texture\";\nimport {Color, Utils, ArrayLike} from \"../Utils\";\nimport {Slot} from \"../Slot\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class MeshAttachment extends VertexAttachment {\n region: TextureRegion;\n path: string;\n regionUVs: ArrayLike;\n triangles: Array;\n color = new Color(1, 1, 1, 1);\n hullLength: number;\n private parentMesh: MeshAttachment;\n inheritDeform = false;\n tempColor = new Color(0, 0, 0, 0);\n\n constructor(name: string) {\n super(name);\n }\n\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\n return [];\n //nothing\n }\n\n updateUVs(region: TextureRegion, uvs: ArrayLike): ArrayLike {\n let regionUVs = this.regionUVs;\n let n = regionUVs.length;\n if (!uvs || uvs.length != n) {\n uvs = Utils.newFloatArray(n);\n }\n\n if (region == null) {\n return;\n }\n\n let texture = region.texture;\n let r = texture._uvs;\n let w1 = region.width, h1 = region.height, w2 = region.originalWidth, h2 = region.originalHeight;\n let x = region.offsetX, y = region.pixiOffsetY;\n\n for (let i = 0; i < n; i += 2) {\n let u = this.regionUVs[i], v = this.regionUVs[i + 1];\n u = (u * w2 - x) / w1;\n v = (v * h2 - y) / h1;\n uvs[i] = (r.x0 * (1 - u) + r.x1 * u) * (1 - v) + (r.x3 * (1 - u) + r.x2 * u) * v;\n uvs[i + 1] = (r.y0 * (1 - u) + r.y1 * u) * (1 - v) + (r.y3 * (1 - u) + r.y2 * u) * v;\n }\n\n return uvs;\n }\n\n applyDeform(sourceAttachment: VertexAttachment): boolean {\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\n }\n\n getParentMesh() {\n return this.parentMesh;\n }\n\n /** @param parentMesh May be null. */\n setParentMesh(parentMesh: MeshAttachment) {\n this.parentMesh = parentMesh;\n if (parentMesh != null) {\n this.bones = parentMesh.bones;\n this.vertices = parentMesh.vertices;\n this.regionUVs = parentMesh.regionUVs;\n this.triangles = parentMesh.triangles;\n this.hullLength = parentMesh.hullLength;\n }\n }\n}\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathAttachment extends VertexAttachment {\r\n lengths: Array;\r\n closed = false; constantSpeed = false;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor (name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {Attachment} from \"./Attachment\";\r\nimport {Color, Utils} from \"../Utils\";\r\nimport {TextureRegion} from \"../Texture\";\r\nimport {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class RegionAttachment extends Attachment {\r\n x = 0; y = 0; scaleX = 1; scaleY = 1; rotation = 0; width = 0; height = 0;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n path: string;\r\n region: TextureRegion;\r\n\r\n constructor (name:string) {\r\n super(name);\r\n }\r\n\r\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\r\n return [];\r\n //nothing\r\n }\r\n}\r\n","export {Attachment, VertexAttachment} from \"./Attachment\";\r\nexport {AttachmentLoader} from \"./AttachmentLoader\";\r\nexport {AttachmentType} from \"./AttachmentType\";\r\nexport {BoundingBoxAttachment} from \"./BoundingBoxAttachment\";\r\nexport {MeshAttachment} from \"./MeshAttachment\";\r\nexport {PathAttachment} from \"./PathAttachment\";\r\nexport {RegionAttachment} from \"./RegionAttachment\";\r\n","export * from \"./attachments\";\n\nexport {\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\n Animation, CurveTimeline\n} from \"./Animation\";\nexport {AnimationState} from \"./AnimationState\";\nexport {AnimationStateData} from \"./AnimationStateData\";\nexport {BlendMode} from \"./BlendMode\";\nexport {Bone} from \"./Bone\";\nexport {BoneData, TransformMode} from \"./BoneData\";\nexport {Constraint} from \"./Constraint\";\nexport {Event} from \"./Event\";\nexport {EventData} from \"./EventData\";\nexport {IkConstraint} from \"./IkConstraint\";\nexport {IkConstraintData} from \"./IkConstraintData\";\nexport {PathConstraint} from \"./PathConstraint\";\nexport {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\nexport {Skeleton} from \"./Skeleton\";\nexport {SkeletonBounds} from \"./SkeletonBounds\";\nexport {SkeletonData} from \"./SkeletonData\";\nexport {SkeletonJson} from \"./SkeletonJson\";\nexport {Skin} from \"./Skin\";\nexport {Slot} from \"./Slot\";\nexport {SlotData} from \"./SlotData\";\nexport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\nexport {TextureAtlas, TextureAtlasRegion} from \"./TextureAtlas\";\nexport {AtlasAttachmentLoader} from \"./AtlasAttachmentLoader\";\nexport {TransformConstraint} from \"./TransformConstraint\";\nexport {TransformConstraintData} from \"./TransformConstraintData\";\nexport {Updatable} from \"./Updatable\";\nexport {Disposable, Map, Utils, Pool, MathUtils, Color, Vector2} from \"./Utils\";\n","import * as spine from \"./core\";\n\nexport function atlasParser() {\n return function (resource: PIXI.loaders.Resource, next: () => any) {\n // skip if no data, its not json, or it isn't atlas data\n if (!resource.data || !resource.isJson || !resource.data.bones) {\n return next();\n }\n\n var metadataAtlas = resource.metadata ? resource.metadata.spineAtlas: null;\n if (metadataAtlas === false) {\n return next();\n }\n if (metadataAtlas && metadataAtlas.pages) {\n //its an atlas!\n var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(metadataAtlas));\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\n\n resource.spineData = skeletonData;\n resource.spineAtlas = metadataAtlas;\n\n return next();\n }\n\n var metadataAtlasSuffix = '.atlas';\n if (resource.metadata && resource.metadata.spineAtlasSuffix) {\n metadataAtlasSuffix = resource.metadata.spineAtlasSuffix;\n }\n\n /**\n * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files\n * that correspond to the spine file are in the same base URL and that the .json and .atlas files\n * have the same name\n */\n var atlasPath = resource.url.substr(0, resource.url.lastIndexOf('.')) + metadataAtlasSuffix;\n //remove the baseUrl\n atlasPath = atlasPath.replace(this.baseUrl, '');\n\n var atlasOptions = {\n crossOrigin: resource.crossOrigin,\n xhrType: PIXI.loaders.Resource.XHR_RESPONSE_TYPE.TEXT,\n metadata: resource.metadata ? resource.metadata.spineMetadata : null\n };\n var imageOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata ? resource.metadata.imageMetadata: null\n };\n var baseUrl = resource.url.substr(0, resource.url.lastIndexOf('/') + 1);\n //remove the baseUrl\n baseUrl = baseUrl.replace(this.baseUrl, '');\n\n var adapter = imageLoaderAdapter(this, resource.name + '_atlas_page_', baseUrl, imageOptions);\n\n this.add(resource.name + '_atlas', atlasPath, atlasOptions, function () {\n new spine.TextureAtlas(this.xhr.responseText, adapter, function(spineAtlas) {\n var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(spineAtlas));\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\n\n resource.spineData = skeletonData;\n resource.spineAtlas = spineAtlas;\n\n next();\n });\n });\n };\n}\n\nexport function imageLoaderAdapter(loader: any, namePrefix: any, baseUrl: any, imageOptions: any) {\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\n {\n baseUrl += '/';\n }\n return function(line: String, callback: (baseTexture: PIXI.BaseTexture) => any) {\n var name = namePrefix + line;\n var url = baseUrl + line;\n loader.add(name, url, imageOptions, (resource: PIXI.loaders.Resource) => {\n callback(resource.texture.baseTexture);\n });\n }\n}\n\nexport function syncImageLoaderAdapter (baseUrl: any, crossOrigin: any) {\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\n {\n baseUrl += '/';\n }\n return function(line: any, callback: any) {\n callback(PIXI.BaseTexture.fromImage(line, crossOrigin));\n }\n}\n\nPIXI.loaders.Loader.addPixiMiddleware(atlasParser);\nPIXI.loader.use(atlasParser());\n","import * as core from \"./core\";\r\nimport * as loaders from \"./loaders\";\r\n\r\nexport {core, loaders}\r\nexport {Spine, SpineMesh, SpineSprite} from \"./Spine\";\r\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/bin/pixi-spine.min.js b/bin/pixi-spine.min.js index 390add2d..3cda40cb 100644 --- a/bin/pixi-spine.min.js +++ b/bin/pixi-spine.min.js @@ -1,11 +1,12 @@ /*! - * pixi-spine - v1.1.3 - * Compiled Fri Oct 07 2016 01:10:36 GMT+0300 (RTZ 2 (зима)) + * pixi-spine - v1.2.0 + * Compiled Wed Oct 19 2016 21:50:03 GMT+0300 (RTZ 2 (зима)) * * pixi-spine is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.PIXI||(e.PIXI={})).spine=t()}}(function(){return function t(e,n,r){function a(o,s){if(!n[o]){if(!e[o]){var h="function"==typeof require&&require;if(!s&&h)return h(o,!0);if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[o]={exports:{}};e[o][0].call(u.exports,function(t){var n=e[o][1][t];return a(n?n:t)},u,u.exports,t,e,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o0&&(e%=this.duration));for(var i=this.timelines,o=0,s=i.length;o0&&(e%=this.duration));for(var o=this.timelines,s=0,h=o.length;s>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();n.Animation=o;var s=function(){function t(e){if(e<=0)throw new Error("frameCount must be > 0: "+e);this.curves=a.Utils.newFloatArray((e-1)*t.BEZIER_SIZE)}return t.prototype.getFrameCount=function(){return this.curves.length/t.BEZIER_SIZE+1},t.prototype.setLinear=function(e){this.curves[e*t.BEZIER_SIZE]=t.LINEAR},t.prototype.setStepped=function(e){this.curves[e*t.BEZIER_SIZE]=t.STEPPED},t.prototype.getCurveType=function(e){var n=e*t.BEZIER_SIZE;if(n==this.curves.length)return t.LINEAR;var r=this.curves[n];return r==t.LINEAR?t.LINEAR:r==t.STEPPED?t.STEPPED:t.BEZIER},t.prototype.setCurve=function(e,n,r,a,i){var o=.03*(2*-n+a),s=.03*(2*-r+i),h=.006*(3*(n-a)+1),l=.006*(3*(r-i)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,p=.3*r+s+.16666667*l,m=e*t.BEZIER_SIZE,d=this.curves;d[m++]=t.BEZIER;for(var g=f,v=p,y=m+t.BEZIER_SIZE-1;m=n){var u=void 0,c=void 0;return i==h?(u=0,c=0):(u=r[i-2],c=r[i-1]),c+(r[i+1]-c)*(n-u)/(s-u)}var f=r[i-1];return f+(1-f)*(n-s)/(1-s)},t.LINEAR=0,t.STEPPED=1,t.BEZIER=2,t.BEZIER_SIZE=19,t}();n.CurveTimeline=s;var h=function(t){function e(e){t.call(this,e),this.frames=a.Utils.newFloatArray(e<<1)}return r(e,t),e.prototype.setFrame=function(t,n,r){t<<=1,this.frames[t]=n,this.frames[t+e.ROTATION]=r},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){for(var l=h.data.rotation+s[s.length+e.PREV_ROTATION]-h.rotation;l>180;)l-=360;for(;l<-180;)l+=360;return void(h.rotation+=l*i)}for(var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_ROTATION],f=s[u],p=this.getCurvePercent((u>>1)-1,1-(r-f)/(s[u+e.PREV_TIME]-f)),m=s[u+e.ROTATION]-c;m>180;)m-=360;for(;m<-180;)m+=360;for(m=h.data.rotation+(c+m*p)-h.rotation;m>180;)m-=360;for(;m<-180;)m+=360;h.rotation+=m*i}},e.ENTRIES=2,e.PREV_TIME=-2,e.PREV_ROTATION=-1,e.ROTATION=1,e}(s);n.RotateTimeline=h;var l=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.X]=r,this.frames[t+e.Y]=a},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES])return h.x+=(h.data.x+s[s.length+e.PREV_X]-h.x)*i,void(h.y+=(h.data.y+s[s.length+e.PREV_Y]-h.y)*i);var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_X],c=s[l+e.PREV_Y],f=s[l],p=this.getCurvePercent(l/e.ENTRIES-1,1-(r-f)/(s[l+e.PREV_TIME]-f));h.x+=(h.data.x+u+(s[l+e.X]-u)*p-h.x)*i,h.y+=(h.data.y+c+(s[l+e.Y]-c)*p-h.y)*i}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_X=-2,e.PREV_Y=-1,e.X=1,e.Y=2,e}(s);n.TranslateTimeline=l;var u=function(t){function e(e){t.call(this,e)}return r(e,t),e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES])return h.scaleX+=(h.data.scaleX*s[s.length+e.PREV_X]-h.scaleX)*i,void(h.scaleY+=(h.data.scaleY*s[s.length+e.PREV_Y]-h.scaleY)*i);var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_X],c=s[l+e.PREV_Y],f=s[l],p=this.getCurvePercent(l/e.ENTRIES-1,1-(r-f)/(s[l+e.PREV_TIME]-f));h.scaleX+=(h.data.scaleX*(u+(s[l+e.X]-u)*p)-h.scaleX)*i,h.scaleY+=(h.data.scaleY*(c+(s[l+e.Y]-c)*p)-h.scaleY)*i}},e}(l);n.ScaleTimeline=u;var c=function(t){function e(e){t.call(this,e)}return r(e,t),e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES])return h.shearX+=(h.data.shearX+s[s.length+e.PREV_X]-h.shearX)*i,void(h.shearY+=(h.data.shearY+s[s.length+e.PREV_Y]-h.shearY)*i);var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_X],c=s[l+e.PREV_Y],f=s[l],p=this.getCurvePercent(l/e.ENTRIES-1,1-(r-f)/(s[l+e.PREV_TIME]-f));h.shearX+=(h.data.shearX+(u+(s[l+e.X]-u)*p)-h.shearX)*i,h.shearY+=(h.data.shearY+(c+(s[l+e.Y]-c)*p)-h.shearY)*i}},e}(l);n.ShearTimeline=c;var f=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a,i,o){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.R]=r,this.frames[t+e.G]=a,this.frames[t+e.B]=i,this.frames[t+e.A]=o},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var f=s.length;h=s[f+e.PREV_R],l=s[f+e.PREV_G],u=s[f+e.PREV_B],c=s[f+e.PREV_A]}else{var p=o.binarySearch(s,r,e.ENTRIES);h=s[p+e.PREV_R],l=s[p+e.PREV_G],u=s[p+e.PREV_B],c=s[p+e.PREV_A];var m=s[p],d=this.getCurvePercent(p/e.ENTRIES-1,1-(r-m)/(s[p+e.PREV_TIME]-m));h+=(s[p+e.R]-h)*d,l+=(s[p+e.G]-l)*d,u+=(s[p+e.B]-u)*d,c+=(s[p+e.A]-c)*d}var g=t.slots[this.slotIndex].color;i<1?g.add((h-g.r)*i,(l-g.g)*i,(u-g.b)*i,(c-g.a)*i):g.set(h,l,u,c)}},e.ENTRIES=5,e.PREV_TIME=-5,e.PREV_R=-4,e.PREV_G=-3,e.PREV_B=-2,e.PREV_A=-1,e.R=1,e.G=2,e.B=3,e.A=4,e}(s);n.ColorTimeline=f;var p=function(){function t(t){this.frames=a.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}return t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},t.prototype.apply=function(t,e,n,r,a){var i=this.frames;if(!(n=i[i.length-1]?i.length-1:o.binarySearch(i,n,1)-1;var h=this.attachmentNames[s];t.slots[this.slotIndex].setAttachment(null==h?null:t.getAttachment(this.slotIndex,h))}},t}();n.AttachmentTimeline=p;var m=function(){function t(t){this.frames=a.Utils.newFloatArray(t),this.events=new Array(t)}return t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},t.prototype.apply=function(t,e,n,r,a){if(null!=r){var i=this.frames,s=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,a),e=-1;else if(e>=i[s-1])return;if(!(n0&&i[h-1]==l;)h--}for(;h=i[h];h++)r.push(this.events[h])}}},t}();n.EventTimeline=m;var d=function(){function t(t){this.frames=a.Utils.newFloatArray(t),this.drawOrders=new Array(t)}return t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},t.prototype.apply=function(t,e,n,r,i){var s=this.frames;if(!(n=s[s.length-1]?s.length-1:o.binarySearch(s,n)-1;var l=t.drawOrder,u=t.slots,c=this.drawOrders[h];if(null==c)a.Utils.arrayCopy(u,0,l,0,u.length);else for(var f=0,p=c.length;f=u[u.length-1]){var d=c[u.length-1];if(s<1)for(var g=0;g=s[s.length-e.ENTRIES])return h.mix+=(s[s.length+e.PREV_MIX]-h.mix)*i,void(h.bendDirection=Math.floor(s[s.length+e.PREV_BEND_DIRECTION]));var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_MIX],c=s[l],f=this.getCurvePercent(l/e.ENTRIES-1,1-(r-c)/(s[l+e.PREV_TIME]-c));h.mix+=(u+(s[l+e.MIX]-u)*f-h.mix)*i,h.bendDirection=Math.floor(s[l+e.PREV_BEND_DIRECTION])}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_MIX=-2,e.PREV_BEND_DIRECTION=-1,e.MIX=1,e.BEND_DIRECTION=2,e}(s);n.IkConstraintTimeline=v;var y=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a,i,o){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.ROTATE]=r,this.frames[t+e.TRANSLATE]=a,this.frames[t+e.SCALE]=i,this.frames[t+e.SHEAR]=o},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return h.rotateMix+=(s[l+e.PREV_ROTATE]-h.rotateMix)*i,h.translateMix+=(s[l+e.PREV_TRANSLATE]-h.translateMix)*i,h.scaleMix+=(s[l+e.PREV_SCALE]-h.scaleMix)*i,void(h.shearMix+=(s[l+e.PREV_SHEAR]-h.shearMix)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u],f=this.getCurvePercent(u/e.ENTRIES-1,1-(r-c)/(s[u+e.PREV_TIME]-c)),p=s[u+e.PREV_ROTATE],m=s[u+e.PREV_TRANSLATE],d=s[u+e.PREV_SCALE],g=s[u+e.PREV_SHEAR];h.rotateMix+=(p+(s[u+e.ROTATE]-p)*f-h.rotateMix)*i,h.translateMix+=(m+(s[u+e.TRANSLATE]-m)*f-h.translateMix)*i,h.scaleMix+=(d+(s[u+e.SCALE]-d)*f-h.scaleMix)*i,h.shearMix+=(g+(s[u+e.SHEAR]-g)*f-h.shearMix)*i}},e.ENTRIES=5,e.PREV_TIME=-5,e.PREV_ROTATE=-4,e.PREV_TRANSLATE=-3,e.PREV_SCALE=-2,e.PREV_SHEAR=-1,e.ROTATE=1,e.TRANSLATE=2,e.SCALE=3,e.SHEAR=4,e}(s);n.TransformConstraintTimeline=y;var x=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.VALUE]=r},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return void(h.position+=(s[l+e.PREV_VALUE]-h.position)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_VALUE],f=s[u],p=this.getCurvePercent(u/e.ENTRIES-1,1-(r-f)/(s[u+e.PREV_TIME]-f));h.position+=(c+(s[u+e.VALUE]-c)*p-h.position)*i}},e.ENTRIES=2,e.PREV_TIME=-2,e.PREV_VALUE=-1,e.VALUE=1,e}(s);n.PathConstraintPositionTimeline=x;var E=function(t){function e(e){t.call(this,e)}return r(e,t),e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return void(h.spacing+=(s[l+e.PREV_VALUE]-h.spacing)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_VALUE],f=s[u],p=this.getCurvePercent(u/e.ENTRIES-1,1-(r-f)/(s[u+e.PREV_TIME]-f));h.spacing+=(c+(s[u+e.VALUE]-c)*p-h.spacing)*i}},e}(x);n.PathConstraintSpacingTimeline=E;var w=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.ROTATE]=r,this.frames[t+e.TRANSLATE]=a},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return h.rotateMix+=(s[l+e.PREV_ROTATE]-h.rotateMix)*i,void(h.translateMix+=(s[l+e.PREV_TRANSLATE]-h.translateMix)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_ROTATE],f=s[u+e.PREV_TRANSLATE],p=s[u],m=this.getCurvePercent(u/e.ENTRIES-1,1-(r-p)/(s[u+e.PREV_TIME]-p));h.rotateMix+=(c+(s[u+e.ROTATE]-c)*m-h.rotateMix)*i,h.translateMix+=(f+(s[u+e.TRANSLATE]-f)*m-h.translateMix)*i}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_ROTATE=-2,e.PREV_TRANSLATE=-1,e.ROTATE=1,e.TRANSLATE=2,e}(s);n.PathConstraintMixTimeline=w},{"./Utils":26,"./attachments":33}],3:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t){if(void 0===t&&(t=null),this.tracks=new Array,this.events=new Array,this.timeScale=1,null==t)throw new Error("data cannot be null.");this.data=t}return t.prototype.update=function(t){t*=this.timeScale;for(var e=0;e=0){var i=t*r.timeScale;r.time=a+i,n.time+=t*n.timeScale,this.setCurrent(e,r),r.time-=i,n=r}}else if(!n.loop&&n.lastTime>=n.endTime){this.clearTrack(e);continue}if(n.time+=t*n.timeScale,null!=n.previous){var o=t*n.previous.timeScale;n.previous.time+=o,n.mixTime+=o}}}},t.prototype.apply=function(t){for(var e=this.events,n=0;ns&&(i=s);var l=a.previous;if(null==l)a.animation.mix(t,o,i,h,e,a.mix);else{var u=l.time;!l.loop&&u>l.endTime&&(u=l.endTime),l.animation.apply(t,u,u,l.loop,null);var c=a.mixTime/a.mixDuration*a.mix;c>=1&&(c=1,a.previous=null),a.animation.mix(t,o,i,h,e,c)}for(var f=0,p=e.length;fi%s:o=s){var d=r.MathUtils.toInt(i/s);a.onComplete&&a.onComplete(n,d),this.onComplete&&this.onComplete(n,d)}a.lastTime=a.time}}},t.prototype.clearTracks=function(){for(var t=0,e=this.tracks.length;t=this.tracks.length)){var e=this.tracks[t];null!=e&&(e.onEnd&&e.onEnd(t),this.onEnd&&this.onEnd(t),this.tracks[t]=null,this.freeAll(e))}},t.prototype.freeAll=function(t){for(;null!=t;){var e=t.next;t=e}},t.prototype.expandToIndex=function(t){return t0&&(e.mixTime=0,null!=r&&n.mixTime/n.mixDuration<.5?(e.previous=r,r=n):e.previous=n)}this.tracks[t]=e,e.onStart&&e.onStart(t),this.onStart&&this.onStart(t)},t.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},t.prototype.setAnimationWith=function(t,e,n){var r=this.expandToIndex(t);null!=r&&this.freeAll(r.next);var a=new i;return a.animation=e,a.loop=n,a.endTime=e.duration,this.setCurrent(t,a),a},t.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},t.prototype.hasAnimation=function(t){var e=this.data.skeletonData.findAnimation(t);return null!==e},t.prototype.addAnimationWith=function(t,e,n,r){var a=new i;a.animation=e,a.loop=n,a.endTime=e.duration;var o=this.expandToIndex(t);if(null!=o){for(;null!=o.next;)o=o.next;o.next=a}else this.tracks[t]=a;return r<=0&&(null!=o?r+=o.endTime-this.data.getMix(o.animation,e):r=0),a.delay=r,a},t.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},t.prototype.setAnimationByName=function(e,n,r){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(e,n,r)},t.prototype.addAnimationByName=function(e,n,r,a){t.deprecatedWarning2||(t.deprecatedWarning2=!0,console.warn("Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(e,n,r,a)},t.prototype.hasAnimationByName=function(e){t.deprecatedWarning3||(t.deprecatedWarning3=!0,console.warn("Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on."));var n=this.data.skeletonData.findAnimation(e);return null!==n},t.deprecatedWarning1=!1,t.deprecatedWarning2=!1,t.deprecatedWarning3=!1,t}();n.AnimationState=a;var i=function(){function t(){this.loop=!1,this.delay=0,this.time=0,this.lastTime=-1,this.endTime=0,this.timeScale=1,this.mixTime=0,this.mixDuration=0,this.mix=1}return t.prototype.reset=function(){this.next=null,this.previous=null,this.animation=null,this.timeScale=1,this.lastTime=-1,this.time=0},t.prototype.isComplete=function(){return this.time>=this.endTime},t}();n.TrackEntry=i},{"./Utils":26}],4:[function(t,e,n){"use strict";var r=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var r=this.skeletonData.findAnimation(t);if(null==r)throw new Error("Animation not found: "+t);var a=this.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);this.setMixWith(r,a,n)},t.prototype.setMixByName=function(e,n,r){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(e,n,r)},t.prototype.setMixWith=function(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var r=t.name+e.name;this.animationToMixTime[r]=n},t.prototype.getMix=function(t,e){var n=t.name+e.name,r=this.animationToMixTime[n];return void 0===r?this.defaultMix:r},t.deprecatedWarning1=!1,t}();n.AnimationStateData=r},{}],5:[function(t,e,n){"use strict";!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(n.BlendMode||(n.BlendMode={}));n.BlendMode},{}],6:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t,e,n){if(this.matrix=new PIXI.Matrix,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.appliedRotation=0,this.worldSignX=0,this.worldSignY=0,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return Object.defineProperty(t.prototype,"worldX",{get:function(){return this.matrix.tx},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"worldY",{get:function(){return this.matrix.ty},enumerable:!0,configurable:!0}),t.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransformWith=function(e,n,a,i,o,s,h){this.appliedRotation=a;var l=a+90+h,u=r.MathUtils.cosDeg(a+s)*i,c=r.MathUtils.cosDeg(l)*o,f=r.MathUtils.sinDeg(a+s)*i,p=r.MathUtils.sinDeg(l)*o,m=this.parent,d=this.matrix;if(null==m){var g=this.skeleton;return g.flipX&&(e=-e,u=-u,c=-c),g.flipY!==t.yDown&&(n=-n,f=-f,p=-p),d.a=u,d.c=c,d.b=f,d.d=p,d.tx=e,d.ty=n,this.worldSignX=r.MathUtils.signum(i),void(this.worldSignY=r.MathUtils.signum(o))}var v=m.matrix.a,y=m.matrix.c,x=m.matrix.b,E=m.matrix.d;if(d.tx=v*e+y*n+m.matrix.tx,d.ty=x*e+E*n+m.matrix.ty,this.worldSignX=m.worldSignX*r.MathUtils.signum(i),this.worldSignY=m.worldSignY*r.MathUtils.signum(o),this.data.inheritRotation&&this.data.inheritScale)d.a=v*u+y*f,d.c=v*c+y*p,d.b=x*u+E*f,d.d=x*c+E*p;else{if(this.data.inheritRotation){v=1,y=0,x=0,E=1;do{var w=r.MathUtils.cosDeg(m.appliedRotation),T=r.MathUtils.sinDeg(m.appliedRotation),M=v*w+y*T;if(y=y*w-v*T,v=M,M=x*w+E*T,E=E*w-x*T,x=M,!m.data.inheritRotation)break;m=m.parent}while(null!=m);d.a=v*u+y*f,d.c=v*c+y*p,d.b=x*u+E*f,d.d=x*c+E*p}else if(this.data.inheritScale){v=1,y=0,x=0,E=1;do{var w=r.MathUtils.cosDeg(m.appliedRotation),T=r.MathUtils.sinDeg(m.appliedRotation),b=m.scaleX,S=m.scaleY,A=w*b,I=T*S,R=T*b,P=w*S,M=v*A+y*R;if(y=y*P-v*I,v=M,M=x*A+E*R,E=E*P-x*I,x=M,b>=0&&(T=-T),M=v*w+y*T,y=y*w-v*T,v=M,M=x*w+E*T,E=E*w-x*T,x=M,!m.data.inheritScale)break;m=m.parent}while(null!=m);d.a=v*u+y*f,d.c=v*c+y*p,d.b=x*u+E*f,d.d=x*c+E*p}else d.a=u,d.c=c,d.b=f,d.d=p;this.skeleton.flipX&&(d.a=-d.a,d.c=-d.c),this.skeleton.flipY!==t.yDown&&(d.b=-d.b,d.d=-d.d)}},t.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},t.prototype.getWorldRotationX=function(){return Math.atan2(this.matrix.b,this.matrix.a)*r.MathUtils.radDeg},t.prototype.getWorldRotationY=function(){return Math.atan2(this.matrix.d,this.matrix.c)*r.MathUtils.radDeg},t.prototype.getWorldScaleX=function(){return Math.sqrt(this.matrix.a*this.matrix.a+this.matrix.b*this.matrix.b)*this.worldSignX},t.prototype.getWorldScaleY=function(){return Math.sqrt(this.matrix.c*this.matrix.c+this.matrix.d*this.matrix.d)*this.worldSignY},t.prototype.worldToLocalRotationX=function(){var t=this.parent;if(null==t)return this.rotation;var e=t.matrix,n=e.a,a=e.c,i=e.b,o=e.d,s=this.matrix.a,h=this.matrix.b;return Math.atan2(n*h-i*s,o*s-a*h)*r.MathUtils.radDeg},t.prototype.worldToLocalRotationY=function(){var t=this.parent;if(null==t)return this.rotation;var e=t.matrix,n=e.a,a=e.b,i=e.c,o=e.d,s=this.matrix.c,h=this.matrix.d;return Math.atan2(n*h-i*s,o*s-a*h)*r.MathUtils.radDeg},t.prototype.rotateWorld=function(t){var e=this.matrix,n=this.matrix.a,a=e.c,i=e.b,o=e.d,s=r.MathUtils.cosDeg(t),h=r.MathUtils.sinDeg(t);e.a=s*n-h*i,e.c=s*a-h*o,e.b=h*n+s*i,e.d=h*a+s*o},t.prototype.updateLocalTransform=function(){var t=this.parent,e=this.matrix;if(null==t){this.x=e.tx,this.y=e.ty,this.rotation=Math.atan2(e.b,e.a)*r.MathUtils.radDeg,this.scaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.scaleY=Math.sqrt(e.c*e.c+e.d*e.d);var n=e.a*e.d-e.b*e.c;return this.shearX=0,void(this.shearY=Math.atan2(e.a*e.c+e.b*e.d,n)*r.MathUtils.radDeg)}var a=t.matrix,i=a.a,o=a.c,s=a.b,h=a.d,l=1/(i*h-o*s),u=e.tx-a.tx,c=e.ty-a.ty;this.x=u*h*l-c*o*l,this.y=c*i*l-u*s*l;var f=l*h,p=l*i,m=l*o,d=l*s,g=f*e.a-m*e.b,v=f*e.c-m*e.d,y=p*e.b-d*e.a,x=p*e.d-d*e.c;if(this.shearX=0,this.scaleX=Math.sqrt(g*g+y*y),this.scaleX>1e-4){var n=g*x-v*y;this.scaleY=n/this.scaleX,this.shearY=Math.atan2(g*v+y*x,n)*r.MathUtils.radDeg,this.rotation=Math.atan2(y,g)*r.MathUtils.radDeg}else this.scaleX=0,this.scaleY=Math.sqrt(v*v+x*x),this.shearY=0,this.rotation=90-Math.atan2(x,v)*r.MathUtils.radDeg;this.appliedRotation=this.rotation},t.prototype.worldToLocal=function(t){var e=this.matrix,n=e.a,r=e.c,a=e.b,i=e.d,o=1/(n*i-r*a),s=t.x-e.tx,h=t.y-e.ty;return t.x=s*i*o-h*r*o,t.y=h*n*o-s*a*o,t},t.prototype.localToWorld=function(t){var e=this.matrix,n=t.x,r=t.y;return t.x=n*e.a+r*e.c+e.tx,t.y=n*e.b+r*e.d+e.ty,t},t.yDown=!1,t}();n.Bone=a},{"./Utils":26}],7:[function(t,e,n){"use strict";var r=function(){function t(t,e,n){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.inheritRotation=!0,this.inheritScale=!0,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}return t}();n.BoneData=r},{}],8:[function(t,e,n){"use strict";var r=function(){function t(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}return t}();n.Event=r},{}],9:[function(t,e,n){"use strict";var r=function(){function t(t){this.name=t}return t}();n.EventData=r},{}],10:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t,e){if(this.mix=1,this.bendDirection=0,this.level=0,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=new Array;for(var n=0;n180?c-=360:c<-180&&(c+=360),t.updateWorldTransformWith(t.x,t.y,t.rotation+c*a,t.scaleX,t.scaleY,t.shearX,t.shearY)},t.prototype.apply2=function(t,e,n,a,i,o){if(0==o)return void e.updateWorldTransform();var s=t.x,h=t.y,l=t.scaleX,u=t.scaleY,c=e.scaleX,f=0,p=0,m=0;l<0?(l=-l,f=180,m=-1):(f=0,m=1),u<0&&(u=-u,m=-m),c<0?(c=-c,p=180):p=0;var d=t.matrix,g=e.x,v=0,y=0,x=0,E=d.a,w=d.c,T=d.b,M=d.d,b=Math.abs(l-u)<=1e-4;b?(v=e.y,y=E*g+w*v+d.tx,x=T*g+M*v+d.ty):(v=0,y=E*g+d.tx,x=T*g+d.ty);var S=(t.parent,t.parent.matrix);E=S.a,w=S.c,T=S.b,M=S.d;var A=1/(E*M-w*T),I=n-S.tx,R=a-S.ty,P=(I*M-R*w)*A-s,C=(R*E-I*T)*A-h;I=y-S.tx,R=x-S.ty;var V=(I*M-R*w)*A-s,k=(R*E-I*T)*A-h,N=Math.sqrt(V*V+k*k),D=e.data.length*c,U=0,_=0;t:if(b){D*=l;var X=(P*P+C*C-N*N-D*D)/(2*N*D);X<-1?X=-1:X>1&&(X=1),_=Math.acos(X)*i,E=N+D*X,w=D*Math.sin(_),U=Math.atan2(C*E-P*w,P*E+C*w)}else{E=l*D,w=u*D;var B=E*E,O=w*w,F=P*P+C*C,Y=Math.atan2(C,P);T=O*N*N+B*F-B*O;var L=-2*O*N,W=O-B;if(M=L*L-4*W*T,M>=0){var j=Math.sqrt(M);L<0&&(j=-j),j=-(L+j)/2;var q=j/W,Z=T/j,z=Math.abs(q)$&&(Q=0,$=M,tt=I),I=N-E,M=I*I,M$&&(Q=nt,$=M,tt=I,et=R),F<=(G+$)/2?(U=Y-Math.atan2(K*i,J),_=H*i):(U=Y-Math.atan2(et*i,tt),_=Q*i)}var rt=Math.atan2(v,g)*m,at=t.rotation;U=(U-rt)*r.MathUtils.radDeg+f-at,U>180?U-=360:U<-180&&(U+=360),t.updateWorldTransformWith(s,h,at+U*o,t.scaleX,t.scaleY,0,0),at=e.rotation,_=((_+rt)*r.MathUtils.radDeg-e.shearX)*m+p-at,_>180?_-=360:_<-180&&(_+=360),e.updateWorldTransformWith(g,v,at+_*o,e.scaleX,e.scaleY,e.shearX,e.shearY)},t}();n.IkConstraint=a},{"./Utils":26}],11:[function(t,e,n){"use strict";var r=function(){function t(t){this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t}return t}();n.IkConstraintData=r},{}],12:[function(t,e,n){"use strict";var r=t("./PathConstraintData"),a=t("./attachments"),i=t("./Utils"),o=function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n0,s=e>0;if(o||s){var h=this.data,l=h.spacingMode,u=l==r.SpacingMode.Length,c=h.rotateMode,f=c==r.RotateMode.Tangent,p=c==r.RotateMode.ChainScale,m=this.bones.length,d=f?m:m+1,g=this.bones,v=i.Utils.setArraySize(this.spaces,d),y=null,x=this.spacing;if(p||u){p&&(y=i.Utils.setArraySize(this.lengths,m));for(var E=0,w=d-1;Ei.MathUtils.PI?j-=i.MathUtils.PI2:j<-i.MathUtils.PI&&(j+=i.MathUtils.PI2),j*=e,q=Math.cos(j),Z=Math.sin(j),M.a=q*F-Z*L,M.c=q*Y-Z*W,M.b=Z*F+q*L,M.d=Z*Y+q*W}}}}},t.prototype.computeWorldPositions=function(e,n,r,a,o){var s=this.target,h=this.position,l=this.spaces,u=i.Utils.setArraySize(this.positions,3*n+2),c=null,f=e.closed,p=e.worldVerticesLength,m=p/6,d=t.NONE;if(!e.constantSpeed){var g=e.lengths;m-=f?1:2;var v=g[m];if(a&&(h*=v),o)for(var y=0;yv){d!=t.AFTER&&(d=t.AFTER,e.computeWorldVerticesWith(s,p-6,4,c,0)),this.addAfterPosition(T-v,c,0,u,x);continue}}for(;;E++){var M=g[E];if(!(T>M)){if(0==E)T/=M;else{var b=g[E-1];T=(T-b)/(M-b)}break}}E!=d&&(d=E,f&&E==m?(e.computeWorldVerticesWith(s,p-4,4,c,0),e.computeWorldVerticesWith(s,0,4,c,4)):e.computeWorldVerticesWith(s,6*E+2,8,c,0)),this.addCurvePosition(T,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||y>0&&0==w)}return u}f?(p+=2,c=i.Utils.setArraySize(this.world,p),e.computeWorldVerticesWith(s,2,p-4,c,0),e.computeWorldVerticesWith(s,0,2,c,p-4),c[p-2]=c[0],c[p-1]=c[1]):(m--,p-=4,c=i.Utils.setArraySize(this.world,p),e.computeWorldVerticesWith(s,2,p,c,0));for(var S=i.Utils.setArraySize(this.curves,m),A=0,I=c[0],R=c[1],P=0,C=0,V=0,k=0,N=0,D=0,U=0,_=0,X=0,B=0,O=0,F=0,Y=0,L=0,y=0,W=2;yA){this.addAfterPosition(T-A,c,p-4,u,x);continue}}for(;;E++){var z=S[E];if(!(T>z)){if(0==E)T/=z;else{var b=S[E-1];T=(T-b)/(z-b)}break}}if(E!=d){d=E;var H=6*E;for(I=c[H],R=c[H+1],P=c[H+2],C=c[H+3],V=c[H+4],k=c[H+5],N=c[H+6],D=c[H+7],U=.03*(I-2*P+V),_=.03*(R-2*C+k),X=.006*(3*(P-V)-I+N),B=.006*(3*(C-k)-R+D),O=2*U+X,F=2*_+B,Y=.3*(P-I)+U+.16666667*X,L=.3*(C-R)+_+.16666667*B,q=Math.sqrt(Y*Y+L*L),j[0]=q,H=1;H<8;H++)Y+=O,L+=F,O+=X,F+=B,q+=Math.sqrt(Y*Y+L*L),j[H]=q;Y+=O,L+=F,q+=Math.sqrt(Y*Y+L*L),j[8]=q,Y+=O+X,L+=F+B,q+=Math.sqrt(Y*Y+L*L),j[9]=q,Z=0}for(T*=q;;Z++){var G=j[Z];if(!(T>G)){if(0==Z)T/=G;else{var b=j[Z-1];T=Z+(T-b)/(G-b)}break}}this.addCurvePosition(.1*T,I,R,P,C,V,k,N,D,u,x,r||y>0&&0==w)}return u},t.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],o=e[n+1],s=e[n+2]-i,h=e[n+3]-o,l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},t.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],o=e[n+3],s=i-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},t.prototype.addCurvePosition=function(t,e,n,r,a,i,o,s,h,l,u,c){0==t&&(t=1e-4);var f=t*t,p=f*t,m=1-t,d=m*m,g=d*m,v=m*t,y=3*v,x=m*y,E=y*t,w=e*g+r*x+i*E+s*p,T=n*g+a*x+o*E+h*p;l[u]=w,l[u+1]=T,c&&(l[u+2]=Math.atan2(T-(n*d+a*v*2+o*f),w-(e*d+r*v*2+i*f)))},t.NONE=-1,t.BEFORE=-2,t.AFTER=-3,t}();n.PathConstraint=o},{"./PathConstraintData":13,"./Utils":26,"./attachments":33}],13:[function(t,e,n){"use strict";var r=function(){function t(t){this.bones=new Array,this.name=t}return t}();n.PathConstraintData=r,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(n.PositionMode||(n.PositionMode={}));n.PositionMode;!function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(n.SpacingMode||(n.SpacingMode={}));n.SpacingMode;!function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(n.RotateMode||(n.RotateMode={}));n.RotateMode},{}],14:[function(t,e,n){"use strict";var r=t("./Slot"),a=t("./Bone"),i=t("./IkConstraint"),o=t("./TransformConstraint"),s=t("./PathConstraint"),h=t("./Utils"),l=t("./attachments"),u=function(){function t(t){if(this._updateCache=new Array,this.time=0,this.flipX=!1,this.flipY=!1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(var e=0;e=0;u--){var c=a[u];if(c.level=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},t.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,o=this.maxX,s=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(a-t)+e;if(l>i&&li&&la&&ua&&ut.minX&&this.minYt.minY},t.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[i]-u)=u&&x<=p||x>=p&&x<=u)&&(x>=e&&x<=r||x>=r&&x<=e)){var E=(l*v-h*d)/y;if((E>=c&&E<=m||E>=m&&E<=c)&&(E>=n&&E<=a||E>=a&&E<=n))return!0}u=p,c=m}return!1},t.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return e==-1?null:this.polygons[e]},t.prototype.getWidth=function(){return this.maxX-this.minX},t.prototype.getHeight=function(){return this.maxY-this.minY},t}();n.SkeletonBounds=i},{"./Utils":26,"./attachments":33}],16:[function(t,e,n){"use strict";var r=function(){function t(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n=0;v--)Z[v]==-1&&(Z[v]=H[--J])}d.setFrame(g++,q.time,Z)}a.push(d),i=Math.max(i,d.frames[d.getFrameCount()-1])}if(t.events){for(var d=new p.EventTimeline(t.events.length),g=0,v=0;v=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}return t}();n.SlotData=a},{"./Utils":26}],21:[function(t,e,n){"use strict";var r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return a.Nearest;case"linear":return a.Linear;case"mipmap":return a.MipMap;case"mipmapnearestnearest":return a.MipMapNearestNearest;case"mipmaplinearnearest":return a.MipMapLinearNearest;case"mipmapnearestlinear":return a.MipMapNearestLinear;case"mipmaplinearlinear":return a.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();n.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(n.TextureFilter||(n.TextureFilter={}));var a=n.TextureFilter;!function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n.TextureWrap||(n.TextureWrap={}));var i=n.TextureWrap,o=function(){function t(){this.size=null}return Object.defineProperty(t.prototype,"width",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.width:t.trim?t.trim.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.height:t.trim?t.trim.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this.texture._uvs.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v",{get:function(){return this.texture._uvs.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u2",{get:function(){return this.texture._uvs.x2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v2",{get:function(){return this.texture._uvs.y2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){var t=this.texture;return t.trim?t.trim.x:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return console.warn("Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on."),this.spineOffsetY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pixiOffsetY",{get:function(){var t=this.texture;return t.trim?t.trim.y:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spineOffsetY",{get:function(){var t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalWidth",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.width:t.crop.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalHeight",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.height:t.crop.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.texture.frame.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.texture.frame.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return 0!==this.texture.rotate},enumerable:!0,configurable:!0}),t}();n.TextureRegion=o},{}],22:[function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=t("./Texture"),i=function(){function t(t,e,n){this.pages=new Array,this.regions=new Array,t&&this.addSpineAtlas(t,e,n)}return t.prototype.addTexture=function(t,e){for(var n=this.pages,r=null,i=0;i=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(e==-1)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(n==-1)throw new Error("Invalid line: "+e);for(var r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(i==-1)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),s=function(){function t(){}return t.prototype.setFilters=function(){var t=this.baseTexture,e=this.minFilter;e==a.TextureFilter.Linear?t.scaleMode=PIXI.SCALE_MODES.LINEAR:this.minFilter==a.TextureFilter.Nearest?t.scaleMode=PIXI.SCALE_MODES.NEAREST:(t.mipmap=!0,e==a.TextureFilter.MipMapNearestNearest?t.scaleMode=PIXI.SCALE_MODES.NEAREST:t.scaleMode=PIXI.SCALE_MODES.LINEAR)},t}();n.TextureAtlasPage=s;var h=function(t){function e(){t.apply(this,arguments)}return r(e,t),e}(a.TextureRegion);n.TextureAtlasRegion=h},{"./Texture":21}],23:[function(t,e,n){"use strict";var r=t("./attachments"),a=function(){function t(t){this.atlas=t}return t.prototype.newRegionAttachment=function(t,e,n){var a=this.atlas.findRegion(n);if(null==a)throw new Error("Region not found in atlas: "+n+" (region attachment: "+e+")");var i=new r.RegionAttachment(e);return i.region=a,i},t.prototype.newMeshAttachment=function(t,e,n){var a=this.atlas.findRegion(n);if(null==a)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+e+")");var i=new r.MeshAttachment(e);return i.region=a,i},t.prototype.newBoundingBoxAttachment=function(t,e){return new r.BoundingBoxAttachment(e)},t.prototype.newPathAttachment=function(t,e){return new r.PathAttachment(e)},t}();n.TextureAtlasAttachmentLoader=a},{"./attachments":33}],24:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new r.Vector2,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var n=0;n0){var g=d.a,v=d.c,y=d.b,x=d.d,E=Math.atan2(l,s)-Math.atan2(y,g)+this.data.offsetRotation*r.MathUtils.degRad;E>r.MathUtils.PI?E-=r.MathUtils.PI2:E<-r.MathUtils.PI&&(E+=r.MathUtils.PI2),E*=t;var w=Math.cos(E),T=Math.sin(E);d.a=w*g-T*y,d.c=w*v-T*x,d.b=T*g+w*y,d.d=T*v+w*x}if(e>0){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),d.tx+=(M.x-m.worldX)*e,d.ty+=(M.y-m.worldY)*e}if(n>0){var b=Math.sqrt(d.a*d.a+d.b*d.b),S=Math.sqrt(s*s+l*l),A=b>1e-5?(b+(S-b+this.data.offsetScaleX)*n)/b:0;d.a*=A,d.b*=A,b=Math.sqrt(d.c*d.c+d.d*d.d),S=Math.sqrt(h*h+u*u),A=b>1e-5?(b+(S-b+this.data.offsetScaleY)*n)/b:0,d.c*=A,d.d*=A}if(a>0){var v=d.c,x=d.d,I=Math.atan2(x,v),E=Math.atan2(u,h)-Math.atan2(l,s)-(I-Math.atan2(d.b,d.a));E>r.MathUtils.PI?E-=r.MathUtils.PI2:E<-r.MathUtils.PI&&(E+=r.MathUtils.PI2),E=I+(E+this.data.offsetShearY*r.MathUtils.degRad)*a;var A=Math.sqrt(v*v+x*x);d.c=Math.cos(E)*A,d.d=Math.sin(E)*A}}},t}();n.TransformConstraint=a},{"./Utils":26}],25:[function(t,e,n){"use strict";var r=function(){function t(t){if(this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,null==t)throw new Error("name cannot be null.");this.name=t}return t}();n.TransformConstraintData=r},{}],26:[function(t,e,n){"use strict";var r=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();n.Color=r;var a=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>=0?1:-1},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();n.MathUtils=a;var i=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,o=r;i0?this.items.pop():this.instantiator()},t.prototype.free=function(t){this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();n.TimeKeeper=l},{}],27:[function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(){function t(t){if(null==t)throw new Error("name cannot be null.");this.name=t}return t}();n.Attachment=a;var i=function(t){function e(e){t.call(this,e),this.worldVerticesLength=0}return r(e,t),e.prototype.computeWorldVertices=function(t,e){this.computeWorldVerticesWith(t,0,this.worldVerticesLength,e,0)},e.prototype.computeWorldVerticesWith=function(t,e,n,r,a){n+=a;var i=t.bone.skeleton,o=i.x,s=i.y,h=t.attachmentVertices,l=this.vertices,u=this.bones;if(null!=u){for(var c=0,f=0,p=0;p0&&(l=h);var E=t.bone,w=E.matrix;o+=w.tx,s+=w.ty;for(var I=w.a,v=w.c,R=w.b,P=w.d,C=e,g=a;g0&&(e%=this.duration));for(var i=this.timelines,o=0,s=i.length;o0&&(e%=this.duration));for(var o=this.timelines,s=0,h=o.length;s>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();n.Animation=o;var s=function(){function t(e){if(e<=0)throw new Error("frameCount must be > 0: "+e);this.curves=a.Utils.newFloatArray((e-1)*t.BEZIER_SIZE)}return t.prototype.getFrameCount=function(){return this.curves.length/t.BEZIER_SIZE+1},t.prototype.setLinear=function(e){this.curves[e*t.BEZIER_SIZE]=t.LINEAR},t.prototype.setStepped=function(e){this.curves[e*t.BEZIER_SIZE]=t.STEPPED},t.prototype.getCurveType=function(e){var n=e*t.BEZIER_SIZE;if(n==this.curves.length)return t.LINEAR;var r=this.curves[n];return r==t.LINEAR?t.LINEAR:r==t.STEPPED?t.STEPPED:t.BEZIER},t.prototype.setCurve=function(e,n,r,a,i){var o=.03*(2*-n+a),s=.03*(2*-r+i),h=.006*(3*(n-a)+1),l=.006*(3*(r-i)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,p=.3*r+s+.16666667*l,d=e*t.BEZIER_SIZE,m=this.curves;m[d++]=t.BEZIER;for(var g=f,v=p,y=d+t.BEZIER_SIZE-1;d=n){var u=void 0,c=void 0;return i==h?(u=0,c=0):(u=r[i-2],c=r[i-1]),c+(r[i+1]-c)*(n-u)/(s-u)}var f=r[i-1];return f+(1-f)*(n-s)/(1-s)},t.LINEAR=0,t.STEPPED=1,t.BEZIER=2,t.BEZIER_SIZE=19,t}();n.CurveTimeline=s;var h=function(t){function e(e){t.call(this,e),this.frames=a.Utils.newFloatArray(e<<1)}return r(e,t),e.prototype.setFrame=function(t,n,r){t<<=1,this.frames[t]=n,this.frames[t+e.ROTATION]=r},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){for(var l=h.data.rotation+s[s.length+e.PREV_ROTATION]-h.rotation;l>180;)l-=360;for(;l<-180;)l+=360;return void(h.rotation+=l*i)}for(var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_ROTATION],f=s[u],p=this.getCurvePercent((u>>1)-1,1-(r-f)/(s[u+e.PREV_TIME]-f)),d=s[u+e.ROTATION]-c;d>180;)d-=360;for(;d<-180;)d+=360;for(d=h.data.rotation+(c+d*p)-h.rotation;d>180;)d-=360;for(;d<-180;)d+=360;h.rotation+=d*i}},e.ENTRIES=2,e.PREV_TIME=-2,e.PREV_ROTATION=-1,e.ROTATION=1,e}(s);n.RotateTimeline=h;var l=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.X]=r,this.frames[t+e.Y]=a},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES])return h.x+=(h.data.x+s[s.length+e.PREV_X]-h.x)*i,void(h.y+=(h.data.y+s[s.length+e.PREV_Y]-h.y)*i);var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_X],c=s[l+e.PREV_Y],f=s[l],p=this.getCurvePercent(l/e.ENTRIES-1,1-(r-f)/(s[l+e.PREV_TIME]-f));h.x+=(h.data.x+u+(s[l+e.X]-u)*p-h.x)*i,h.y+=(h.data.y+c+(s[l+e.Y]-c)*p-h.y)*i}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_X=-2,e.PREV_Y=-1,e.X=1,e.Y=2,e}(s);n.TranslateTimeline=l;var u=function(t){function e(e){t.call(this,e)}return r(e,t),e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES])return h.scaleX+=(h.data.scaleX*s[s.length+e.PREV_X]-h.scaleX)*i,void(h.scaleY+=(h.data.scaleY*s[s.length+e.PREV_Y]-h.scaleY)*i);var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_X],c=s[l+e.PREV_Y],f=s[l],p=this.getCurvePercent(l/e.ENTRIES-1,1-(r-f)/(s[l+e.PREV_TIME]-f));h.scaleX+=(h.data.scaleX*(u+(s[l+e.X]-u)*p)-h.scaleX)*i,h.scaleY+=(h.data.scaleY*(c+(s[l+e.Y]-c)*p)-h.scaleY)*i}},e}(l);n.ScaleTimeline=u;var c=function(t){function e(e){t.call(this,e)}return r(e,t),e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES])return h.shearX+=(h.data.shearX+s[s.length+e.PREV_X]-h.shearX)*i,void(h.shearY+=(h.data.shearY+s[s.length+e.PREV_Y]-h.shearY)*i);var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_X],c=s[l+e.PREV_Y],f=s[l],p=this.getCurvePercent(l/e.ENTRIES-1,1-(r-f)/(s[l+e.PREV_TIME]-f));h.shearX+=(h.data.shearX+(u+(s[l+e.X]-u)*p)-h.shearX)*i,h.shearY+=(h.data.shearY+(c+(s[l+e.Y]-c)*p)-h.shearY)*i}},e}(l);n.ShearTimeline=c;var f=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a,i,o){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.R]=r,this.frames[t+e.G]=a,this.frames[t+e.B]=i,this.frames[t+e.A]=o},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var f=s.length;h=s[f+e.PREV_R],l=s[f+e.PREV_G],u=s[f+e.PREV_B],c=s[f+e.PREV_A]}else{var p=o.binarySearch(s,r,e.ENTRIES);h=s[p+e.PREV_R],l=s[p+e.PREV_G],u=s[p+e.PREV_B],c=s[p+e.PREV_A];var d=s[p],m=this.getCurvePercent(p/e.ENTRIES-1,1-(r-d)/(s[p+e.PREV_TIME]-d));h+=(s[p+e.R]-h)*m,l+=(s[p+e.G]-l)*m,u+=(s[p+e.B]-u)*m,c+=(s[p+e.A]-c)*m}var g=t.slots[this.slotIndex].color;i<1?g.add((h-g.r)*i,(l-g.g)*i,(u-g.b)*i,(c-g.a)*i):g.set(h,l,u,c)}},e.ENTRIES=5,e.PREV_TIME=-5,e.PREV_R=-4,e.PREV_G=-3,e.PREV_B=-2,e.PREV_A=-1,e.R=1,e.G=2,e.B=3,e.A=4,e}(s);n.ColorTimeline=f;var p=function(){function t(t){this.frames=a.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}return t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},t.prototype.apply=function(t,e,n,r,a){var i=this.frames;if(!(n=i[i.length-1]?i.length-1:o.binarySearch(i,n,1)-1;var h=this.attachmentNames[s];t.slots[this.slotIndex].setAttachment(null==h?null:t.getAttachment(this.slotIndex,h))}},t}();n.AttachmentTimeline=p;var d=function(){function t(t){this.frames=a.Utils.newFloatArray(t),this.events=new Array(t)}return t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},t.prototype.apply=function(t,e,n,r,a){if(null!=r){var i=this.frames,s=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,a),e=-1;else if(e>=i[s-1])return;if(!(n0&&i[h-1]==l;)h--}for(;h=i[h];h++)r.push(this.events[h])}}},t}();n.EventTimeline=d;var m=function(){function t(t){this.frames=a.Utils.newFloatArray(t),this.drawOrders=new Array(t)}return t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},t.prototype.apply=function(t,e,n,r,i){var s=this.frames;if(!(n=s[s.length-1]?s.length-1:o.binarySearch(s,n)-1;var l=t.drawOrder,u=t.slots,c=this.drawOrders[h];if(null==c)a.Utils.arrayCopy(u,0,l,0,u.length);else for(var f=0,p=c.length;f=u[u.length-1]){var m=c[u.length-1];if(s<1)for(var g=0;g=s[s.length-e.ENTRIES])return h.mix+=(s[s.length+e.PREV_MIX]-h.mix)*i,void(h.bendDirection=Math.floor(s[s.length+e.PREV_BEND_DIRECTION]));var l=o.binarySearch(s,r,e.ENTRIES),u=s[l+e.PREV_MIX],c=s[l],f=this.getCurvePercent(l/e.ENTRIES-1,1-(r-c)/(s[l+e.PREV_TIME]-c));h.mix+=(u+(s[l+e.MIX]-u)*f-h.mix)*i,h.bendDirection=Math.floor(s[l+e.PREV_BEND_DIRECTION])}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_MIX=-2,e.PREV_BEND_DIRECTION=-1,e.MIX=1,e.BEND_DIRECTION=2,e}(s);n.IkConstraintTimeline=v;var y=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a,i,o){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.ROTATE]=r,this.frames[t+e.TRANSLATE]=a,this.frames[t+e.SCALE]=i,this.frames[t+e.SHEAR]=o},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return h.rotateMix+=(s[l+e.PREV_ROTATE]-h.rotateMix)*i,h.translateMix+=(s[l+e.PREV_TRANSLATE]-h.translateMix)*i,h.scaleMix+=(s[l+e.PREV_SCALE]-h.scaleMix)*i,void(h.shearMix+=(s[l+e.PREV_SHEAR]-h.shearMix)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u],f=this.getCurvePercent(u/e.ENTRIES-1,1-(r-c)/(s[u+e.PREV_TIME]-c)),p=s[u+e.PREV_ROTATE],d=s[u+e.PREV_TRANSLATE],m=s[u+e.PREV_SCALE],g=s[u+e.PREV_SHEAR];h.rotateMix+=(p+(s[u+e.ROTATE]-p)*f-h.rotateMix)*i,h.translateMix+=(d+(s[u+e.TRANSLATE]-d)*f-h.translateMix)*i,h.scaleMix+=(m+(s[u+e.SCALE]-m)*f-h.scaleMix)*i,h.shearMix+=(g+(s[u+e.SHEAR]-g)*f-h.shearMix)*i}},e.ENTRIES=5,e.PREV_TIME=-5,e.PREV_ROTATE=-4,e.PREV_TRANSLATE=-3,e.PREV_SCALE=-2,e.PREV_SHEAR=-1,e.ROTATE=1,e.TRANSLATE=2,e.SCALE=3,e.SHEAR=4,e}(s);n.TransformConstraintTimeline=y;var x=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.VALUE]=r},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return void(h.position+=(s[l+e.PREV_VALUE]-h.position)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_VALUE],f=s[u],p=this.getCurvePercent(u/e.ENTRIES-1,1-(r-f)/(s[u+e.PREV_TIME]-f));h.position+=(c+(s[u+e.VALUE]-c)*p-h.position)*i}},e.ENTRIES=2,e.PREV_TIME=-2,e.PREV_VALUE=-1,e.VALUE=1,e}(s);n.PathConstraintPositionTimeline=x;var M=function(t){function e(e){t.call(this,e)}return r(e,t),e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return void(h.spacing+=(s[l+e.PREV_VALUE]-h.spacing)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_VALUE],f=s[u],p=this.getCurvePercent(u/e.ENTRIES-1,1-(r-f)/(s[u+e.PREV_TIME]-f));h.spacing+=(c+(s[u+e.VALUE]-c)*p-h.spacing)*i}},e}(x);n.PathConstraintSpacingTimeline=M;var E=function(t){function e(n){t.call(this,n),this.frames=a.Utils.newFloatArray(n*e.ENTRIES)}return r(e,t),e.prototype.setFrame=function(t,n,r,a){t*=e.ENTRIES,this.frames[t]=n,this.frames[t+e.ROTATE]=r,this.frames[t+e.TRANSLATE]=a},e.prototype.apply=function(t,n,r,a,i){var s=this.frames;if(!(r=s[s.length-e.ENTRIES]){var l=s.length;return h.rotateMix+=(s[l+e.PREV_ROTATE]-h.rotateMix)*i,void(h.translateMix+=(s[l+e.PREV_TRANSLATE]-h.translateMix)*i)}var u=o.binarySearch(s,r,e.ENTRIES),c=s[u+e.PREV_ROTATE],f=s[u+e.PREV_TRANSLATE],p=s[u],d=this.getCurvePercent(u/e.ENTRIES-1,1-(r-p)/(s[u+e.PREV_TIME]-p));h.rotateMix+=(c+(s[u+e.ROTATE]-c)*d-h.rotateMix)*i,h.translateMix+=(f+(s[u+e.TRANSLATE]-f)*d-h.translateMix)*i}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_ROTATE=-2,e.PREV_TRANSLATE=-1,e.ROTATE=1,e.TRANSLATE=2,e}(s);n.PathConstraintMixTimeline=E},{"./Utils":26,"./attachments":33}],3:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t){if(void 0===t&&(t=null),this.tracks=new Array,this.events=new Array,this.timeScale=1,null==t)throw new Error("data cannot be null.");this.data=t}return t.prototype.update=function(t){t*=this.timeScale;for(var e=0;e=0){var i=t*r.timeScale;r.time=a+i,n.time+=t*n.timeScale,this.setCurrent(e,r),r.time-=i,n=r}}else if(!n.loop&&n.lastTime>=n.endTime){this.clearTrack(e);continue}if(n.time+=t*n.timeScale,null!=n.previous){var o=t*n.previous.timeScale;n.previous.time+=o,n.mixTime+=o}}}},t.prototype.apply=function(t){for(var e=this.events,n=0;ns&&(i=s);var l=a.previous;if(null==l)a.animation.mix(t,o,i,h,e,a.mix);else{var u=l.time;!l.loop&&u>l.endTime&&(u=l.endTime),l.animation.apply(t,u,u,l.loop,null);var c=a.mixTime/a.mixDuration*a.mix;c>=1&&(c=1,a.previous=null),a.animation.mix(t,o,i,h,e,c)}for(var f=0,p=e.length;fi%s:o=s){var m=r.MathUtils.toInt(i/s);a.onComplete&&a.onComplete(n,m),this.onComplete&&this.onComplete(n,m)}a.lastTime=a.time}}},t.prototype.clearTracks=function(){for(var t=0,e=this.tracks.length;t=this.tracks.length)){var e=this.tracks[t];null!=e&&(e.onEnd&&e.onEnd(t),this.onEnd&&this.onEnd(t),this.tracks[t]=null,this.freeAll(e))}},t.prototype.freeAll=function(t){for(;null!=t;){var e=t.next;t=e}},t.prototype.expandToIndex=function(t){return t0&&(e.mixTime=0,null!=r&&n.mixTime/n.mixDuration<.5?(e.previous=r,r=n):e.previous=n)}this.tracks[t]=e,e.onStart&&e.onStart(t),this.onStart&&this.onStart(t)},t.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},t.prototype.setAnimationWith=function(t,e,n){var r=this.expandToIndex(t);null!=r&&this.freeAll(r.next);var a=new i;return a.animation=e,a.loop=n,a.endTime=e.duration,this.setCurrent(t,a),a},t.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},t.prototype.hasAnimation=function(t){var e=this.data.skeletonData.findAnimation(t);return null!==e},t.prototype.addAnimationWith=function(t,e,n,r){var a=new i;a.animation=e,a.loop=n,a.endTime=e.duration;var o=this.expandToIndex(t);if(null!=o){for(;null!=o.next;)o=o.next;o.next=a}else this.tracks[t]=a;return r<=0&&(null!=o?r+=o.endTime-this.data.getMix(o.animation,e):r=0),a.delay=r,a},t.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},t.prototype.setAnimationByName=function(e,n,r){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(e,n,r)},t.prototype.addAnimationByName=function(e,n,r,a){t.deprecatedWarning2||(t.deprecatedWarning2=!0,console.warn("Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(e,n,r,a)},t.prototype.hasAnimationByName=function(e){t.deprecatedWarning3||(t.deprecatedWarning3=!0,console.warn("Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on."));var n=this.data.skeletonData.findAnimation(e);return null!==n},t.deprecatedWarning1=!1,t.deprecatedWarning2=!1,t.deprecatedWarning3=!1,t}();n.AnimationState=a;var i=function(){function t(){this.loop=!1,this.delay=0,this.time=0,this.lastTime=-1,this.endTime=0,this.timeScale=1,this.mixTime=0,this.mixDuration=0,this.mix=1}return t.prototype.reset=function(){this.next=null,this.previous=null,this.animation=null,this.timeScale=1,this.lastTime=-1,this.time=0},t.prototype.isComplete=function(){return this.time>=this.endTime},t}();n.TrackEntry=i},{"./Utils":26}],4:[function(t,e,n){"use strict";var r=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var r=this.skeletonData.findAnimation(t);if(null==r)throw new Error("Animation not found: "+t);var a=this.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);this.setMixWith(r,a,n)},t.prototype.setMixByName=function(e,n,r){t.deprecatedWarning1||(t.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(e,n,r)},t.prototype.setMixWith=function(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var r=t.name+e.name;this.animationToMixTime[r]=n},t.prototype.getMix=function(t,e){var n=t.name+e.name,r=this.animationToMixTime[n];return void 0===r?this.defaultMix:r},t.deprecatedWarning1=!1,t}();n.AnimationStateData=r},{}],5:[function(t,e,n){"use strict";var r=t("./attachments"),a=function(){function t(t){this.atlas=t}return t.prototype.newRegionAttachment=function(t,e,n){var a=this.atlas.findRegion(n);if(null==a)throw new Error("Region not found in atlas: "+n+" (region attachment: "+e+")");var i=new r.RegionAttachment(e);return i.region=a,i},t.prototype.newMeshAttachment=function(t,e,n){var a=this.atlas.findRegion(n);if(null==a)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+e+")");var i=new r.MeshAttachment(e);return i.region=a,i},t.prototype.newBoundingBoxAttachment=function(t,e){return new r.BoundingBoxAttachment(e)},t.prototype.newPathAttachment=function(t,e){return new r.PathAttachment(e)},t}();n.AtlasAttachmentLoader=a},{"./attachments":33}],6:[function(t,e,n){"use strict";!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(n.BlendMode||(n.BlendMode={}));n.BlendMode},{}],7:[function(t,e,n){"use strict";var r=t("./BoneData"),a=t("./Utils"),i=function(){function t(t,e,n){if(this.matrix=new PIXI.Matrix,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return Object.defineProperty(t.prototype,"worldX",{get:function(){return this.matrix.tx},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"worldY",{get:function(){return this.matrix.ty},enumerable:!0,configurable:!0}),t.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransformWith=function(e,n,i,o,s,h,l){this.ax=e,this.ay=n,this.arotation=i,this.ascaleX=o,this.ascaleY=s,this.ashearX=h,this.ashearY=l,this.appliedValid=!0;var u=this.parent,c=this.matrix;if(null==u){var f=i+90+l,p=a.MathUtils.cosDeg(i+h)*o,d=a.MathUtils.cosDeg(f)*s,m=a.MathUtils.sinDeg(i+h)*o,g=a.MathUtils.sinDeg(f)*s,v=this.skeleton;return v.flipX&&(e=-e,p=-p,d=-d),v.flipY!==t.yDown&&(n=-n,m=-m,g=-g),c.a=p,c.c=d,c.b=m,c.d=g,c.tx=e+v.x,void(c.ty=n+v.y)}var y=u.matrix.a,x=u.matrix.c,M=u.matrix.b,E=u.matrix.d;switch(c.tx=y*e+x*n+u.matrix.tx,c.ty=M*e+E*n+u.matrix.ty,this.data.transformMode){case r.TransformMode.Normal:var f=i+90+l,p=a.MathUtils.cosDeg(i+h)*o,d=a.MathUtils.cosDeg(f)*s,m=a.MathUtils.sinDeg(i+h)*o,g=a.MathUtils.sinDeg(f)*s;return c.a=y*p+x*m,c.c=y*d+x*g,c.b=M*p+E*m,void(c.d=M*d+E*g);case r.TransformMode.OnlyTranslation:var f=i+90+l;c.a=a.MathUtils.cosDeg(i+h)*o,c.c=a.MathUtils.cosDeg(f)*s,c.b=a.MathUtils.sinDeg(i+h)*o,c.d=a.MathUtils.sinDeg(f)*s;break;case r.TransformMode.NoRotationOrReflection:var T=y*y+M*M,w=0;T>1e-4?(T=Math.abs(y*E-x*M)/T,x=M*T,E=y*T,w=Math.atan2(M,y)*a.MathUtils.radDeg):(y=0,M=0,w=90-Math.atan2(E,x)*a.MathUtils.radDeg);var b=i+h-w,A=i+l-w+90,p=a.MathUtils.cosDeg(b)*o,d=a.MathUtils.cosDeg(A)*s,m=a.MathUtils.sinDeg(b)*o,g=a.MathUtils.sinDeg(A)*s;c.a=y*p-x*m,c.c=y*d-x*g,c.b=M*p+E*m,c.d=M*d+E*g;break;case r.TransformMode.NoScale:case r.TransformMode.NoScaleOrReflection:var S=a.MathUtils.cosDeg(i),I=a.MathUtils.sinDeg(i),R=y*S+x*I,P=M*S+E*I,T=Math.sqrt(R*R+P*P);T>1e-5&&(T=1/T),R*=T,P*=T,T=Math.sqrt(R*R+P*P);var C=Math.PI/2+Math.atan2(P,R),V=Math.cos(C)*T,N=Math.sin(C)*T,p=a.MathUtils.cosDeg(h)*o,d=a.MathUtils.cosDeg(90+l)*s,m=a.MathUtils.sinDeg(h)*o,g=a.MathUtils.sinDeg(90+l)*s;return c.a=R*p+V*m,c.c=R*d+V*g,c.b=P*p+N*m,c.d=P*d+N*g,void((this.data.transformMode!=r.TransformMode.NoScaleOrReflection?y*E-x*M<0:this.skeleton.flipX!=this.skeleton.flipY!=t.yDown)&&(c.b=-c.b,c.d=-c.d));case r.TransformMode.InheritRotation:var f=i+90+l,p=a.MathUtils.cosDeg(i+h)*o,d=a.MathUtils.cosDeg(f)*s,m=a.MathUtils.sinDeg(i+h)*o,g=a.MathUtils.sinDeg(f)*s;y=1,x=0,M=0,E=1;do{var S=a.MathUtils.cosDeg(u.arotation),I=a.MathUtils.sinDeg(u.arotation),D=y*S+x*I;if(x=x*S-y*I,y=D,D=M*S+E*I,E=E*S-M*I,M=D,u.data.transformMode===r.TransformMode.InheritScale||u.data.transformMode===r.TransformMode.OnlyTranslation)break;u=u.parent}while(null!=u);c.a=y*p+x*m,c.c=y*d+x*g,c.b=M*p+E*m,c.d=M*d+E*g;break;case r.TransformMode.InheritScale:var f=i+90+l,p=a.MathUtils.cosDeg(i+h)*o,d=a.MathUtils.cosDeg(f)*s,m=a.MathUtils.sinDeg(i+h)*o,g=a.MathUtils.sinDeg(f)*s;y=1,x=0,M=0,E=1;do{var S=a.MathUtils.cosDeg(u.arotation),I=a.MathUtils.sinDeg(u.arotation),k=u.scaleX,U=u.scaleY,R=S*k,V=I*U,P=I*k,N=S*U,D=y*R+x*P;if(x=x*N-y*V,y=D,D=M*R+E*P,E=E*N-M*V,M=D,k>=0&&(I=-I),D=y*S+x*I,x=x*S-y*I,y=D,D=M*S+E*I,E=E*S-M*I,M=D,u.data.transformMode===r.TransformMode.InheritRotation||u.data.transformMode===r.TransformMode.OnlyTranslation)break;u=u.parent}while(null!=u);c.a=y*p+x*m,c.c=y*d+x*g,c.b=M*p+E*m,c.d=M*d+E*g}this.skeleton.flipX&&(c.a=-c.a,c.c=-c.c),this.skeleton.flipY!=t.yDown&&(c.b=-c.b,c.d=-c.d)},t.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},t.prototype.getWorldRotationX=function(){return Math.atan2(this.matrix.b,this.matrix.a)*a.MathUtils.radDeg},t.prototype.getWorldRotationY=function(){return Math.atan2(this.matrix.d,this.matrix.c)*a.MathUtils.radDeg},t.prototype.getWorldScaleX=function(){var t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)},t.prototype.getWorldScaleY=function(){var t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)},t.prototype.worldToLocalRotationX=function(){var t=this.parent;if(null==t)return this.arotation;var e=t.matrix,n=this.matrix;return Math.atan2(e.a*n.b-e.b*n.a,e.d*n.a-e.c*n.b)*a.MathUtils.radDeg},t.prototype.worldToLocalRotationY=function(){var t=this.parent;if(null==t)return this.arotation;var e=t.matrix,n=this.matrix;return Math.atan2(e.a*n.d-e.b*n.c,e.d*n.c-e.c*n.d)*a.MathUtils.radDeg},t.prototype.rotateWorld=function(t){var e=this.matrix,n=this.matrix.a,r=e.c,i=e.b,o=e.d,s=a.MathUtils.cosDeg(t),h=a.MathUtils.sinDeg(t);e.a=s*n-h*i,e.c=s*r-h*o,e.b=h*n+s*i,e.d=h*r+s*o,this.appliedValid=!1},t.prototype.updateAppliedTransform=function(){ +this.appliedValid=!0;var t=this.parent,e=this.matrix;if(null==t)return this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*a.MathUtils.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,void(this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*a.MathUtils.radDeg);var n=t.matrix,r=1/(n.a*n.d-n.b*n.c),i=e.tx-n.tx,o=e.ty-n.ty;this.ax=i*n.d*r-o*n.c*r,this.ay=o*n.a*r-i*n.b*r;var s=r*n.d,h=r*n.a,l=r*n.c,u=r*n.b,c=s*e.a-l*e.b,f=s*e.c-l*e.d,p=h*e.b-u*e.a,d=h*e.d-u*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(c*c+p*p),this.ascaleX>1e-4){var m=c*d-f*p;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(c*f+p*d,m)*a.MathUtils.radDeg,this.arotation=Math.atan2(p,c)*a.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(f*f+d*d),this.ashearY=0,this.arotation=90-Math.atan2(d,f)*a.MathUtils.radDeg},t.prototype.worldToLocal=function(t){var e=this.matrix,n=e.a,r=e.c,a=e.b,i=e.d,o=1/(n*i-r*a),s=t.x-e.tx,h=t.y-e.ty;return t.x=s*i*o-h*r*o,t.y=h*n*o-s*a*o,t},t.prototype.localToWorld=function(t){var e=this.matrix,n=t.x,r=t.y;return t.x=n*e.a+r*e.c+e.tx,t.y=n*e.b+r*e.d+e.ty,t},t.yDown=!1,t}();n.Bone=i},{"./BoneData":8,"./Utils":26}],8:[function(t,e,n){"use strict";var r=function(){function t(t,e,n){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=a.Normal,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}return t}();n.BoneData=r,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t[t.InheritRotation=5]="InheritRotation",t[t.InheritScale=6]="InheritScale"}(n.TransformMode||(n.TransformMode={}));var a=n.TransformMode},{}],9:[function(t,e,n){"use strict";var r=function(){function t(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}return t}();n.Event=r},{}],10:[function(t,e,n){"use strict";var r=function(){function t(t){this.name=t}return t}();n.EventData=r},{}],11:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t,e){if(this.mix=1,this.bendDirection=0,this.level=0,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=new Array;for(var n=0;n180?c-=360:c<-180&&(c+=360),t.updateWorldTransformWith(t.ax,t.ay,t.arotation+c*a,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)},t.prototype.apply2=function(t,e,n,a,i,o){if(0==o)return void e.updateWorldTransform();t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();var s=t.ax,h=t.ay,l=t.ascaleX,u=t.ascaleY,c=e.ascaleX,f=0,p=0,d=0;l<0?(l=-l,f=180,d=-1):(f=0,d=1),u<0&&(u=-u,d=-d),c<0?(c=-c,p=180):p=0;var m=t.matrix,g=e.ax,v=0,y=0,x=0,M=m.a,E=m.c,T=m.b,w=m.d,b=Math.abs(l-u)<=1e-4;b?(v=e.ay,y=M*g+E*v+m.tx,x=T*g+w*v+m.ty):(v=0,y=M*g+m.tx,x=T*g+m.ty);var A=(t.parent,t.parent.matrix);M=A.a,E=A.c,T=A.b,w=A.d;var S=1/(M*w-E*T),I=n-A.tx,R=a-A.ty,P=(I*w-R*E)*S-s,C=(R*M-I*T)*S-h;I=y-A.tx,R=x-A.ty;var V=(I*w-R*E)*S-s,N=(R*M-I*T)*S-h,D=Math.sqrt(V*V+N*N),k=e.data.length*c,U=0,_=0;t:if(b){k*=l;var O=(P*P+C*C-D*D-k*k)/(2*D*k);O<-1?O=-1:O>1&&(O=1),_=Math.acos(O)*i,M=D+k*O,E=k*Math.sin(_),U=Math.atan2(C*M-P*E,P*M+C*E)}else{M=l*k,E=u*k;var X=M*M,B=E*E,F=P*P+C*C,Y=Math.atan2(C,P);T=B*D*D+X*F-X*B;var L=-2*B*D,W=B-X;if(w=L*L-4*W*T,w>=0){var q=Math.sqrt(w);L<0&&(q=-q),q=-(L+q)/2;var j=q/W,Z=T/q,z=Math.abs(j)$&&(Q=0,$=w,tt=I),I=D-M,w=I*I,w$&&(Q=nt,$=w,tt=I,et=R),F<=(G+$)/2?(U=Y-Math.atan2(K*i,J),_=H*i):(U=Y-Math.atan2(et*i,tt),_=Q*i)}var rt=Math.atan2(v,g)*d,at=t.arotation;U=(U-rt)*r.MathUtils.radDeg+f-at,U>180?U-=360:U<-180&&(U+=360),t.updateWorldTransformWith(s,h,at+U*o,t.ascaleX,t.ascaleY,0,0),at=e.arotation,_=((_+rt)*r.MathUtils.radDeg-e.ashearX)*d+p-at,_>180?_-=360:_<-180&&(_+=360),e.updateWorldTransformWith(g,v,at+_*o,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},t}();n.IkConstraint=a},{"./Utils":26}],12:[function(t,e,n){"use strict";var r=function(){function t(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t}return t}();n.IkConstraintData=r},{}],13:[function(t,e,n){"use strict";var r=t("./PathConstraintData"),a=t("./attachments"),i=t("./Utils"),o=function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n0,s=e>0;if(o||s){var h=this.data,l=h.spacingMode,u=l==r.SpacingMode.Length,c=h.rotateMode,f=c==r.RotateMode.Tangent,p=c==r.RotateMode.ChainScale,d=this.bones.length,m=f?d:d+1,g=this.bones,v=i.Utils.setArraySize(this.spaces,m),y=null,x=this.spacing;if(p||u){p&&(y=i.Utils.setArraySize(this.lengths,d));for(var M=0,E=m-1;Mi.MathUtils.PI?Y-=i.MathUtils.PI2:Y<-i.MathUtils.PI&&(Y+=i.MathUtils.PI2),Y*=e,L=Math.cos(Y),W=Math.sin(Y),w.a=L*O-W*B,w.c=L*X-W*F,w.b=W*O+L*B,w.d=W*X+L*F}T.appliedValid=!1}}}},t.prototype.computeWorldPositions=function(e,n,r,a,o){var s=this.target,h=this.position,l=this.spaces,u=i.Utils.setArraySize(this.positions,3*n+2),c=null,f=e.closed,p=e.worldVerticesLength,d=p/6,m=t.NONE;if(!e.constantSpeed){var g=e.lengths;d-=f?1:2;var v=g[d];if(a&&(h*=v),o)for(var y=0;yv){m!=t.AFTER&&(m=t.AFTER,e.computeWorldVerticesWith(s,p-6,4,c,0)),this.addAfterPosition(T-v,c,0,u,x);continue}}for(;;M++){var w=g[M];if(!(T>w)){if(0==M)T/=w;else{var b=g[M-1];T=(T-b)/(w-b)}break}}M!=m&&(m=M,f&&M==d?(e.computeWorldVerticesWith(s,p-4,4,c,0),e.computeWorldVerticesWith(s,0,4,c,4)):e.computeWorldVerticesWith(s,6*M+2,8,c,0)),this.addCurvePosition(T,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||y>0&&0==E)}return u}f?(p+=2,c=i.Utils.setArraySize(this.world,p),e.computeWorldVerticesWith(s,2,p-4,c,0),e.computeWorldVerticesWith(s,0,2,c,p-4),c[p-2]=c[0],c[p-1]=c[1]):(d--,p-=4,c=i.Utils.setArraySize(this.world,p),e.computeWorldVerticesWith(s,2,p,c,0));for(var A=i.Utils.setArraySize(this.curves,d),S=0,I=c[0],R=c[1],P=0,C=0,V=0,N=0,D=0,k=0,U=0,_=0,O=0,X=0,B=0,F=0,Y=0,L=0,y=0,W=2;yS){this.addAfterPosition(T-S,c,p-4,u,x);continue}}for(;;M++){var z=A[M];if(!(T>z)){if(0==M)T/=z;else{var b=A[M-1];T=(T-b)/(z-b)}break}}if(M!=m){m=M;var H=6*M;for(I=c[H],R=c[H+1],P=c[H+2],C=c[H+3],V=c[H+4],N=c[H+5],D=c[H+6],k=c[H+7],U=.03*(I-2*P+V),_=.03*(R-2*C+N),O=.006*(3*(P-V)-I+D),X=.006*(3*(C-N)-R+k),B=2*U+O,F=2*_+X,Y=.3*(P-I)+U+.16666667*O,L=.3*(C-R)+_+.16666667*X,j=Math.sqrt(Y*Y+L*L),q[0]=j,H=1;H<8;H++)Y+=B,L+=F,B+=O,F+=X,j+=Math.sqrt(Y*Y+L*L),q[H]=j;Y+=B,L+=F,j+=Math.sqrt(Y*Y+L*L),q[8]=j,Y+=B+O,L+=F+X,j+=Math.sqrt(Y*Y+L*L),q[9]=j,Z=0}for(T*=j;;Z++){var G=q[Z];if(!(T>G)){if(0==Z)T/=G;else{var b=q[Z-1];T=Z+(T-b)/(G-b)}break}}this.addCurvePosition(.1*T,I,R,P,C,V,N,D,k,u,x,r||y>0&&0==E)}return u},t.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],o=e[n+1],s=e[n+2]-i,h=e[n+3]-o,l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},t.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],o=e[n+3],s=i-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},t.prototype.addCurvePosition=function(t,e,n,r,a,i,o,s,h,l,u,c){(0==t||isNaN(t))&&(t=1e-4);var f=t*t,p=f*t,d=1-t,m=d*d,g=m*d,v=d*t,y=3*v,x=d*y,M=y*t,E=e*g+r*x+i*M+s*p,T=n*g+a*x+o*M+h*p;l[u]=E,l[u+1]=T,c&&(l[u+2]=Math.atan2(T-(n*m+a*v*2+o*f),E-(e*m+r*v*2+i*f)))},t.prototype.getOrder=function(){return this.data.order},t.NONE=-1,t.BEFORE=-2,t.AFTER=-3,t}();n.PathConstraint=o},{"./PathConstraintData":14,"./Utils":26,"./attachments":33}],14:[function(t,e,n){"use strict";var r=function(){function t(t){this.order=0,this.bones=new Array,this.name=t}return t}();n.PathConstraintData=r,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(n.PositionMode||(n.PositionMode={}));n.PositionMode;!function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(n.SpacingMode||(n.SpacingMode={}));n.SpacingMode;!function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(n.RotateMode||(n.RotateMode={}));n.RotateMode},{}],15:[function(t,e,n){"use strict";var r=t("./Slot"),a=t("./Bone"),i=t("./IkConstraint"),o=t("./TransformConstraint"),s=t("./PathConstraint"),h=t("./Utils"),l=t("./attachments"),u=function(){function t(t){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.flipX=!1,this.flipY=!1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(var e=0;e1){var a=n[n.length-1];this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},t.prototype.sortPathConstraint=function(t){var e=t.target,n=e.data.index,r=e.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var a=0,i=this.data.skins.length;a=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},t.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,o=this.maxX,s=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(a-t)+e;if(l>i&&li&&la&&ua&&ut.minX&&this.minYt.minY},t.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[i]-u)=u&&x<=p||x>=p&&x<=u)&&(x>=e&&x<=r||x>=r&&x<=e)){var M=(l*v-h*m)/y;if((M>=c&&M<=d||M>=d&&M<=c)&&(M>=n&&M<=a||M>=a&&M<=n))return!0}u=p,c=d}return!1},t.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return e==-1?null:this.polygons[e]},t.prototype.getWidth=function(){return this.maxX-this.minX},t.prototype.getHeight=function(){return this.maxY-this.minY},t}();n.SkeletonBounds=i},{"./Utils":26,"./attachments":33}],17:[function(t,e,n){"use strict";var r=function(){function t(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n=0;v--)Z[v]==-1&&(Z[v]=H[--J])}m.setFrame(g++,j.time,Z)}a.push(m),i=Math.max(i,m.frames[m.getFrameCount()-1])}if(t.events){for(var m=new p.EventTimeline(t.events.length),g=0,v=0;v=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}return t}();n.SlotData=a},{"./Utils":26}],22:[function(t,e,n){"use strict";var r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return a.Nearest;case"linear":return a.Linear;case"mipmap":return a.MipMap;case"mipmapnearestnearest":return a.MipMapNearestNearest;case"mipmaplinearnearest":return a.MipMapLinearNearest;case"mipmapnearestlinear":return a.MipMapNearestLinear;case"mipmaplinearlinear":return a.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();n.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(n.TextureFilter||(n.TextureFilter={}));var a=n.TextureFilter;!function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n.TextureWrap||(n.TextureWrap={}));var i=n.TextureWrap,o=function(){function t(){this.size=null}return Object.defineProperty(t.prototype,"width",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.width:t.trim?t.trim.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.crop.height:t.trim?t.trim.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this.texture._uvs.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v",{get:function(){return this.texture._uvs.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u2",{get:function(){return this.texture._uvs.x2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v2",{get:function(){return this.texture._uvs.y2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){var t=this.texture;return t.trim?t.trim.x:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return console.warn("Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on."),this.spineOffsetY},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pixiOffsetY",{get:function(){var t=this.texture;return t.trim?t.trim.y:0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spineOffsetY",{get:function(){var t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalWidth",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.width:t.crop.width:t.orig.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"originalHeight",{get:function(){var t=this.texture;return"3"==PIXI.VERSION[0]?t.trim?t.trim.height:t.crop.height:t.orig.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.texture.frame.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.texture.frame.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return 0!==this.texture.rotate},enumerable:!0,configurable:!0}),t}();n.TextureRegion=o},{}],23:[function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=t("./Texture"),i=function(){function t(t,e,n){this.pages=new Array,this.regions=new Array,t&&this.addSpineAtlas(t,e,n)}return t.prototype.addTexture=function(t,e){for(var n=this.pages,r=null,i=0;i=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(e==-1)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(n==-1)throw new Error("Invalid line: "+e);for(var r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(i==-1)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),s=function(){function t(){}return t.prototype.setFilters=function(){var t=this.baseTexture,e=this.minFilter;e==a.TextureFilter.Linear?t.scaleMode=PIXI.SCALE_MODES.LINEAR:this.minFilter==a.TextureFilter.Nearest?t.scaleMode=PIXI.SCALE_MODES.NEAREST:(t.mipmap=!0,e==a.TextureFilter.MipMapNearestNearest?t.scaleMode=PIXI.SCALE_MODES.NEAREST:t.scaleMode=PIXI.SCALE_MODES.LINEAR)},t}();n.TextureAtlasPage=s;var h=function(t){function e(){t.apply(this,arguments)}return r(e,t),e}(a.TextureRegion);n.TextureAtlasRegion=h},{"./Texture":22}],24:[function(t,e,n){"use strict";var r=t("./Utils"),a=function(){function t(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new r.Vector2,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var n=0;nr.MathUtils.PI?M-=r.MathUtils.PI2:M<-r.MathUtils.PI&&(M+=r.MathUtils.PI2),M*=t;var E=Math.cos(M),T=Math.sin(M);d.a=E*g-T*y,d.c=E*v-T*x,d.b=T*g+E*y,d.d=T*v+E*x,m=!0}if(0!=e){var w=this.temp;i.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),d.tx+=(w.x-d.tx)*e,d.ty+=(w.y-d.ty)*e,m=!0}if(n>0){var b=Math.sqrt(d.a*d.a+d.b*d.b),A=Math.sqrt(o*o+h*h);b>1e-5&&(b=(b+(A-b+this.data.offsetScaleX)*n)/b),d.a*=b,d.b*=b,b=Math.sqrt(d.c*d.c+d.d*d.d),A=Math.sqrt(s*s+l*l),b>1e-5&&(b=(b+(A-b+this.data.offsetScaleY)*n)/b),d.c*=b,d.d*=b,m=!0}if(a>0){var v=d.c,x=d.d,S=Math.atan2(x,v),M=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(d.b,d.a));M>r.MathUtils.PI?M-=r.MathUtils.PI2:M<-r.MathUtils.PI&&(M+=r.MathUtils.PI2),M=S+(M+this.data.offsetShearY*r.MathUtils.degRad)*a;var b=Math.sqrt(v*v+x*x);d.c=Math.cos(M)*b,d.d=Math.sin(M)*b,m=!0}m&&(p.appliedValid=!1)}},t.prototype.getOrder=function(){return this.data.order},t}();n.TransformConstraint=a},{"./Utils":26}],25:[function(t,e,n){"use strict";var r=function(){function t(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,null==t)throw new Error("name cannot be null.");this.name=t}return t}();n.TransformConstraintData=r},{}],26:[function(t,e,n){"use strict";var r=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();n.Color=r;var a=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>=0?1:-1},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();n.MathUtils=a;var i=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,o=r;i0?this.items.pop():this.instantiator()},t.prototype.free=function(t){this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();n.TimeKeeper=l},{}],27:[function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(){function t(t){if(null==t)throw new Error("name cannot be null.");this.name=t}return t}();n.Attachment=a;var i=function(t){function e(e){t.call(this,e),this.worldVerticesLength=0}return r(e,t),e.prototype.computeWorldVertices=function(t,e){this.computeWorldVerticesWith(t,0,this.worldVerticesLength,e,0)},e.prototype.computeWorldVerticesWith=function(t,e,n,r,a){n+=a;var i=t.bone.skeleton,o=t.attachmentVertices,s=this.vertices,h=this.bones;if(null!=h){for(var l=0,u=0,c=0;c0&&(s=o);for(var y=t.bone,x=y.matrix,A=x.tx,S=x.ty,I=x.a,m=x.c,R=x.b,P=x.d,C=e,d=a;d, uvs?: ArrayLike, indices?: ArrayLike, drawMode?: number) {\n super(texture, vertices, uvs, indices, drawMode);\n }\n}\n\n/**\n * A class that enables the you to import and run your spine animations in pixi.\n * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class\n * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\n *\n * ```js\n * var spineAnimation = new PIXI.Spine(spineData);\n * ```\n *\n * @class\n * @extends Container\n * @memberof PIXI.spine\n * @param spineData {object} The spine data loaded from a spine atlas.\n */\nexport class Spine extends PIXI.Container {\n static globalAutoUpdate: boolean = true;\n\n tintRgb: ArrayLike;\n spineData: spine.SkeletonData;\n skeleton: spine.Skeleton;\n stateData: spine.AnimationStateData;\n state: spine.AnimationState;\n slotContainers: Array;\n\n constructor(spineData: spine.SkeletonData) {\n super();\n\n if (!spineData) {\n throw new Error('The spineData param is required.');\n }\n\n if ((typeof spineData) === \"string\") {\n throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas(\"YOUR_RESOURCE_NAME\") from now on.');\n }\n\n /**\n * The spineData object\n *\n * @member {object}\n */\n this.spineData = spineData;\n\n /**\n * A spine Skeleton object\n *\n * @member {object}\n */\n this.skeleton = new spine.Skeleton(spineData);\n this.skeleton.updateWorldTransform();\n\n /**\n * A spine AnimationStateData object created from the spine data passed in the constructor\n *\n * @member {object}\n */\n this.stateData = new spine.AnimationStateData(spineData);\n\n /**\n * A spine AnimationState object created from the spine AnimationStateData object\n *\n * @member {object}\n */\n this.state = new spine.AnimationState(this.stateData);\n\n /**\n * An array of containers\n *\n * @member {Container[]}\n */\n this.slotContainers = [];\n\n for (var i = 0, n = this.skeleton.slots.length; i < n; i++) {\n var slot = this.skeleton.slots[i];\n var attachment : any = slot.attachment;\n var slotContainer = new PIXI.Container();\n this.slotContainers.push(slotContainer);\n this.addChild(slotContainer);\n\n if (attachment instanceof spine.RegionAttachment) {\n var spriteName = attachment.region.name;\n var sprite = this.createSprite(slot, attachment, spriteName);\n slot.currentSprite = sprite;\n slot.currentSpriteName = spriteName;\n slotContainer.addChild(sprite);\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = this.createMesh(slot, attachment);\n slot.currentMesh = mesh;\n slot.currentMeshName = attachment.name;\n slotContainer.addChild(mesh);\n }\n else {\n continue;\n }\n\n }\n\n /**\n * Should the Spine object update its transforms\n *\n * @member {boolean}\n */\n this.autoUpdate = true;\n\n /**\n * The tint applied to all spine slots. This is a [r,g,b] value. A value of [1,1,1] will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n */\n this.tintRgb = new Float32Array([1, 1, 1]);\n }\n\n /**\n * If this flag is set to true, the spine animation will be autoupdated every time\n * the object id drawn. The down side of this approach is that the delta time is\n * automatically calculated and you could miss out on cool effects like slow motion,\n * pause, skip ahead and the sorts. Most of these effects can be achieved even with\n * autoupdate enabled but are harder to achieve.\n *\n * @member {boolean}\n * @memberof PIXI.spine.Spine#\n * @default true\n */\n get autoUpdate(): boolean {\n return (this.updateTransform === Spine.prototype.autoUpdateTransform);\n }\n\n set autoUpdate(value: boolean) {\n this.updateTransform = value ? Spine.prototype.autoUpdateTransform : PIXI.Container.prototype.updateTransform;\n }\n\n /**\n * The tint applied to the spine object. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n * @default 0xFFFFFF\n */\n get tint(): number {\n return PIXI.utils.rgb2hex(this.tintRgb);\n }\n\n set tint(value: number) {\n this.tintRgb = PIXI.utils.hex2rgb(value, this.tintRgb);\n }\n\n /**\n * Update the spine skeleton and its animations by delta time (dt)\n *\n * @param dt {number} Delta time. Time by which the animation should be updated\n */\n update(dt: number) {\n this.state.update(dt);\n this.state.apply(this.skeleton);\n this.skeleton.updateWorldTransform();\n\n let drawOrder = this.skeleton.drawOrder;\n let slots = this.skeleton.slots;\n\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n this.children[i] = this.slotContainers[drawOrder[i].data.index];\n }\n\n var r0 = this.tintRgb[0];\n var g0 = this.tintRgb[1];\n var b0 = this.tintRgb[2];\n\n for (i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n var attachment = slot.attachment;\n var slotContainer = this.slotContainers[i];\n\n if (!attachment) {\n slotContainer.visible = false;\n continue;\n }\n\n var attColor = (attachment as any).color;\n if (attachment instanceof spine.RegionAttachment) {\n let region = (attachment as spine.RegionAttachment).region;\n if (region) {\n let ar = region as TextureAtlasRegion;\n if (!slot.currentSpriteName || slot.currentSpriteName !== ar.name) {\n var spriteName = ar.name;\n if (slot.currentSprite) {\n slot.currentSprite.visible = false;\n }\n slot.sprites = slot.sprites || {};\n if (slot.sprites[spriteName] !== undefined) {\n slot.sprites[spriteName].visible = true;\n }\n else {\n var sprite = this.createSprite(slot, attachment, spriteName);\n slotContainer.addChild(sprite);\n }\n slot.currentSprite = slot.sprites[spriteName];\n slot.currentSpriteName = spriteName;\n }\n }\n\n if (slotContainer.transform) {\n var transform = slotContainer.transform;\n let lt : PIXI.Matrix;\n if (slotContainer.transform.matrix2d) {\n //gameofbombs pixi fork\n lt = transform.matrix2d;\n transform._dirtyVersion++;\n transform.version = transform._dirtyVersion;\n transform.isStatic = true;\n transform.operMode = 0;\n } else {\n if (TransformBase) {\n //PIXI v4.0\n if (transform.position) {\n transform = new PIXI.TransformBase();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n } else {\n //PIXI v4.0rc\n if (!transform._dirtyLocal) {\n transform = new PIXI.TransformStatic();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n transform._dirtyParentVersion = -1;\n transform._dirtyLocal = 1;\n transform._versionLocal = 1;\n }\n }\n slot.bone.matrix.copy(lt);\n lt.tx += slot.bone.skeleton.x;\n lt.ty += slot.bone.skeleton.y;\n } else {\n //PIXI v3\n var lt = slotContainer.localTransform || new PIXI.Matrix();\n slot.bone.matrix.copy(lt);\n lt.tx += slot.bone.skeleton.x;\n lt.ty += slot.bone.skeleton.y;\n slotContainer.localTransform = lt;\n slotContainer.displayObjectUpdateTransform = SlotContainerUpdateTransformV3;\n }\n tempRgb[0] = r0 * slot.color.r * attColor.r;\n tempRgb[1] = g0 * slot.color.g * attColor.g;\n tempRgb[2] = b0 * slot.color.b * attColor.b;\n slot.currentSprite.tint = PIXI.utils.rgb2hex(tempRgb);\n slot.currentSprite.blendMode = slot.blendMode;\n }\n else if (attachment instanceof spine.MeshAttachment) {\n if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) {\n var meshName = attachment.name;\n if (slot.currentMesh) {\n slot.currentMesh.visible = false;\n }\n\n slot.meshes = slot.meshes || {};\n\n if (slot.meshes[meshName] !== undefined) {\n slot.meshes[meshName].visible = true;\n }\n else {\n var mesh = this.createMesh(slot, attachment);\n slotContainer.addChild(mesh);\n }\n\n slot.currentMesh = slot.meshes[meshName];\n slot.currentMeshName = meshName;\n }\n (attachment as VertexAttachment).computeWorldVertices(slot, slot.currentMesh.vertices);\n if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // slot.currentMesh.dirty++;\n //only for PIXI v4\n var tintRgb = slot.currentMesh.tintRgb;\n tintRgb[0] = r0 * slot.color.r * attColor.r;\n tintRgb[1] = g0 * slot.color.g * attColor.g;\n tintRgb[2] = b0 * slot.color.b * attColor.b;\n }\n slot.currentMesh.blendMode = slot.blendMode;\n }\n else {\n slotContainer.visible = false;\n continue;\n }\n slotContainer.visible = true;\n\n slotContainer.alpha = slot.color.a;\n }\n };\n\n private setSpriteRegion(attachment: spine.RegionAttachment, sprite: SpineSprite, region: spine.TextureRegion) {\n sprite.region = region;\n sprite.texture = region.texture;\n if (!region.size) {\n sprite.scale.x = attachment.scaleX * attachment.width / region.originalWidth;\n sprite.scale.y = -attachment.scaleY * attachment.height / region.originalHeight;\n } else {\n //hacked!\n sprite.scale.x = region.size.width / region.originalWidth;\n sprite.scale.y = -region.size.height / region.originalHeight;\n }\n }\n\n private setMeshRegion(attachment: spine.MeshAttachment, mesh: SpineMesh, region: spine.TextureRegion) {\n mesh.region = region;\n mesh.texture = region.texture;\n attachment.updateUVs(region, mesh.uvs);\n // if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // mesh.indexDirty++;\n // } else {\n // PIXI version 3\n mesh.dirty++;\n // }\n }\n\n protected lastTime: number;\n\n /**\n * When autoupdate is set to yes this function is used as pixi's updateTransform function\n *\n * @private\n */\n autoUpdateTransform() {\n if (Spine.globalAutoUpdate) {\n this.lastTime = this.lastTime || Date.now();\n var timeDelta = (Date.now() - this.lastTime) * 0.001;\n this.lastTime = Date.now();\n this.update(timeDelta);\n } else {\n this.lastTime = 0;\n }\n\n PIXI.Container.prototype.updateTransform.call(this);\n };\n\n /**\n * Create a new sprite to be used with spine.RegionAttachment\n *\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createSprite(slot: spine.Slot, attachment: spine.RegionAttachment, defName: string) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n var texture = region.texture;\n var sprite = new SpineSprite(texture);\n sprite.rotation = attachment.rotation * spine.MathUtils.degRad;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n sprite.position.x = attachment.x;\n sprite.position.y = attachment.y;\n sprite.alpha = attachment.color.a;\n\n sprite.region = attachment.region;\n this.setSpriteRegion(attachment, sprite, attachment.region);\n\n slot.sprites = slot.sprites || {};\n slot.sprites[defName] = sprite;\n return sprite;\n };\n\n /**\n * Creates a Strip from the spine data\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createMesh(slot: spine.Slot, attachment: spine.MeshAttachment) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n let strip = new SpineMesh(\n region.texture,\n new Float32Array(attachment.regionUVs.length),\n new Float32Array(attachment.regionUVs.length),\n new Uint16Array(attachment.triangles),\n PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);\n\n strip.canvasPadding = 1.5;\n\n strip.alpha = attachment.color.a;\n\n strip.region = attachment.region;\n this.setMeshRegion(attachment, strip, region);\n\n slot.meshes = slot.meshes || {};\n slot.meshes[attachment.name] = strip;\n return strip;\n };\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotIndex {number}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotIndex(slotIndex: number, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var slot = this.skeleton.slots[slotIndex];\n if (!slot) {\n return false;\n }\n var attachment: any = slot.attachment;\n var region: spine.TextureRegion = attachment.region;\n if (texture) {\n region = new spine.TextureRegion();\n region.texture = texture;\n region.size = size;\n }\n if (slot.currentSprite && slot.currentSprite.region != region) {\n this.setSpriteRegion(attachment, slot.currentSprite, region);\n slot.currentSprite.region = region;\n } else\n if (slot.currentMesh && slot.currentMesh.region != region) {\n this.setMeshRegion(attachment, slot.currentMesh, region);\n } else {\n slot.tempRegion = region;\n slot.tempAttachment = attachment;\n }\n return true;\n }\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotName {string}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotName = function (slotName: String, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var index = this.skeleton.findSlotIndex(slotName);\n if (index == -1) {\n return false;\n }\n return this.hackTextureBySlotIndex(index, texture, size);\n }\n}\n\nfunction SlotContainerUpdateTransformV3() {\n var pt = this.parent.worldTransform;\n var wt = this.worldTransform;\n var lt = this.localTransform;\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n this._currentBounds = null;\n}\n","import {Event} from \"./Event\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {PathConstraint} from \"./PathConstraint\";\r\nimport {Utils, MathUtils, Color} from \"./Utils\";\r\nimport {TransformConstraint} from \"./TransformConstraint\";\r\nimport {IkConstraint} from \"./IkConstraint\";\r\nimport {VertexAttachment, Attachment} from \"./attachments\";\r\nimport {Slot} from \"./Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Animation {\r\n name: string;\r\n timelines: Array;\r\n duration: number;\r\n\r\n constructor (name: string, timelines: Array, duration: number) {\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n if (timelines == null) throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.duration = duration;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0) lastTime %= this.duration;\r\n }\r\n\r\n let timelines = this.timelines;\r\n for (let i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, 1);\r\n }\r\n\r\n mix (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0) lastTime %= this.duration;\r\n }\r\n\r\n let timelines = this.timelines;\r\n for (let i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha);\r\n }\r\n\r\n static binarySearch (values: ArrayLike, target: number, step: number = 1) {\r\n let low = 0;\r\n let high = values.length / step - 2;\r\n if (high == 0) return step;\r\n let current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high) return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n }\r\n\r\n static linearSearch (values: ArrayLike, target: number, step: number) {\r\n for (let i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target) return i;\r\n return -1;\r\n }\r\n}\r\n\r\nexport interface Timeline {\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\r\n}\r\n\r\nexport abstract class CurveTimeline implements Timeline {\r\n static LINEAR = 0; static STEPPED = 1; static BEZIER = 2;\r\n static BEZIER_SIZE = 10 * 2 - 1;\r\n\r\n private curves: ArrayLike; // type, x, y, ...\r\n\r\n constructor (frameCount: number) {\r\n if (frameCount <= 0) throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n\r\n getFrameCount () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n }\r\n\r\n setLinear (frameIndex: number) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n }\r\n\r\n setStepped (frameIndex: number) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n }\r\n\r\n getCurveType (frameIndex: number): number {\r\n let index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length) return CurveTimeline.LINEAR;\r\n let type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR) return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED) return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n }\r\n\r\n /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\r\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\r\n * the difference between the keyframe's values. */\r\n setCurve (frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number) {\r\n let tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n let dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n let ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n let dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n\r\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n let curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n\r\n let x = dfx, y = dfy;\r\n for (let n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n }\r\n\r\n getCurvePercent (frameIndex: number, percent: number) {\r\n percent = MathUtils.clamp(percent, 0, 1);\r\n let curves = this.curves;\r\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n let type = curves[i];\r\n if (type == CurveTimeline.LINEAR) return percent;\r\n if (type == CurveTimeline.STEPPED) return 0;\r\n i++;\r\n let x = 0;\r\n for (let start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n let prevX: number, prevY: number;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n } else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n let y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\r\n }\r\n\r\n abstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\r\n}\r\n\r\nexport class RotateTimeline extends CurveTimeline {\r\n static ENTRIES = 2;\r\n static PREV_TIME = -2; static PREV_ROTATION = -1;\r\n static ROTATION = 1;\r\n\r\n boneIndex: number;\r\n frames: ArrayLike; // time, degrees, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount << 1);\r\n }\r\n\r\n /** Sets the time and angle of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, degrees: number) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\r\n let amount = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION] - bone.rotation;\r\n while (amount > 180)\r\n amount -= 360;\r\n while (amount < -180)\r\n amount += 360;\r\n bone.rotation += amount * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n let prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent((frame >> 1) - 1,\r\n 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n\r\n let amount = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n while (amount > 180)\r\n amount -= 360;\r\n while (amount < -180)\r\n amount += 360;\r\n amount = bone.data.rotation + (prevRotation + amount * percent) - bone.rotation;\r\n while (amount > 180)\r\n amount -= 360;\r\n while (amount < -180)\r\n amount += 360;\r\n bone.rotation += amount * alpha;\r\n }\r\n}\r\n\r\nexport class TranslateTimeline extends CurveTimeline {\r\n static ENTRIES = 3;\r\n static PREV_TIME = -3; static PREV_X = -2; static PREV_Y = -1;\r\n static X = 1; static Y = 2;\r\n\r\n boneIndex: number;\r\n frames: ArrayLike; // time, x, y, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, x: number, y: number) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\r\n bone.x += (bone.data.x + frames[frames.length + TranslateTimeline.PREV_X] - bone.x) * alpha;\r\n bone.y += (bone.data.y + frames[frames.length + TranslateTimeline.PREV_Y] - bone.y) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n let prevX = frames[frame + TranslateTimeline.PREV_X];\r\n let prevY = frames[frame + TranslateTimeline.PREV_Y];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n\r\n bone.x += (bone.data.x + prevX + (frames[frame + TranslateTimeline.X] - prevX) * percent - bone.x) * alpha;\r\n bone.y += (bone.data.y + prevY + (frames[frame + TranslateTimeline.Y] - prevY) * percent - bone.y) * alpha;\r\n }\r\n}\r\n\r\nexport class ScaleTimeline extends TranslateTimeline {\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\r\n bone.scaleX += (bone.data.scaleX * frames[frames.length + ScaleTimeline.PREV_X] - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY * frames[frames.length + ScaleTimeline.PREV_Y] - bone.scaleY) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n let prevX = frames[frame + ScaleTimeline.PREV_X];\r\n let prevY = frames[frame + ScaleTimeline.PREV_Y];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n\r\n bone.scaleX += (bone.data.scaleX * (prevX + (frames[frame + ScaleTimeline.X] - prevX) * percent) - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY * (prevY + (frames[frame + ScaleTimeline.Y] - prevY) * percent) - bone.scaleY) * alpha;\r\n }\r\n}\r\n\r\nexport class ShearTimeline extends TranslateTimeline {\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let bone = skeleton.bones[this.boneIndex];\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\r\n bone.shearX += (bone.data.shearX + frames[frames.length + ShearTimeline.PREV_X] - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + frames[frames.length + ShearTimeline.PREV_Y] - bone.shearY) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n let prevX = frames[frame + ShearTimeline.PREV_X];\r\n let prevY = frames[frame + ShearTimeline.PREV_Y];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n\r\n bone.shearX += (bone.data.shearX + (prevX + (frames[frame + ShearTimeline.X] - prevX) * percent) - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + (prevY + (frames[frame + ShearTimeline.Y] - prevY) * percent) - bone.shearY) * alpha;\r\n }\r\n}\r\n\r\nexport class ColorTimeline extends CurveTimeline {\r\n static ENTRIES = 5;\r\n static PREV_TIME = -5; static PREV_R = -4; static PREV_G = -3; static PREV_B = -2; static PREV_A = -1;\r\n static R = 1; static G = 2; static B = 3; static A = 4;\r\n\r\n slotIndex: number;\r\n frames: ArrayLike; // time, r, g, b, a, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, r: number, g: number, b: number, a: number) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n } else {\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n let color: Color = skeleton.slots[this.slotIndex].color;\r\n if (alpha < 1)\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n else\r\n color.set(r, g, b, a);\r\n }\r\n}\r\n\r\nexport class AttachmentTimeline implements Timeline {\r\n slotIndex: number;\r\n frames: ArrayLike // time, ...\r\n attachmentNames: Array;\r\n\r\n constructor (frameCount: number) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n\r\n getFrameCount () {\r\n return this.frames.length;\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, attachmentName: string) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frameIndex = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n\r\n let attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n }\r\n}\r\n\r\nexport class EventTimeline implements Timeline {\r\n frames: ArrayLike; // time, ...\r\n events: Array;\r\n\r\n constructor (frameCount: number) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n\r\n getFrameCount () {\r\n return this.frames.length;\r\n }\r\n\r\n /** Sets the time of the specified keyframe. */\r\n setFrame (frameIndex: number, event: Event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n }\r\n\r\n /** Fires events for frames > lastTime and <= time. */\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n if (firedEvents == null) return;\r\n let frames = this.frames;\r\n let frameCount = this.frames.length;\r\n\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha);\r\n lastTime = -1;\r\n } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n let frameTime = frames[frame];\r\n while (frame > 0) { // Fire multiple events with the same frame.\r\n if (frames[frame - 1] != frameTime) break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n }\r\n}\r\n\r\nexport class DrawOrderTimeline implements Timeline {\r\n frames: ArrayLike; // time, ...\r\n drawOrders: Array>;\r\n\r\n constructor (frameCount: number) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array>(frameCount);\r\n }\r\n\r\n getFrameCount () {\r\n return this.frames.length;\r\n }\r\n\r\n /** Sets the time of the specified keyframe.\r\n * @param drawOrder May be null to use bind pose draw order. */\r\n setFrame (frameIndex: number, time: number, drawOrder: Array) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frame = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n\r\n let drawOrder: Array = skeleton.drawOrder;\r\n let slots: Array = skeleton.slots;\r\n let drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n }\r\n}\r\n\r\nexport class DeformTimeline extends CurveTimeline {\r\n frames: ArrayLike; // time, ...\r\n frameVertices: Array>;\r\n slotIndex: number;\r\n attachment: VertexAttachment;\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.frameVertices = new Array>(frameCount);\r\n }\r\n\r\n /** Sets the time of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, vertices: ArrayLike) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let slot: Slot = skeleton.slots[this.slotIndex];\r\n let slotAttachment: Attachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof VertexAttachment) || !(slotAttachment).applyDeform(this.attachment)) return;\r\n\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let frameVertices = this.frameVertices;\r\n let vertexCount = frameVertices[0].length;\r\n\r\n let verticesArray: Array = slot.attachmentVertices;\r\n if (verticesArray.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.\r\n let vertices: Array = Utils.setArraySize(verticesArray, vertexCount);\r\n\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n let lastVertices = frameVertices[frames.length - 1];\r\n if (alpha < 1) {\r\n for (let i = 0; i < vertexCount; i++)\r\n vertices[i] += (lastVertices[i] - vertices[i]) * alpha;\r\n } else\r\n Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time);\r\n let prevVertices = frameVertices[frame - 1];\r\n let nextVertices = frameVertices[frame];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n\r\n if (alpha < 1) {\r\n for (let i = 0; i < vertexCount; i++) {\r\n let prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;\r\n }\r\n } else {\r\n for (let i = 0; i < vertexCount; i++) {\r\n let prev = prevVertices[i];\r\n vertices[i] = prev + (nextVertices[i] - prev) * percent;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class IkConstraintTimeline extends CurveTimeline {\r\n static ENTRIES = 3;\r\n static PREV_TIME = -3; static PREV_MIX = -2; static PREV_BEND_DIRECTION = -1;\r\n static MIX = 1; static BEND_DIRECTION = 2;\r\n\r\n ikConstraintIndex: number;\r\n frames: ArrayLike; // time, mix, bendDirection, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time, mix and bend direction of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, mix: number, bendDirection: number) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: IkConstraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n constraint.bendDirection = Math.floor(frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]);\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n let mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n constraint.bendDirection = Math.floor(frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]);\r\n }\r\n}\r\n\r\nexport class TransformConstraintTimeline extends CurveTimeline {\r\n static ENTRIES = 5;\r\n static PREV_TIME = -5; static PREV_ROTATE = -4; static PREV_TRANSLATE = -3; static PREV_SCALE = -2; static PREV_SHEAR = -1;\r\n static ROTATE = 1; static TRANSLATE = 2; static SCALE = 3; static SHEAR = 4;\r\n\r\n transformConstraintIndex: number;\r\n frames: ArrayLike; // time, rotate mix, translate mix, scale mix, shear mix, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and mixes of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: TransformConstraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.rotateMix += (frames[i + TransformConstraintTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (frames[i + TransformConstraintTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (frames[i + TransformConstraintTimeline.PREV_SCALE] - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (frames[i + TransformConstraintTimeline.PREV_SHEAR] - constraint.shearMix) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n\r\n let rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n let translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n let scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n let shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n constraint.rotateMix += (rotate + (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate + (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\r\n * alpha;\r\n constraint.scaleMix += (scale + (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear + (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent - constraint.shearMix) * alpha;\r\n }\r\n}\r\n\r\nexport class PathConstraintPositionTimeline extends CurveTimeline {\r\n static ENTRIES = 2;\r\n static PREV_TIME = -2; static PREV_VALUE = -1;\r\n static VALUE = 1;\r\n\r\n pathConstraintIndex: number;\r\n\r\n frames: ArrayLike; // time, position, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and value of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, value: number) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.position += (frames[i + PathConstraintPositionTimeline.PREV_VALUE] - constraint.position) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n let position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.position += (position + (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent - constraint.position) * alpha;\r\n }\r\n}\r\n\r\nexport class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.spacing += (frames[i + PathConstraintSpacingTimeline.PREV_VALUE] - constraint.spacing) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n let spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.spacing += (spacing + (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent - constraint.spacing) * alpha;\r\n }\r\n}\r\n\r\nexport class PathConstraintMixTimeline extends CurveTimeline {\r\n static ENTRIES = 3;\r\n static PREV_TIME = -3; static PREV_ROTATE = -2; static PREV_TRANSLATE = -1;\r\n static ROTATE = 1; static TRANSLATE = 2;\r\n\r\n pathConstraintIndex: number;\r\n\r\n frames: ArrayLike; // time, rotate mix, translate mix, ...\r\n\r\n constructor (frameCount: number) {\r\n super(frameCount);\r\n this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n }\r\n\r\n /** Sets the time and mixes of the specified keyframe. */\r\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n }\r\n\r\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\r\n let frames = this.frames;\r\n if (time < frames[0]) return; // Time is before first frame.\r\n\r\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\r\n let i = frames.length;\r\n constraint.rotateMix += (frames[i + PathConstraintMixTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (frames[i + PathConstraintMixTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\r\n return;\r\n }\r\n\r\n // Interpolate between the previous frame and the current frame.\r\n let frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n let rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n let translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n let frameTime = frames[frame];\r\n let percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1,\r\n 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n\r\n constraint.rotateMix += (rotate + (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate + (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\r\n * alpha;\r\n }\r\n}\r\n","import {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils, Utils} from \"./Utils\";\r\nimport {Animation} from \"./Animation\";\r\nimport {AnimationStateData} from \"./AnimationStateData\";\r\nimport {Event} from \"./Event\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class AnimationState {\r\n data: AnimationStateData;\r\n tracks = new Array();\r\n events = new Array();\r\n timeScale = 1;\r\n\r\n constructor (data: AnimationStateData = null) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n }\r\n\r\n update (delta: number) {\r\n delta *= this.timeScale;\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n let next = current.next;\r\n if (next != null) {\r\n let nextTime = current.lastTime - next.delay;\r\n if (nextTime >= 0) {\r\n let nextDelta = delta * next.timeScale;\r\n next.time = nextTime + nextDelta; // For start event to see correct time.\r\n current.time += delta * current.timeScale; // For end event to see correct time.\r\n this.setCurrent(i, next);\r\n next.time -= nextDelta; // Prevent increasing time twice, below.\r\n current = next;\r\n }\r\n } else if (!current.loop && current.lastTime >= current.endTime) {\r\n // End non-looping animation when it reaches its end time and there is no next entry.\r\n this.clearTrack(i);\r\n continue;\r\n }\r\n\r\n current.time += delta * current.timeScale;\r\n if (current.previous != null) {\r\n let previousDelta = delta * current.previous.timeScale;\r\n current.previous.time += previousDelta;\r\n current.mixTime += previousDelta;\r\n }\r\n }\r\n }\r\n\r\n apply (skeleton: Skeleton) {\r\n let events = this.events;\r\n\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n events.length = 0;\r\n\r\n let time = current.time;\r\n let lastTime = current.lastTime;\r\n let endTime = current.endTime;\r\n let loop = current.loop;\r\n if (!loop && time > endTime) time = endTime;\r\n\r\n let previous = current.previous;\r\n if (previous == null)\r\n current.animation.mix(skeleton, lastTime, time, loop, events, current.mix);\r\n else {\r\n let previousTime = previous.time;\r\n if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime;\r\n previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null);\r\n\r\n let alpha = current.mixTime / current.mixDuration * current.mix;\r\n if (alpha >= 1) {\r\n alpha = 1;\r\n current.previous = null;\r\n }\r\n current.animation.mix(skeleton, lastTime, time, loop, events, alpha);\r\n }\r\n\r\n for (let ii = 0, nn = events.length; ii < nn; ii++) {\r\n let event = events[ii];\r\n if (current.onEvent) current.onEvent(i, event);\r\n if (this.onEvent) this.onEvent(i, event);\r\n }\r\n\r\n // Check if completed the animation or a loop iteration.\r\n if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) {\r\n let count = MathUtils.toInt(time / endTime);\r\n if (current.onComplete) current.onComplete(i, count);\r\n if (this.onComplete) this.onComplete(i, count);\r\n }\r\n\r\n current.lastTime = current.time;\r\n }\r\n }\r\n\r\n clearTracks () {\r\n for (let i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n }\r\n\r\n clearTrack (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return;\r\n let current = this.tracks[trackIndex];\r\n if (current == null) return;\r\n\r\n if (current.onEnd) current.onEnd(trackIndex);\r\n if (this.onEnd) this.onEnd(trackIndex);\r\n\r\n this.tracks[trackIndex] = null;\r\n\r\n this.freeAll(current);\r\n }\r\n\r\n freeAll (entry: TrackEntry) {\r\n while (entry != null) {\r\n let next = entry.next;\r\n entry = next;\r\n }\r\n }\r\n\r\n expandToIndex (index: number) {\r\n if (index < this.tracks.length) return this.tracks[index];\r\n Utils.setArraySize(this.tracks, index - this.tracks.length + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n }\r\n\r\n setCurrent (index: number, entry: TrackEntry) {\r\n let current = this.expandToIndex(index);\r\n if (current != null) {\r\n let previous = current.previous;\r\n current.previous = null;\r\n\r\n if (entry.onEnd) entry.onEnd(index);\r\n if (this.onEnd) this.onEnd(index);\r\n\r\n entry.mixDuration = this.data.getMix(current.animation, entry.animation);\r\n if (entry.mixDuration > 0) {\r\n entry.mixTime = 0;\r\n // If a mix is in progress, mix from the closest animation.\r\n if (previous != null && current.mixTime / current.mixDuration < 0.5) {\r\n entry.previous = previous;\r\n previous = current;\r\n } else\r\n entry.previous = current;\r\n }\r\n }\r\n\r\n this.tracks[index] = entry;\r\n\r\n if (entry.onStart) entry.onStart(index);\r\n if (this.onStart) this.onStart(index);\r\n }\r\n\r\n /** @see #setAnimation(int, Animation, boolean) */\r\n setAnimation (trackIndex: number, animationName: string, loop: boolean) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n }\r\n\r\n /** Set the current animation. Any queued animations are cleared. */\r\n setAnimationWith (trackIndex: number, animation: Animation, loop: boolean) {\r\n let current = this.expandToIndex(trackIndex);\r\n if (current != null) this.freeAll(current.next);\r\n\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n this.setCurrent(trackIndex, entry);\r\n return entry;\r\n }\r\n\r\n /** {@link #addAnimation(int, Animation, boolean, float)} */\r\n addAnimation (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n }\r\n\r\n hasAnimation(animationName: string): boolean\r\n {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n\r\n /** Adds an animation to be played delay seconds after the current or last queued animation.\r\n * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */\r\n addAnimationWith (trackIndex: number, animation: Animation, loop: boolean, delay: number) {\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n\r\n let last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n last.next = entry;\r\n } else\r\n this.tracks[trackIndex] = entry;\r\n\r\n if (delay <= 0) {\r\n if (last != null)\r\n delay += last.endTime - this.data.getMix(last.animation, animation);\r\n else\r\n delay = 0;\r\n }\r\n entry.delay = delay;\r\n\r\n return entry;\r\n }\r\n\r\n /** @return May be null. */\r\n getCurrent (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return null;\r\n return this.tracks[trackIndex];\r\n }\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n private static deprecatedWarning1: boolean = false;\r\n setAnimationByName (trackIndex: number, animationName: string, loop: boolean) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n }\r\n\r\n private static deprecatedWarning2: boolean = false;\r\n addAnimationByName (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n }\r\n\r\n private static deprecatedWarning3: boolean = false;\r\n hasAnimationByName (animationName: string): boolean\r\n {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n}\r\n\r\nexport class TrackEntry {\r\n next: TrackEntry; previous: TrackEntry;\r\n animation: Animation;\r\n loop = false;\r\n delay = 0; time = 0; lastTime = -1; endTime = 0; timeScale = 1;\r\n mixTime = 0; mixDuration = 0;\r\n mix = 1;\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n reset () {\r\n this.next = null;\r\n this.previous = null;\r\n this.animation = null;\r\n this.timeScale = 1;\r\n this.lastTime = -1; // Trigger events on frame zero.\r\n this.time = 0;\r\n }\r\n\r\n /** Returns true if the current time is greater than the end time, regardless of looping. */\r\n isComplete () : boolean {\r\n return this.time >= this.endTime;\r\n }\r\n}\r\n","import {Animation} from \"./Animation\";\nimport {SkeletonData} from \"./SkeletonData\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class AnimationStateData {\n skeletonData: SkeletonData;\n animationToMixTime: Map = { };\n defaultMix = 0;\n\n constructor (skeletonData: SkeletonData) {\n if (skeletonData == null) throw new Error(\"skeletonData cannot be null.\");\n this.skeletonData = skeletonData;\n }\n\n setMix (fromName: string, toName: string, duration: number) {\n let from = this.skeletonData.findAnimation(fromName);\n if (from == null) throw new Error(\"Animation not found: \" + fromName);\n let to = this.skeletonData.findAnimation(toName);\n if (to == null) throw new Error(\"Animation not found: \" + toName);\n this.setMixWith(from, to, duration);\n }\n\n private static deprecatedWarning1: boolean = false;\n setMixByName(fromName: string, toName: string, duration: number) {\n if (!AnimationStateData.deprecatedWarning1) {\n AnimationStateData.deprecatedWarning1 = true;\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\n }\n this.setMix(fromName, toName, duration);\n }\n\n setMixWith (from: Animation, to: Animation, duration: number) {\n if (from == null) throw new Error(\"from cannot be null.\");\n if (to == null) throw new Error(\"to cannot be null.\");\n let key = from.name + to.name;\n this.animationToMixTime[key] = duration;\n }\n\n getMix (from: Animation, to: Animation) {\n let key = from.name + to.name;\n let value = this.animationToMixTime[key];\n return value === undefined ? this.defaultMix : value;\n }\n}\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum BlendMode {\r\n Normal,\r\n Additive,\r\n Multiply,\r\n Screen\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {BoneData} from \"./BoneData\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils, Vector2} from \"./Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Bone implements Updatable {\r\n static yDown: boolean = false;\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n matrix = new PIXI.Matrix();\r\n\r\n get worldX(): number {\r\n return this.matrix.tx;\r\n }\r\n\r\n get worldY(): number {\r\n return this.matrix.ty;\r\n }\r\n\r\n data: BoneData;\r\n skeleton: Skeleton;\r\n parent: Bone;\r\n children = new Array();\r\n x = 0; y = 0; rotation = 0; scaleX = 0; scaleY = 0; shearX = 0; shearY = 0;\r\n appliedRotation = 0;\r\n\r\n worldSignX = 0; worldSignY = 0;\r\n\r\n sorted = false;\r\n\r\n /** @param parent May be null. */\r\n constructor (data: BoneData, skeleton: Skeleton, parent: Bone) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n\r\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\r\n update () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n }\r\n\r\n /** Computes the world transform using the parent bone and this bone's local transform. */\r\n updateWorldTransform () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n }\r\n\r\n /** Computes the world transform using the parent bone and the specified local transform. */\r\n updateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\r\n this.appliedRotation = rotation;\r\n\r\n let rotationY = rotation + 90 + shearY;\r\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX, lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX, ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n\r\n let parent = this.parent;\r\n let m = this.matrix;\r\n if (parent == null) { // Root bone.\r\n let skeleton = this.skeleton;\r\n if (skeleton.flipX) {\r\n x = -x;\r\n la = -la;\r\n lb = -lb;\r\n }\r\n if (skeleton.flipY !== Bone.yDown) {\r\n y = -y;\r\n lc = -lc;\r\n ld = -ld;\r\n }\r\n m.a = la;\r\n m.c = lb;\r\n m.b = lc;\r\n m.d = ld;\r\n m.tx = x;\r\n m.ty = y;\r\n this.worldSignX = MathUtils.signum(scaleX);\r\n this.worldSignY = MathUtils.signum(scaleY);\r\n return;\r\n }\r\n\r\n let pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n this.worldSignX = parent.worldSignX * MathUtils.signum(scaleX);\r\n this.worldSignY = parent.worldSignY * MathUtils.signum(scaleY);\r\n\r\n if (this.data.inheritRotation && this.data.inheritScale) {\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n } else {\r\n if (this.data.inheritRotation) { // No scale inheritance.\r\n pa = 1;\r\n pb = 0;\r\n pc = 0;\r\n pd = 1;\r\n do {\r\n let cos = MathUtils.cosDeg(parent.appliedRotation), sin = MathUtils.sinDeg(parent.appliedRotation);\r\n let temp = pa * cos + pb * sin;\r\n pb = pb * cos - pa * sin;\r\n pa = temp;\r\n temp = pc * cos + pd * sin;\r\n pd = pd * cos - pc * sin;\r\n pc = temp;\r\n\r\n if (!parent.data.inheritRotation) break;\r\n parent = parent.parent;\r\n } while (parent != null);\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n } else if (this.data.inheritScale) { // No rotation inheritance.\r\n pa = 1;\r\n pb = 0;\r\n pc = 0;\r\n pd = 1;\r\n do {\r\n let cos = MathUtils.cosDeg(parent.appliedRotation), sin = MathUtils.sinDeg(parent.appliedRotation);\r\n let psx = parent.scaleX, psy = parent.scaleY;\r\n let za = cos * psx, zb = sin * psy, zc = sin * psx, zd = cos * psy;\r\n let temp = pa * za + pb * zc;\r\n pb = pb * zd - pa * zb;\r\n pa = temp;\r\n temp = pc * za + pd * zc;\r\n pd = pd * zd - pc * zb;\r\n pc = temp;\r\n\r\n if (psx >= 0) sin = -sin;\r\n temp = pa * cos + pb * sin;\r\n pb = pb * cos - pa * sin;\r\n pa = temp;\r\n temp = pc * cos + pd * sin;\r\n pd = pd * cos - pc * sin;\r\n pc = temp;\r\n\r\n if (!parent.data.inheritScale) break;\r\n parent = parent.parent;\r\n } while (parent != null);\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n } else {\r\n m.a = la;\r\n m.c = lb;\r\n m.b = lc;\r\n m.d = ld;\r\n }\r\n if (this.skeleton.flipX) {\r\n m.a = -m.a;\r\n m.c = -m.c;\r\n }\r\n if (this.skeleton.flipY !== Bone.yDown) {\r\n m.b = -m.b;\r\n m.d = -m.d;\r\n }\r\n }\r\n }\r\n\r\n setToSetupPose () {\r\n let data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n }\r\n\r\n getWorldRotationX () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n }\r\n\r\n getWorldRotationY () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n }\r\n\r\n getWorldScaleX () {\r\n return Math.sqrt(this.matrix.a * this.matrix.a + this.matrix.b * this.matrix.b) * this.worldSignX;\r\n }\r\n\r\n getWorldScaleY () {\r\n return Math.sqrt(this.matrix.c * this.matrix.c + this.matrix.d * this.matrix.d) * this.worldSignY;\r\n }\r\n\r\n worldToLocalRotationX () {\r\n let parent = this.parent;\r\n if (parent == null) return this.rotation;\r\n let pm = parent.matrix;\r\n let pa = pm.a, pb = pm.c, pc = pm.b, pd = pm.d, a = this.matrix.a, c = this.matrix.b;\r\n return Math.atan2(pa * c - pc * a, pd * a - pb * c) * MathUtils.radDeg;\r\n }\r\n\r\n worldToLocalRotationY () {\r\n let parent = this.parent;\r\n if (parent == null) return this.rotation;\r\n let pm = parent.matrix;\r\n let pa = pm.a, pb = pm.b, pc = pm.c, pd = pm.d, b = this.matrix.c, d = this.matrix.d;\r\n return Math.atan2(pa * d - pc * b, pd * b - pb * d) * MathUtils.radDeg;\r\n }\r\n\r\n rotateWorld (degrees: number) {\r\n let m = this.matrix;\r\n let a = this.matrix.a, b = m.c, c = m.b, d = m.d;\r\n let cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n m.a = cos * a - sin * c;\r\n m.c = cos * b - sin * d;\r\n m.b = sin * a + cos * c;\r\n m.d = sin * b + cos * d;\r\n }\r\n\r\n /** Computes the local transform from the world transform. This can be useful to perform processing on the local transform\r\n * after the world transform has been modified directly (eg, by a constraint).\r\n *

\r\n * Some redundant information is lost by the world transform, such as -1,-1 scale versus 180 rotation. The computed local\r\n * transform values may differ from the original values but are functionally the same. */\r\n updateLocalTransform () {\r\n let parent = this.parent;\r\n let m = this.matrix;\r\n if (parent == null) {\r\n this.x = m.tx;\r\n this.y = m.ty;\r\n this.rotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.scaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.scaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n let det = m.a * m.d - m.b * m.c;\r\n this.shearX = 0;\r\n this.shearY = Math.atan2(m.a * m.c + m.b * m.d, det) * MathUtils.radDeg;\r\n return;\r\n }\r\n let pm = parent.matrix;\r\n let pa = pm.a, pb = pm.c, pc = pm.b, pd = pm.d;\r\n let pid = 1 / (pa * pd - pb * pc);\r\n let dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.x = (dx * pd * pid - dy * pb * pid);\r\n this.y = (dy * pa * pid - dx * pc * pid);\r\n let ia = pid * pd;\r\n let id = pid * pa;\r\n let ib = pid * pb;\r\n let ic = pid * pc;\r\n let ra = ia * m.a - ib * m.b;\r\n let rb = ia * m.c - ib * m.d;\r\n let rc = id * m.b - ic * m.a;\r\n let rd = id * m.d - ic * m.c;\r\n this.shearX = 0;\r\n this.scaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.scaleX > 0.0001) {\r\n let det = ra * rd - rb * rc;\r\n this.scaleY = det / this.scaleX;\r\n this.shearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.rotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n } else {\r\n this.scaleX = 0;\r\n this.scaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.shearY = 0;\r\n this.rotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n this.appliedRotation = this.rotation;\r\n }\r\n\r\n worldToLocal (world: Vector2) {\r\n let m = this.matrix;\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n let invDet = 1 / (a * d - b * c);\r\n let x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n }\r\n\r\n localToWorld (local: Vector2) {\r\n let m = this.matrix;\r\n let x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class BoneData {\r\n index: number;\r\n name: string;\r\n parent: BoneData;\r\n length: number;\r\n x = 0; y = 0; rotation = 0; scaleX = 1; scaleY = 1; shearX = 0; shearY = 0;\r\n inheritRotation = true; inheritScale = true;\r\n\r\n constructor (index: number, name: string, parent: BoneData) {\r\n if (index < 0) throw new Error(\"index must be >= 0.\");\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n}\r\n","import {EventData} from \"./EventData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Event {\r\n data: EventData;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n time: number;\r\n\r\n constructor (time: number, data: EventData) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class EventData {\r\n name: string;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {IkConstraintData} from \"./IkConstraintData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils} from \"./Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class IkConstraint implements Updatable {\r\n data: IkConstraintData;\r\n bones: Array;\r\n target: Bone;\r\n mix = 1;\r\n bendDirection = 0;\r\n\r\n level = 0;\r\n\r\n constructor (data: IkConstraintData, skeleton: Skeleton) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.bendDirection = data.bendDirection;\r\n\r\n this.bones = new Array();\r\n for (let i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n\r\n apply () {\r\n this.update();\r\n }\r\n\r\n update () {\r\n let target = this.target;\r\n let bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix);\r\n break;\r\n }\r\n }\r\n\r\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\r\n * coordinate system. */\r\n apply1 (bone: Bone, targetX: number, targetY: number, alpha: number) {\r\n let pp = bone.parent.matrix;\r\n let id = 1 / (pp.a * pp.d - pp.b * pp.c);\r\n let x = targetX - pp.tx, y = targetY - pp.ty;\r\n let tx = (x * pp.d - y * pp.c) * id - bone.x, ty = (y * pp.a - x * pp.b) * id - bone.y;\r\n let rotationIK = Math.atan2(ty, tx) * MathUtils.radDeg - bone.shearX - bone.rotation;\r\n if (bone.scaleX < 0) rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180) rotationIK += 360;\r\n bone.updateWorldTransformWith(bone.x, bone.y, bone.rotation + rotationIK * alpha, bone.scaleX, bone.scaleY, bone.shearX,\r\n bone.shearY);\r\n }\r\n\r\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\r\n * target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n apply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n let px = parent.x, py = parent.y, psx = parent.scaleX, psy = parent.scaleY, csx = child.scaleX;\r\n let os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n } else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n } else\r\n os2 = 0;\r\n let pm = parent.matrix;\r\n let cx = child.x, cy = 0, cwx = 0, cwy = 0, a = pm.a, b = pm.c, c = pm.b, d = pm.d;\r\n let u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + pm.tx;\r\n cwy = c * cx + pm.ty;\r\n } else {\r\n cy = child.y;\r\n cwx = a * cx + b * cy + pm.tx;\r\n cwy = c * cx + d * cy + pm.ty;\r\n }\r\n let pp = parent.parent;\r\n let ppm = parent.parent.matrix;\r\n a = ppm.a;\r\n b = ppm.c;\r\n c = ppm.b;\r\n d = ppm.d;\r\n let id = 1 / (a * d - b * c), x = targetX - ppm.tx, y = targetY - ppm.ty;\r\n let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n x = cwx - ppm.tx;\r\n y = cwy - ppm.ty;\r\n let dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n outer:\r\n if (u) {\r\n l2 *= psx;\r\n let cos = (tx * tx + ty * ty - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) cos = 1;\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n } else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n let aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n let c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n let q = Math.sqrt(d);\r\n if (c1 < 0) q = -q;\r\n q = -(c1 + q) / 2;\r\n let r0 = q / c2, r1 = c / q;\r\n let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n let minAngle = 0, minDist = Number.MAX_VALUE, minX = 0, minY = 0;\r\n let maxAngle = 0, maxDist = 0, maxX = 0, maxY = 0;\r\n x = l1 + a;\r\n d = x * x;\r\n if (d > maxDist) {\r\n maxAngle = 0;\r\n maxDist = d;\r\n maxX = x;\r\n }\r\n x = l1 - a;\r\n d = x * x;\r\n if (d < minDist) {\r\n minAngle = MathUtils.PI;\r\n minDist = d;\r\n minX = x;\r\n }\r\n let angle = Math.acos(-a * l1 / (aa - bb));\r\n x = a * Math.cos(angle) + l1;\r\n y = b * Math.sin(angle);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = angle;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = angle;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n } else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n let os = Math.atan2(cy, cx) * s2;\r\n let rotation = parent.rotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180) a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.scaleX, parent.scaleY, 0, 0);\r\n rotation = child.rotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.shearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180) a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.scaleX, child.scaleY, child.shearX, child.shearY);\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class IkConstraintData {\r\n name: string;\r\n bones = new Array();\r\n target: BoneData;\r\n bendDirection = 1;\r\n mix = 1;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Slot} from \"./Slot\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {PathAttachment} from \"./attachments\";\r\nimport {Utils, MathUtils} from \"./Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathConstraint implements Updatable {\r\n static NONE = -1; static BEFORE = -2; static AFTER = -3;\r\n\r\n data: PathConstraintData;\r\n bones: Array;\r\n target: Slot;\r\n position = 0; spacing = 0; rotateMix = 0; translateMix = 0;\r\n\r\n spaces = new Array(); positions = new Array();\r\n world = new Array(); curves = new Array(); lengths = new Array();\r\n segments = new Array();\r\n\r\n constructor (data: PathConstraintData, skeleton: Skeleton) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (let i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n\r\n apply () {\r\n this.update();\r\n }\r\n\r\n update () {\r\n let attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment)) return;\r\n\r\n let rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n let translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate) return;\r\n\r\n let data = this.data;\r\n let spacingMode = data.spacingMode;\r\n let lengthSpacing = spacingMode == SpacingMode.Length;\r\n let rotateMode = data.rotateMode;\r\n let tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\r\n let boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n let bones = this.bones;\r\n let spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = null;\r\n let spacing = this.spacing;\r\n if (scale || lengthSpacing) {\r\n if (scale) lengths = Utils.setArraySize(this.lengths, boneCount);\r\n for (let i = 0, n = spacesCount - 1; i < n;) {\r\n let bone = bones[i];\r\n let m = bone.matrix;\r\n let length = bone.data.length, x = length * m.a, y = length * m.b;\r\n length = Math.sqrt(x * x + y * y);\r\n if (scale) lengths[i] = length;\r\n spaces[++i] = lengthSpacing ? Math.max(0, length + spacing) : spacing;\r\n }\r\n } else {\r\n for (let i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n\r\n let positions = this.computeWorldPositions(attachment, spacesCount, tangents,\r\n data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\r\n let skeleton = this.target.bone.skeleton;\r\n let skeletonX = skeleton.x, skeletonY = skeleton.y;\r\n let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n let tip = rotateMode == RotateMode.Chain && offsetRotation == 0;\r\n for (let i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n let bone = bones[i];\r\n let m = bone.matrix;\r\n m.tx += (boneX - skeletonX - bone.worldX) * translateMix;\r\n m.ty += (boneY - skeletonY - bone.worldY) * translateMix;\r\n let x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n let length = lengths[i];\r\n if (length != 0) {\r\n let s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * rotateMix + 1;\r\n m.a *= s;\r\n m.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n let a = m.a, b = m.c, c = m.b, d = m.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a) - offsetRotation * MathUtils.degRad;\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n let length = bone.data.length;\r\n boneX += (length * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n m.a = cos * a - sin * c;\r\n m.c = cos * b - sin * d;\r\n m.b = sin * a + cos * c;\r\n m.d = sin * b + cos * d;\r\n }\r\n }\r\n }\r\n\r\n computeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean,\r\n percentSpacing: boolean) {\r\n let target = this.target;\r\n let position = this.position;\r\n let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = null;\r\n let closed = path.closed;\r\n let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n\r\n if (!path.constantSpeed) {\r\n let lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n let pathLength = lengths[curveCount];\r\n if (percentPosition) position *= pathLength;\r\n if (percentSpacing) {\r\n for (let i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n let space = spaces[i];\r\n position += space;\r\n let p = position;\r\n\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0) p += pathLength;\r\n curve = 0;\r\n } else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVerticesWith(target, 2, 4, world, 0);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n } else if (p > pathLength) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVerticesWith(target, verticesLength - 6, 4, world, 0);\r\n }\r\n this.addAfterPosition(p - pathLength, world, 0, out, o);\r\n continue;\r\n }\r\n\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n let length = lengths[curve];\r\n if (p > length) continue;\r\n if (curve == 0)\r\n p /= length;\r\n else {\r\n let prev = lengths[curve - 1];\r\n p = (p - prev) / (length - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVerticesWith(target, verticesLength - 4, 4, world, 0);\r\n path.computeWorldVerticesWith(target, 0, 4, world, 4);\r\n } else\r\n path.computeWorldVerticesWith(target, curve * 6 + 2, 8, world, 0);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\r\n tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVerticesWith(target, 2, verticesLength - 4, world, 0);\r\n path.computeWorldVerticesWith(target, 0, 2, world, verticesLength - 4);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n } else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVerticesWith(target, 2, verticesLength, world, 0);\r\n }\r\n\r\n // Curve lengths.\r\n let curves = Utils.setArraySize(this.curves, curveCount);\r\n let pathLength = 0;\r\n let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (let i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition) position *= pathLength;\r\n if (percentSpacing) {\r\n for (let i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n\r\n let segments = this.segments;\r\n let curveLength = 0;\r\n for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n let space = spaces[i];\r\n position += space;\r\n let p = position;\r\n\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0) p += pathLength;\r\n curve = 0;\r\n } else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n } else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n let length = curves[curve];\r\n if (p > length) continue;\r\n if (curve == 0)\r\n p /= length;\r\n else {\r\n let prev = curves[curve - 1];\r\n p = (p - prev) / (length - prev);\r\n }\r\n break;\r\n }\r\n\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n let ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n let length = segments[segment];\r\n if (p > length) continue;\r\n if (segment == 0)\r\n p /= length;\r\n else {\r\n let prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n\r\n addBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\r\n let x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n }\r\n\r\n addAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\r\n let x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n }\r\n\r\n addCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\r\n out: Array, o: number, tangents: boolean) {\r\n if (p == 0) p = 0.0001;\r\n let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {SlotData} from \"./SlotData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathConstraintData {\r\n name: string;\r\n bones = new Array();\r\n target: SlotData;\r\n positionMode: PositionMode;\r\n spacingMode: SpacingMode;\r\n rotateMode: RotateMode;\r\n offsetRotation: number;\r\n position: number; spacing: number; rotateMix: number; translateMix: number;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n\r\nexport enum PositionMode {\r\n Fixed, Percent\r\n}\r\n\r\nexport enum SpacingMode {\r\n Length, Fixed, Percent\r\n}\r\n\r\nexport enum RotateMode {\r\n Tangent, Chain, ChainScale\r\n}\r\n","import {Slot} from \"./Slot\";\r\nimport {Bone} from \"./Bone\";\r\nimport {IkConstraint} from \"./IkConstraint\";\r\nimport {TransformConstraint} from \"./TransformConstraint\";\r\nimport {PathConstraint} from \"./PathConstraint\";\r\nimport {Color, Utils, Vector2} from \"./Utils\";\r\nimport {Skin} from \"./Skin\";\r\nimport {SkeletonData} from \"./SkeletonData\";\r\nimport {Updatable} from \"./Updatable\";\r\nimport {Attachment, PathAttachment, RegionAttachment, MeshAttachment} from \"./attachments\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Skeleton {\r\n data: SkeletonData;\r\n bones: Array;\r\n slots: Array;\r\n drawOrder: Array;\r\n ikConstraints: Array; ikConstraintsSorted: Array;\r\n transformConstraints: Array;\r\n pathConstraints: Array;\r\n _updateCache = new Array();\r\n skin: Skin;\r\n color: Color;\r\n time = 0;\r\n flipX = false; flipY = false;\r\n x = 0; y = 0;\r\n\r\n constructor (data: SkeletonData) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n\r\n this.bones = new Array();\r\n for (let i = 0; i < data.bones.length; i++) {\r\n let boneData = data.bones[i];\r\n let bone: Bone;\r\n if (boneData.parent == null)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n let parent = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent);\r\n parent.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (let i = 0; i < data.slots.length; i++) {\r\n let slotData = data.slots[i];\r\n let bone = this.bones[slotData.boneData.index];\r\n let slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n\r\n this.ikConstraints = new Array();\r\n this.ikConstraintsSorted = new Array();\r\n for (let i = 0; i < data.ikConstraints.length; i++) {\r\n let ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n\r\n this.transformConstraints = new Array();\r\n for (let i = 0; i < data.transformConstraints.length; i++) {\r\n let transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n\r\n this.pathConstraints = new Array();\r\n for (let i = 0; i < data.pathConstraints.length; i++) {\r\n let pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n\r\n updateCache () {\r\n let updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n bones[i].sorted = false;\r\n\r\n // IK first, lowest hierarchy depth first.\r\n let ikConstraints = this.ikConstraintsSorted;\r\n ikConstraints.length = 0;\r\n for (let i = 0; i < this.ikConstraints.length; i++)\r\n ikConstraints.push(this.ikConstraints[i]);\r\n let ikCount = ikConstraints.length;\r\n for (let i = 0, level = 0, n = ikCount; i < n; i++) {\r\n let ik = ikConstraints[i];\r\n let bone = ik.bones[0].parent;\r\n for (level = 0; bone != null; level++)\r\n bone = bone.parent;\r\n ik.level = level;\r\n }\r\n for (let i = 1, ii = 0; i < ikCount; i++) {\r\n let ik = ikConstraints[i];\r\n let level = ik.level;\r\n for (ii = i - 1; ii >= 0; ii--) {\r\n let other = ikConstraints[ii];\r\n if (other.level < level) break;\r\n ikConstraints[ii + 1] = other;\r\n }\r\n ikConstraints[ii + 1] = ik;\r\n }\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let constraint = ikConstraints[i];\r\n let target = constraint.target;\r\n this.sortBone(target);\r\n\r\n let constrained = constraint.bones;\r\n let parent = constrained[0];\r\n this.sortBone(parent);\r\n\r\n updateCache.push(constraint);\r\n\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n }\r\n\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n\r\n let slot = constraint.target;\r\n let slotIndex = slot.data.index;\r\n let slotBone = slot.bone;\r\n if (this.skin != null) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (let ii = 0, nn = this.data.skins.length; ii < nn; ii++)\r\n this.sortPathConstraintAttachment(this.data.skins[ii], slotIndex, slotBone);\r\n\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n\r\n let constrained = constraint.bones;\r\n let boneCount = constrained.length;\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortBone(constrained[ii]);\r\n\r\n updateCache.push(constraint);\r\n\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (let ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n }\r\n\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n\r\n this.sortBone(constraint.target);\r\n\r\n let constrained = constraint.bones;\r\n let boneCount = constrained.length;\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortBone(constrained[ii]);\r\n\r\n updateCache.push(constraint);\r\n\r\n for (let ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (let ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n }\r\n\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n }\r\n\r\n sortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\r\n let attachments = skin.attachments[slotIndex];\r\n if (!attachments) return;\r\n for (let key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n }\r\n\r\n sortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\r\n if (!(attachment instanceof PathAttachment)) return;\r\n let pathBones = (attachment).bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n let bones = this.bones;\r\n for (let i = 0; i < pathBones.length; i++) {\r\n let boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n\r\n sortBone (bone: Bone) {\r\n if (bone.sorted) return;\r\n let parent = bone.parent;\r\n if (parent != null) this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n }\r\n\r\n sortReset (bones: Array) {\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n if (bone.sorted) this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n }\r\n\r\n /** Updates the world transform for each bone and applies constraints. */\r\n updateWorldTransform () {\r\n let updateCache = this._updateCache;\r\n for (let i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n }\r\n\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n setToSetupPose () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n }\r\n\r\n /** Sets the bones and constraints to their setup pose values. */\r\n setBonesToSetupPose () {\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n\r\n let ikConstraints = this.ikConstraints;\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let constraint = ikConstraints[i];\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.mix = constraint.data.mix;\r\n }\r\n\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n let data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n let data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n }\r\n\r\n setSlotsToSetupPose () {\r\n let slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (let i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n }\r\n\r\n /** @return May return null. */\r\n getRootBone () {\r\n if (this.bones.length == 0) return null;\r\n return this.bones[0];\r\n }\r\n\r\n /** @return May be null. */\r\n findBone (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n if (bone.data.name == boneName) return bone;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return -1 if the bone was not found. */\r\n findBoneIndex (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName) return i;\r\n return -1;\r\n }\r\n\r\n /** @return May be null. */\r\n findSlot (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n if (slot.data.name == slotName) return slot;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return -1 if the bone was not found. */\r\n findSlotIndex (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName) return i;\r\n return -1;\r\n }\r\n\r\n /** Sets a skin by name.\r\n * @see #setSkin(Skin) */\r\n setSkinByName (skinName: string) {\r\n let skin = this.data.findSkin(skinName);\r\n if (skin == null) throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n }\r\n\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n * @param newSkin May be null. */\r\n setSkin (newSkin: Skin) {\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n let name = slot.data.attachmentName;\r\n if (name != null) {\r\n let attachment: Attachment = newSkin.getAttachment(i, name);\r\n if (attachment != null) slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachmentByName (slotName: string, attachmentName: string): Attachment {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachment (slotIndex: number, attachmentName: string): Attachment {\r\n if (attachmentName == null) throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n let attachment: Attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null) return attachment;\r\n }\r\n if (this.data.defaultSkin != null) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n }\r\n\r\n /** @param attachmentName May be null. */\r\n setAttachment (slotName: string, attachmentName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n let attachment: Attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n }\r\n\r\n /** @return May be null. */\r\n findIkConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let ikConstraints = this.ikConstraints;\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName) return ikConstraint;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return May be null. */\r\n findTransformConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n /** @return May be null. */\r\n findPathConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size The width and height of the AABB. */\r\n getBounds (offset: Vector2, size: Vector2) {\r\n if (offset == null) throw new Error(\"offset cannot be null.\");\r\n if (size == null) throw new Error(\"size cannot be null.\");\r\n let drawOrder = this.drawOrder;\r\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (let i = 0, n = drawOrder.length; i < n; i++) {\r\n let slot = drawOrder[i];\r\n let vertices: ArrayLike = null;\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment)\r\n vertices = (attachment).updateWorldVertices(slot, false);\r\n else if (attachment instanceof MeshAttachment) //\r\n vertices = (attachment).updateWorldVertices(slot, true);\r\n if (vertices != null) {\r\n for (let ii = 0, nn = vertices.length; ii < nn; ii += 8) {\r\n let x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n }\r\n\r\n update (delta: number) {\r\n this.time += delta;\r\n }\r\n}\r\n","import {Utils, Pool} from \"./Utils\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {BoundingBoxAttachment} from \"./attachments\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonBounds {\r\n minX = 0; minY = 0; maxX = 0; maxY = 0;\r\n boundingBoxes = new Array();\r\n polygons = new Array>();\r\n private polygonPool = new Pool>(() => {\r\n return Utils.newFloatArray(16);\r\n });\r\n\r\n update (skeleton: Skeleton, updateAabb: boolean) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n let boundingBoxes = this.boundingBoxes;\r\n let polygons = this.polygons;\r\n let polygonPool = this.polygonPool;\r\n let slots = skeleton.slots;\r\n let slotCount = slots.length;\r\n\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n\r\n for (let i = 0; i < slotCount; i++) {\r\n let slot = slots[i];\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof BoundingBoxAttachment) {\r\n let boundingBox = attachment as BoundingBoxAttachment;\r\n boundingBoxes.push(boundingBox);\r\n\r\n let polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, polygon);\r\n }\r\n }\r\n\r\n if (updateAabb) this.aabbCompute();\r\n }\r\n\r\n aabbCompute () {\r\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++) {\r\n let polygon = polygons[i];\r\n let vertices = polygon;\r\n for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n let x = vertices[ii];\r\n let y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box contains the point. */\r\n aabbContainsPoint (x: number, y: number) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the line segment. */\r\n aabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let minX = this.minX;\r\n let minY = this.minY;\r\n let maxX = this.maxX;\r\n let maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n let m = (y2 - y1) / (x2 - x1);\r\n let y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n let x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n return false;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\r\n aabbIntersectsSkeleton (bounds: SkeletonBounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\r\n * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\r\n containsPoint (x: number, y: number): BoundingBoxAttachment {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains the point. */\r\n containsPointPolygon (polygon: ArrayLike, x: number, y: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let prevIndex = nn - 2;\r\n let inside = false;\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let vertexY = vertices[ii + 1];\r\n let prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n let vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\r\n * is usually more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns\r\n * true. */\r\n intersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains any part of the line segment. */\r\n intersectsSegmentPolygon (polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let width12 = x1 - x2, height12 = y1 - y2;\r\n let det1 = x1 * y2 - y1 * x2;\r\n let x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let x4 = vertices[ii], y4 = vertices[ii + 1];\r\n let det2 = x3 * y4 - y3 * x4;\r\n let width34 = x3 - x4, height34 = y3 - y4;\r\n let det3 = width12 * height34 - height12 * width34;\r\n let x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n let y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n }\r\n\r\n /** Returns the polygon for the specified bounding box, or null. */\r\n getPolygon (boundingBox: BoundingBoxAttachment) {\r\n if (boundingBox == null) throw new Error(\"boundingBox cannot be null.\");\r\n let index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n }\r\n\r\n getWidth () {\r\n return this.maxX - this.minX;\r\n }\r\n\r\n getHeight () {\r\n return this.maxY - this.minY;\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Skin} from \"./Skin\";\r\nimport {EventData} from \"./EventData\";\r\nimport {Animation} from \"./Animation\";\r\nimport {IkConstraintData} from \"./IkConstraintData\";\r\nimport {TransformConstraintData} from \"./TransformConstraintData\";\r\nimport {PathConstraintData} from \"./PathConstraintData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonData {\r\n name: string;\r\n bones = new Array(); // Ordered parents first.\r\n slots = new Array(); // Setup pose draw order.\r\n skins = new Array();\r\n defaultSkin: Skin;\r\n events = new Array();\r\n animations = new Array();\r\n ikConstraints = new Array();\r\n transformConstraints = new Array();\r\n pathConstraints = new Array();\r\n width: number; height: number;\r\n version: string; hash: string; imagesPath: string;\r\n\r\n findBone (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n if (bone.name == boneName) return bone;\r\n }\r\n return null;\r\n }\r\n\r\n findBoneIndex (boneName: string) {\r\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName) return i;\r\n return -1;\r\n }\r\n\r\n findSlot (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++) {\r\n let slot = slots[i];\r\n if (slot.name == slotName) return slot;\r\n }\r\n return null;\r\n }\r\n\r\n findSlotIndex (slotName: string) {\r\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\r\n let slots = this.slots;\r\n for (let i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName) return i;\r\n return -1;\r\n }\r\n\r\n findSkin (skinName: string) {\r\n if (skinName == null) throw new Error(\"skinName cannot be null.\");\r\n let skins = this.skins;\r\n for (let i = 0, n = skins.length; i < n; i++) {\r\n let skin = skins[i];\r\n if (skin.name == skinName) return skin;\r\n }\r\n return null;\r\n }\r\n\r\n findEvent (eventDataName: string) {\r\n if (eventDataName == null) throw new Error(\"eventDataName cannot be null.\");\r\n let events = this.events;\r\n for (let i = 0, n = events.length; i < n; i++) {\r\n let event = events[i];\r\n if (event.name == eventDataName) return event;\r\n }\r\n return null;\r\n }\r\n\r\n findAnimation (animationName: string) {\r\n if (animationName == null) throw new Error(\"animationName cannot be null.\");\r\n let animations = this.animations;\r\n for (let i = 0, n = animations.length; i < n; i++) {\r\n let animation = animations[i];\r\n if (animation.name == animationName) return animation;\r\n }\r\n return null;\r\n }\r\n\r\n findIkConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let ikConstraints = this.ikConstraints;\r\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\r\n let constraint = ikConstraints[i];\r\n if (constraint.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n findTransformConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let transformConstraints = this.transformConstraints;\r\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\r\n let constraint = transformConstraints[i];\r\n if (constraint.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n findPathConstraint (constraintName: string) {\r\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\r\n let constraint = pathConstraints[i];\r\n if (constraint.name == constraintName) return constraint;\r\n }\r\n return null;\r\n }\r\n\r\n findPathConstraintIndex (pathConstraintName: string) {\r\n if (pathConstraintName == null) throw new Error(\"pathConstraintName cannot be null.\");\r\n let pathConstraints = this.pathConstraints;\r\n for (let i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName) return i;\r\n return -1;\r\n }\r\n}\r\n","import {SkeletonData} from \"./SkeletonData\";\r\nimport {BoneData} from \"./BoneData\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Event} from \"./Event\";\r\nimport {IkConstraintData} from \"./IkConstraintData\";\r\nimport {TransformConstraintData} from \"./TransformConstraintData\";\r\nimport {PathConstraintData, PositionMode, SpacingMode, RotateMode} from \"./PathConstraintData\";\r\nimport {Skin} from \"./Skin\";\r\nimport {EventData} from \"./EventData\";\r\nimport {Attachment, AttachmentLoader, MeshAttachment, VertexAttachment} from \"./attachments\";\r\nimport {Utils, Color} from \"./Utils\";\r\nimport {\r\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\r\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\r\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\r\n Animation, CurveTimeline\r\n} from \"./Animation\";\r\nimport {BlendMode} from \"./BlendMode\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonJson {\r\n attachmentLoader: AttachmentLoader;\r\n scale = 1;\r\n private linkedMeshes = new Array();\r\n\r\n constructor (attachmentLoader: AttachmentLoader) {\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n\r\n readSkeletonData (json: string | any ): SkeletonData {\r\n let scale = this.scale;\r\n let skeletonData = new SkeletonData();\r\n let root = typeof(json) === \"string\" ? JSON.parse(json) : json;\r\n\r\n // Skeleton\r\n let skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n\r\n // Bones\r\n if (root.bones) {\r\n for (let i = 0; i < root.bones.length; i++) {\r\n let boneMap = root.bones[i];\r\n\r\n let parent: BoneData = null;\r\n let parentName: string = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent = skeletonData.findBone(parentName);\r\n if (parent == null) throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n let data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.inheritRotation = this.getValue(boneMap, \"inheritRotation\", true);\r\n data.inheritScale = this.getValue(boneMap, \"inheritScale\", true);\r\n\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n\r\n // Slots.\r\n if (root.slots) {\r\n for (let i = 0; i < root.slots.length; i++) {\r\n let slotMap = root.slots[i];\r\n let slotName: string = slotMap.name;\r\n let boneName: string = slotMap.bone;\r\n let boneData = skeletonData.findBone(boneName);\r\n if (boneData == null) throw new Error(\"Slot bone not found: \" + boneName);\r\n let data = new SlotData(skeletonData.slots.length, slotName, boneData);\r\n\r\n let color: string = this.getValue(slotMap, \"color\", null);\r\n if (color != null) data.color.setFromString(color);\r\n\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n\r\n // IK constraints\r\n if (root.ik) {\r\n for (let i = 0; i < root.ik.length; i++) {\r\n let constraintMap = root.ik[i];\r\n let data = new IkConstraintData(constraintMap.name);\r\n\r\n for (let j = 0; j < constraintMap.bones.length; j++) {\r\n let boneName = constraintMap.bones[j];\r\n let bone = skeletonData.findBone(boneName);\r\n if (bone == null) throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n\r\n let targetName: string = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null) throw new Error(\"IK target bone not found: \" + targetName);\r\n\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (let i = 0; i < root.transform.length; i++) {\r\n let constraintMap = root.transform[i];\r\n let data = new TransformConstraintData(constraintMap.name);\r\n\r\n for (let j = 0; j < constraintMap.bones.length; j++) {\r\n let boneName = constraintMap.bones[j];\r\n let bone = skeletonData.findBone(boneName);\r\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n\r\n let targetName: string = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null) throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n\r\n // Path constraints.\r\n if (root.path) {\r\n for (let i = 0; i < root.path.length; i++) {\r\n let constraintMap = root.path[i];\r\n let data = new PathConstraintData(constraintMap.name);\r\n\r\n for (let j = 0; j < constraintMap.bones.length; j++) {\r\n let boneName = constraintMap.bones[j];\r\n let bone = skeletonData.findBone(boneName);\r\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n\r\n let targetName: string = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null) throw new Error(\"Path target slot not found: \" + targetName);\r\n\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed) data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n\r\n // Skins.\r\n if (root.skins) {\r\n for (let skinName in root.skins) {\r\n let skinMap = root.skins[skinName]\r\n let skin = new Skin(skinName);\r\n for (let slotName in skinMap) {\r\n let slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\r\n let slotMap = skinMap[slotName];\r\n for (let entryName in slotMap) {\r\n let attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName);\r\n if (attachment != null) skin.addAttachment(slotIndex, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\") skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n\r\n // Linked meshes.\r\n for (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n let linkedMesh = this.linkedMeshes[i];\r\n let skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null) throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent == null) throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.setParentMesh( parent);\r\n // linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n\r\n // Events.\r\n if (root.events) {\r\n for (let eventName in root.events) {\r\n let eventMap = root.events[eventName];\r\n let data = new EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", null);\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n\r\n // Animations.\r\n if (root.animations) {\r\n for (let animationName in root.animations) {\r\n let animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n\r\n return skeletonData;\r\n }\r\n\r\n readAttachment (map: any, skin: Skin, slotIndex: number, name: string): Attachment {\r\n let scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n\r\n let type = this.getValue(map, \"type\", \"region\");\r\n\r\n switch (type) {\r\n case \"region\": {\r\n let path = this.getValue(map, \"path\", name);\r\n let region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null) return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n\r\n let color: string = this.getValue(map, \"color\", null);\r\n if (color != null) region.color.setFromString(color);\r\n\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null) return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n let color: string = this.getValue(map, \"color\", null);\r\n if (color != null) box.color.setFromString(color);\r\n return box;\r\n }\r\n //weightedmesh is deprecated but who cares\r\n case \"weightedmesh\":\r\n case \"skinnedmesh\":\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n let path = this.getValue(map, \"path\", name);\r\n let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null) return null;\r\n mesh.path = path;\r\n\r\n let color = this.getValue(map, \"color\", null);\r\n if (color != null) mesh.color.setFromString(color);\r\n\r\n let parent: string = this.getValue(map, \"parent\", null);\r\n if (parent != null) {\r\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent));\r\n return mesh;\r\n }\r\n\r\n let uvs: Array = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = uvs;\r\n // mesh.updateUVs();\r\n\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n let path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null) return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n\r\n let vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n\r\n let lengths: Array = Utils.newArray(vertexCount / 3, 0);\r\n for (let i = 0; i < map.lengths.length; i++)\r\n lengths[i++] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n\r\n let color: string = this.getValue(map, \"color\", null);\r\n if (color != null) path.color.setFromString(color);\r\n return path;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n readVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\r\n let scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n let vertices: Array = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n if (scale != 1) {\r\n for (let i = 0, n = vertices.length; i < n; i++)\r\n vertices[i] *= scale;\r\n }\r\n attachment.vertices = Utils.toFloatArray(vertices);\r\n return;\r\n }\r\n let weights = new Array();\r\n let bones = new Array();\r\n for (let i = 0, n = vertices.length; i < n;) {\r\n let boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (let nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n }\r\n\r\n readAnimation (map: any, name: string, skeletonData: SkeletonData) {\r\n let scale = this.scale;\r\n let timelines = new Array();\r\n let duration = 0;\r\n\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (let slotName in map.slots) {\r\n let slotMap = map.slots[slotName];\r\n let slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\r\n for (let timelineName in slotMap) {\r\n let timelineMap = slotMap[timelineName];\r\n if (timelineName == \"color\") {\r\n let timeline = new ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n let color = new Color();\r\n color.setFromString(valueMap.color);\r\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\r\n\r\n } else if (timelineName = \"attachment\") {\r\n let timeline = new AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n } else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (let boneName in map.bones) {\r\n let boneMap = map.bones[boneName];\r\n let boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1) throw new Error(\"Bone not found: \" + boneName);\r\n for (let timelineName in boneMap) {\r\n let timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n let timeline = new RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\r\n\r\n } else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n let timeline: TranslateTimeline = null;\r\n let timelineScale = 1;\r\n if (timelineName === \"scale\")\r\n timeline = new ScaleTimeline(timelineMap.length);\r\n else if (timelineName === \"shear\")\r\n timeline = new ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n let x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\r\n\r\n } else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (let constraintName in map.ik) {\r\n let constraintMap = map.ik[constraintName];\r\n let constraint = skeletonData.findIkConstraint(constraintName);\r\n let timeline = new IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n let frameIndex = 0;\r\n for (let i = 0; i < constraintMap.length; i++) {\r\n let valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1),\r\n this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (let constraintName in map.transform) {\r\n let constraintMap = map.transform[constraintName];\r\n let constraint = skeletonData.findTransformConstraint(constraintName);\r\n let timeline = new TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n let frameIndex = 0;\r\n for (let i = 0; i < constraintMap.length; i++) {\r\n let valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\r\n this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration,\r\n timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n\r\n // Path constraint timelines.\r\n if (map.paths) {\r\n for (let constraintName in map.paths) {\r\n let constraintMap = map.paths[constraintName];\r\n let index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1) throw new Error(\"Path constraint not found: \" + constraintName);\r\n let data = skeletonData.pathConstraints[index];\r\n for (let timelineName in constraintMap) {\r\n let timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n let timeline: PathConstraintPositionTimeline = null;\r\n let timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) timelineScale = scale;\r\n } else {\r\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == PositionMode.Fixed) timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration,\r\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n } else if (timelineName === \"mix\") {\r\n let timeline = new PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n let frameIndex = 0;\r\n for (let i = 0; i < timelineMap.length; i++) {\r\n let valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\r\n this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration,\r\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Deform timelines.\r\n if (map.deform) {\r\n for (let deformName in map.deform) {\r\n let deformMap = map.deform[deformName];\r\n let skin = skeletonData.findSkin(deformName);\r\n if (skin == null) throw new Error(\"Skin not found: \" + deformName);\r\n for (let slotName in deformMap) {\r\n let slotMap = deformMap[slotName];\r\n let slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (let timelineName in slotMap) {\r\n let timelineMap = slotMap[timelineName];\r\n let attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null) throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n let weighted = attachment.bones != null;\r\n let vertices = attachment.vertices;\r\n let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n\r\n let timeline = new DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n\r\n let frameIndex = 0;\r\n for (let j = 0; j < timelineMap.length; j++) {\r\n let valueMap = timelineMap[j];\r\n let deform: ArrayLike;\r\n let verticesValue: Array = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n let start = this.getValue(valueMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (let i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (let i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n\r\n timeline.setFrame(frameIndex, valueMap.time, deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Draw order timeline.\r\n let drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null) drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n let timeline = new DrawOrderTimeline(drawOrderNode.length);\r\n let slotCount = skeletonData.slots.length;\r\n let frameIndex = 0;\r\n for (let j = 0; j < drawOrderNode.length; j++) {\r\n let drawOrderMap = drawOrderNode[j];\r\n let drawOrder: Array = null;\r\n let offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n let unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n let originalIndex = 0, unchangedIndex = 0;\r\n for (let i = 0; i < offsets.length; i++) {\r\n let offsetMap = offsets[i];\r\n let slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (let i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n\r\n // Event timeline.\r\n if (map.events) {\r\n let timeline = new EventTimeline(map.events.length);\r\n let frameIndex = 0;\r\n for (let i = 0; i < map.events.length; i++) {\r\n let eventMap = map.events[i];\r\n let eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null) throw new Error(\"Event not found: \" + eventMap.name);\r\n let event = new Event(eventMap.time, eventData);\r\n event.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n timeline.setFrame(frameIndex++, event);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n }\r\n\r\n readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {\r\n if (!map.curve) return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n let curve: Array = map.curve;\r\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n }\r\n }\r\n\r\n getValue (map: any, prop: string, defaultValue: any) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n }\r\n\r\n static blendModeFromString (str: string): number {\r\n if (str === 'multiply') return PIXI.BLEND_MODES.MULTIPLY;\r\n if (str === 'additive') return PIXI.BLEND_MODES.ADD;\r\n if (str === 'screen') return PIXI.BLEND_MODES.SCREEN;\r\n if (str === 'normal') return PIXI.BLEND_MODES.NORMAL;\r\n throw new Error(`Unknown blend mode: ${str}`);\r\n }\r\n\r\n static positionModeFromString (str: string) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\") return PositionMode.Fixed;\r\n if (str == \"percent\") return PositionMode.Percent;\r\n throw new Error(`Unknown position mode: ${str}`);\r\n }\r\n\r\n static spacingModeFromString (str: string) {\r\n str = str.toLowerCase();\r\n if (str == \"length\") return SpacingMode.Length;\r\n if (str == \"fixed\") return SpacingMode.Fixed;\r\n if (str == \"percent\") return SpacingMode.Percent;\r\n throw new Error(`Unknown position mode: ${str}`);\r\n }\r\n\r\n static rotateModeFromString (str: string) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\") return RotateMode.Tangent;\r\n if (str == \"chain\") return RotateMode.Chain;\r\n if (str == \"chainscale\") return RotateMode.ChainScale;\r\n throw new Error(`Unknown rotate mode: ${str}`);\r\n }\r\n}\r\n\r\nclass LinkedMesh {\r\n parent: string; skin: string;\r\n slotIndex: number;\r\n mesh: MeshAttachment;\r\n\r\n constructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n }\r\n}\r\n","import {Attachment} from \"./attachments\";\nimport {Skeleton} from \"./Skeleton\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Skin {\n name: string;\n attachments = new Array>();\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n\n addAttachment (slotIndex: number, name: string, attachment: Attachment) {\n if (attachment == null) throw new Error(\"attachment cannot be null.\");\n let attachments = this.attachments;\n if (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n if (!attachments[slotIndex]) attachments[slotIndex] = { };\n attachments[slotIndex][name] = attachment;\n }\n\n /** @return May be null. */\n getAttachment (slotIndex: number, name: string): Attachment {\n let dictionary = this.attachments[slotIndex];\n return dictionary ? dictionary[name] : null;\n }\n\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n attachAll (skeleton: Skeleton, oldSkin: Skin) {\n let slotIndex = 0;\n for (let i = 0; i < skeleton.slots.length; i++) {\n let slot = skeleton.slots[i];\n let slotAttachment = slot.getAttachment();\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\n let dictionary = oldSkin.attachments[slotIndex];\n for (let key in dictionary) {\n let skinAttachment:Attachment = dictionary[key];\n if (slotAttachment == skinAttachment) {\n let attachment = this.getAttachment(slotIndex, name);\n if (attachment != null) slot.setAttachment(attachment);\n break;\n }\n }\n }\n slotIndex++;\n }\n }\n}\n","import {Attachment} from \"./attachments\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Color} from \"./Utils\";\r\nimport {TextureRegion} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Slot {\r\n //this is for PIXI\r\n currentMesh: any;\r\n currentSprite: any;\r\n meshes: any;\r\n currentMeshName: String;\r\n sprites: any;\r\n currentSpriteName: String;\r\n blendMode: number;\r\n //assign hack region a bit later\r\n tempRegion: TextureRegion;\r\n tempAttachment: Attachment;\r\n\r\n //canon\r\n data: SlotData;\r\n bone: Bone;\r\n color: Color;\r\n attachment: Attachment;\r\n private attachmentTime: number;\r\n attachmentVertices = new Array();\r\n\r\n constructor (data: SlotData, bone: Bone) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (bone == null) throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.blendMode = data.blendMode;\r\n this.setToSetupPose();\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachment (): Attachment {\r\n return this.attachment;\r\n }\r\n\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n setAttachment (attachment: Attachment) {\r\n if (this.attachment == attachment) return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n }\r\n\r\n setAttachmentTime (time: number) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n }\r\n\r\n /** Returns the time since the attachment was set. */\r\n getAttachmentTime (): number {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n }\r\n\r\n setToSetupPose () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {Color} from \"./Utils\";\r\nimport {BlendMode} from \"./BlendMode\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SlotData {\r\n index: number;\r\n name: string;\r\n boneData: BoneData;\r\n color = new Color(1, 1, 1, 1);\r\n attachmentName: string;\r\n blendMode: number;\r\n\r\n constructor (index: number, name: string, boneData: BoneData) {\r\n if (index < 0) throw new Error(\"index must be >= 0.\");\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n if (boneData == null) throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n}\r\n","export abstract class Texture {\r\n protected _image: HTMLImageElement;\r\n\r\n constructor (image: HTMLImageElement) {\r\n this._image = image;\r\n }\r\n\r\n getImage (): HTMLImageElement {\r\n return this._image;\r\n }\r\n\r\n abstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\r\n abstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\r\n abstract dispose (): void;\r\n\r\n\r\n public static filterFromString (text: string): TextureFilter {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(`Unknown texture filter ${text}`);\r\n }\r\n }\r\n\r\n public static wrapFromString (text: string): TextureWrap {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(`Unknown texture wrap ${text}`);\r\n }\r\n }\r\n}\r\n\r\nexport enum TextureFilter {\r\n Nearest = 9728, // WebGLRenderingContext.NEAREST\r\n Linear = 9729, // WebGLRenderingContext.LINEAR\r\n MipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n MipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\r\n MipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\r\n MipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\r\n MipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n}\r\n\r\nexport enum TextureWrap {\r\n MirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\r\n ClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\r\n Repeat = 10497 // WebGLRenderingContext.REPEAT\r\n}\r\n\r\nexport class TextureRegion {\r\n texture: PIXI.Texture;\r\n\r\n //thats for overrides\r\n size: PIXI.Rectangle = null;\r\n\r\n get width(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.width;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get height(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.height;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get u(): number {\r\n return this.texture._uvs.x0;\r\n }\r\n\r\n get v(): number {\r\n return this.texture._uvs.y0;\r\n }\r\n\r\n get u2(): number {\r\n return this.texture._uvs.x2;\r\n }\r\n\r\n get v2(): number {\r\n return this.texture._uvs.y2;\r\n }\r\n\r\n get offsetX(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.x : 0;\r\n }\r\n\r\n get offsetY(): number {\r\n console.warn(\"Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on.\");\r\n return this.spineOffsetY;\r\n }\r\n\r\n get pixiOffsetY(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.y : 0;\r\n }\r\n\r\n get spineOffsetY(): number {\r\n var tex = this.texture;\r\n return this.originalHeight - this.height - (tex.trim ? tex.trim.y : 0);\r\n }\r\n\r\n get originalWidth(): number {\r\n var tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.crop.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get originalHeight(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.crop.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get x(): number {\r\n return this.texture.frame.x;\r\n }\r\n\r\n get y(): number {\r\n return this.texture.frame.y;\r\n }\r\n\r\n get rotate(): boolean {\r\n return this.texture.rotate !== 0;\r\n }\r\n}\r\n","import {Disposable, Map} from \"./Utils\";\r\nimport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TextureAtlas implements Disposable {\r\n pages = new Array();\r\n regions = new Array();\r\n\r\n constructor(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (atlasText) {\r\n this.addSpineAtlas(atlasText, textureLoader, callback);\r\n }\r\n }\r\n\r\n addTexture(name: string, texture: PIXI.Texture) {\r\n let pages = this.pages;\r\n let page: TextureAtlasPage = null;\r\n for (var i=0;i, stripExtension: boolean) {\r\n for (var key in textures) {\r\n if (textures.hasOwnProperty(key)) {\r\n this.addTexture(stripExtension && key.indexOf('.') !== -1 ? key.substr(0, key.lastIndexOf('.')) : key, textures[key]);\r\n }\r\n }\r\n }\r\n\r\n public addSpineAtlas(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n return this.load(atlasText, textureLoader, callback);\r\n }\r\n\r\n private load(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n\r\n let reader = new TextureAtlasReader(atlasText);\r\n let tuple = new Array(4);\r\n let page: TextureAtlasPage = null;\r\n\r\n let iterateParser = () => {\r\n while (true) {\r\n let line = reader.readLine();\r\n if (line == null) {\r\n return callback && callback(this);\r\n }\r\n line = line.trim();\r\n if (line.length == 0)\r\n page = null;\r\n else if (!page) {\r\n page = new TextureAtlasPage();\r\n page.name = line;\r\n\r\n if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker.\r\n page.width = parseInt(tuple[0]);\r\n page.height = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n }\r\n // page.format = Format[tuple[0]]; we don't need format in WebGL\r\n\r\n reader.readTuple(tuple);\r\n page.minFilter = Texture.filterFromString(tuple[0]);\r\n page.magFilter = Texture.filterFromString(tuple[1]);\r\n\r\n let direction = reader.readValue();\r\n page.uWrap = TextureWrap.ClampToEdge;\r\n page.vWrap = TextureWrap.ClampToEdge;\r\n if (direction == \"x\")\r\n page.uWrap = TextureWrap.Repeat;\r\n else if (direction == \"y\")\r\n page.vWrap = TextureWrap.Repeat;\r\n else if (direction == \"xy\")\r\n page.uWrap = page.vWrap = TextureWrap.Repeat;\r\n\r\n textureLoader(line, (texture: PIXI.BaseTexture) => {\r\n page.baseTexture = texture;\r\n if (!texture.hasLoaded) {\r\n texture.width = page.width;\r\n texture.height = page.height;\r\n }\r\n this.pages.push(page);\r\n page.setFilters();\r\n\r\n if (!page.width || !page.height) {\r\n page.width = texture.realWidth;\r\n page.height = texture.realHeight;\r\n if (!page.width || !page.height) {\r\n console.log(\"ERROR spine atlas page \" + page.name + \": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)\");\r\n }\r\n }\r\n iterateParser();\r\n });\r\n this.pages.push(page);\r\n break;\r\n } else {\r\n let region: TextureAtlasRegion = new TextureAtlasRegion();\r\n region.name = line;\r\n region.page = page;\r\n\r\n let rotate: number = reader.readValue() == \"true\" ? 6 : 0;\r\n\r\n reader.readTuple(tuple);\r\n let x = parseInt(tuple[0]);\r\n let y = parseInt(tuple[1]);\r\n\r\n reader.readTuple(tuple);\r\n let width = parseInt(tuple[0]);\r\n let height = parseInt(tuple[1]);\r\n\r\n let resolution = page.baseTexture.resolution;\r\n x /= resolution;\r\n y /= resolution;\r\n width /= resolution;\r\n height /= resolution;\r\n\r\n let frame = new PIXI.Rectangle(x, y, rotate ? height : width, rotate ? width : height);\r\n\r\n if (reader.readTuple(tuple) == 4) { // split is optional\r\n // region.splits = new Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits\r\n //region.pads = Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n reader.readTuple(tuple);\r\n }\r\n }\r\n\r\n let originalWidth = parseInt(tuple[0]) / resolution;\r\n let originalHeight = parseInt(tuple[1]) / resolution;\r\n reader.readTuple(tuple);\r\n let offsetX = parseInt(tuple[0]) / resolution;\r\n let offsetY = parseInt(tuple[1]) / resolution;\r\n\r\n let orig = new PIXI.Rectangle(0, 0, originalWidth, originalHeight);\r\n let trim = new PIXI.Rectangle(offsetX, originalHeight - height - offsetY, width, height);\r\n\r\n //TODO: pixiv3 uses different frame/crop/trim\r\n\r\n if (PIXI.VERSION[0] == '4') {\r\n // pixi v4.0.0\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame, orig, trim, rotate);\r\n } else {\r\n // pixi v3.0.11\r\n var frame2 = new PIXI.Rectangle(x, y, width, height);\r\n var crop = frame2.clone();\r\n trim.width = originalWidth;\r\n trim.height = originalHeight;\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame2, crop, trim, rotate);\r\n }\r\n\r\n region.index = parseInt(reader.readValue());\r\n region.texture._updateUvs();\r\n\r\n this.regions.push(region);\r\n }\r\n }\r\n }\r\n\r\n iterateParser();\r\n }\r\n\r\n findRegion(name: string): TextureAtlasRegion {\r\n for (let i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n dispose() {\r\n for (let i = 0; i < this.pages.length; i++) {\r\n this.pages[i].baseTexture.dispose();\r\n }\r\n }\r\n}\r\n\r\nclass TextureAtlasReader {\r\n lines: Array;\r\n index: number = 0;\r\n\r\n constructor(text: string) {\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n\r\n readLine(): string {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n }\r\n\r\n readValue(): string {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n return line.substring(colon + 1).trim();\r\n }\r\n\r\n readTuple(tuple: Array): number {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n let i = 0, lastMatch = colon + 1;\r\n for (; i < 3; i++) {\r\n let comma = line.indexOf(\",\", lastMatch);\r\n if (comma == -1) break;\r\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n }\r\n tuple[i] = line.substring(lastMatch).trim();\r\n return i + 1;\r\n }\r\n}\r\n\r\nexport class TextureAtlasPage {\r\n name: string;\r\n minFilter: TextureFilter;\r\n magFilter: TextureFilter;\r\n uWrap: TextureWrap;\r\n vWrap: TextureWrap;\r\n baseTexture: PIXI.BaseTexture;\r\n width: number;\r\n height: number;\r\n\r\n public setFilters() {\r\n let tex = this.baseTexture;\r\n let filter = this.minFilter;\r\n if (filter == TextureFilter.Linear) {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n } else if (this.minFilter == TextureFilter.Nearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.mipmap = true;\r\n if (filter == TextureFilter.MipMapNearestNearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class TextureAtlasRegion extends TextureRegion {\r\n page: TextureAtlasPage;\r\n name: string;\r\n index: number;\r\n}\r\n","import {Skin} from \"./Skin\";\r\nimport {AttachmentLoader, BoundingBoxAttachment, MeshAttachment, PathAttachment, RegionAttachment} from \"./attachments\";\r\nimport {TextureAtlas} from \"./TextureAtlas\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TextureAtlasAttachmentLoader implements AttachmentLoader {\r\n atlas: TextureAtlas;\r\n\r\n constructor (atlas: TextureAtlas) {\r\n this.atlas = atlas;\r\n }\r\n\r\n /** @return May be null to not load an attachment. */\r\n newRegionAttachment (skin: Skin, name: string, path: string): RegionAttachment {\r\n let region = this.atlas.findRegion(path);\r\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n let attachment = new RegionAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n }\r\n\r\n /** @return May be null to not load an attachment. */\r\n newMeshAttachment (skin: Skin, name: string, path: string) : MeshAttachment {\r\n let region = this.atlas.findRegion(path);\r\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n let attachment = new MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n }\r\n\r\n /** @return May be null to not load an attachment. */\r\n newBoundingBoxAttachment (skin: Skin, name: string) : BoundingBoxAttachment {\r\n return new BoundingBoxAttachment(name);\r\n }\r\n\r\n /** @return May be null to not load an attachment */\r\n newPathAttachment (skin: Skin, name: string): PathAttachment {\r\n return new PathAttachment(name);\r\n }\r\n}\r\n","import {Updatable} from \"./Updatable\";\r\nimport {TransformConstraintData} from \"./TransformConstraintData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Vector2, MathUtils} from \"./Utils\";\r\nimport {Skeleton} from \"./Skeleton\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TransformConstraint implements Updatable {\r\n data: TransformConstraintData;\r\n bones: Array;\r\n target: Bone;\r\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\r\n temp = new Vector2();\r\n\r\n constructor (data: TransformConstraintData, skeleton: Skeleton) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (let i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n\r\n apply () {\r\n this.update();\r\n }\r\n\r\n update () {\r\n let rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n let target = this.target;\r\n let tm = target.matrix;\r\n let ta = tm.a, tb = tm.c, tc = tm.b, td = tm.d;\r\n let bones = this.bones;\r\n for (let i = 0, n = bones.length; i < n; i++) {\r\n let bone = bones[i];\r\n let m = bone.matrix;\r\n\r\n if (rotateMix > 0) {\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n let r = Math.atan2(tc, ta) - Math.atan2(c, a) + this.data.offsetRotation * MathUtils.degRad;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n let cos = Math.cos(r), sin = Math.sin(r);\r\n m.a = cos * a - sin * c;\r\n m.c = cos * b - sin * d;\r\n m.b = sin * a + cos * c;\r\n m.d = sin * b + cos * d;\r\n }\r\n\r\n if (translateMix > 0) {\r\n let temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n m.tx += (temp.x - bone.worldX) * translateMix;\r\n m.ty += (temp.y - bone.worldY) * translateMix;\r\n }\r\n\r\n if (scaleMix > 0) {\r\n let bs = Math.sqrt(m.a * m.a + m.b * m.b);\r\n let ts = Math.sqrt(ta * ta + tc * tc);\r\n let s = bs > 0.00001 ? (bs + (ts - bs + this.data.offsetScaleX) * scaleMix) / bs : 0;\r\n m.a *= s;\r\n m.b *= s;\r\n bs = Math.sqrt(m.c * m.c + m.d * m.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n s = bs > 0.00001 ? (bs + (ts - bs + this.data.offsetScaleY) * scaleMix) / bs : 0;\r\n m.c *= s;\r\n m.d *= s;\r\n }\r\n\r\n if (shearMix > 0) {\r\n let b = m.c, d = m.d;\r\n let by = Math.atan2(d, b);\r\n let r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(m.b, m.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r = by + (r + this.data.offsetShearY * MathUtils.degRad) * shearMix;\r\n let s = Math.sqrt(b * b + d * d);\r\n m.c = Math.cos(r) * s;\r\n m.d = Math.sin(r) * s;\r\n }\r\n }\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TransformConstraintData {\r\n name: string;\r\n bones = new Array();\r\n target: BoneData;\r\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\r\n offsetRotation = 0; offsetX = 0; offsetY = 0; offsetScaleX = 0; offsetScaleY = 0; offsetShearY = 0;\r\n\r\n constructor (name: string) {\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n}\r\n","import {Skeleton} from \"./Skeleton\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport interface Map {\r\n [key: string]: T;\r\n}\r\n\r\nexport interface Disposable {\r\n dispose (): void;\r\n}\r\n\r\nexport class Color {\r\n public static WHITE = new Color(1, 1, 1, 1);\r\n public static RED = new Color(1, 0, 0, 1);\r\n public static GREEN = new Color(0, 1, 0, 1);\r\n public static BLUE = new Color(0, 0, 1, 1);\r\n public static MAGENTA = new Color(1, 0, 1, 1);\r\n\r\n constructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\r\n }\r\n\r\n set (r: number, g: number, b: number, a: number) {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n this.clamp();\r\n return this;\r\n }\r\n\r\n setFromColor (c: Color) {\r\n this.r = c.r;\r\n this.g = c.g;\r\n this.b = c.b;\r\n this.a = c.a;\r\n return this;\r\n }\r\n\r\n setFromString (hex: string) {\r\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n return this;\r\n }\r\n\r\n add (r: number, g: number, b: number, a: number) {\r\n this.r += r;\r\n this.g += g;\r\n this.b += b;\r\n this.a += a;\r\n this.clamp();\r\n return this;\r\n }\r\n\r\n clamp () {\r\n if (this.r < 0) this.r = 0;\r\n else if (this.r > 1) this.r = 1;\r\n\r\n if (this.g < 0) this.g = 0;\r\n else if (this.g > 1) this.g = 1;\r\n\r\n if (this.b < 0) this.b = 0;\r\n else if (this.b > 1) this.b = 1;\r\n\r\n if (this.a < 0) this.a = 0;\r\n else if (this.a > 1) this.a = 1;\r\n return this;\r\n }\r\n}\r\n\r\nexport class MathUtils {\r\n static PI = 3.1415927;\r\n static PI2 = MathUtils.PI * 2;\r\n static radiansToDegrees = 180 / MathUtils.PI;\r\n static radDeg = MathUtils.radiansToDegrees;\r\n static degreesToRadians = MathUtils.PI / 180;\r\n static degRad = MathUtils.degreesToRadians;\r\n\r\n static clamp (value: number, min: number, max: number) {\r\n if (value < min) return min;\r\n if (value > max) return max;\r\n return value;\r\n }\r\n\r\n static cosDeg (degrees: number) {\r\n return Math.cos(degrees * MathUtils.degRad);\r\n }\r\n\r\n static sinDeg (degrees: number) {\r\n return Math.sin(degrees * MathUtils.degRad);\r\n }\r\n\r\n static signum (value: number): number {\r\n return value >= 0 ? 1 : -1;\r\n }\r\n\r\n static toInt (x: number) {\r\n return x > 0 ? Math.floor(x) : Math.ceil(x);\r\n }\r\n\r\n static cbrt (x: number) {\r\n var y = Math.pow(Math.abs(x), 1/3);\r\n return x < 0 ? -y : y;\r\n }\r\n}\r\n\r\nexport class Utils {\r\n static SUPPORTS_TYPED_ARRAYS = typeof(Float32Array) !== \"undefined\";\r\n\r\n static arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\r\n for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n dest[j] = source[i];\r\n }\r\n }\r\n\r\n static setArraySize (array: Array, size: number, value: any = 0): Array {\r\n let oldSize = array.length;\r\n if (oldSize == size) return array;\r\n array.length = size;\r\n if (oldSize < size) {\r\n for (let i = oldSize; i < size; i++) array[i] = value;\r\n }\r\n return array;\r\n }\r\n\r\n static newArray (size: number, defaultValue: T): Array {\r\n let array = new Array(size);\r\n for (let i = 0; i < size; i++) array[i] = defaultValue;\r\n return array;\r\n }\r\n\r\n static newFloatArray (size: number): ArrayLike {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n return new Float32Array(size)\r\n } else {\r\n let array = new Array(size);\r\n for (let i = 0; i < array.length; i++) array[i] = 0;\r\n return array;\r\n }\r\n }\r\n\r\n static toFloatArray (array: Array) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n }\r\n}\r\n\r\nexport class DebugUtils {\r\n static logBones(skeleton: Skeleton) {\r\n for (let i = 0; i < skeleton.bones.length; i++) {\r\n let bone = skeleton.bones[i];\r\n let m = bone.matrix;\r\n console.log(bone.data.name + \", \" + m.a + \", \" + m.b + \", \" + m.c + \", \" + m.d + \", \" + m.tx + \", \" + m.ty);\r\n }\r\n }\r\n}\r\n\r\nexport class Pool {\r\n private items = new Array();\r\n private instantiator: () => T;\r\n\r\n constructor (instantiator: () => T) {\r\n this.instantiator = instantiator;\r\n }\r\n\r\n obtain () {\r\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n }\r\n\r\n free (item: T) {\r\n this.items.push(item);\r\n }\r\n\r\n freeAll (items: ArrayLike) {\r\n for (let i = 0; i < items.length; i++) this.items[i] = items[i];\r\n }\r\n\r\n clear () {\r\n this.items.length = 0;\r\n }\r\n}\r\n\r\nexport class Vector2 {\r\n constructor (public x = 0, public y = 0) {\r\n }\r\n\r\n set (x: number, y: number): Vector2 {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n }\r\n\r\n length () {\r\n let x = this.x;\r\n let y = this.y;\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n\r\n normalize () {\r\n let len = this.length();\r\n if (len != 0) {\r\n this.x /= len;\r\n this.y /= len;\r\n }\r\n return this;\r\n }\r\n}\r\n\r\nexport class TimeKeeper {\r\n maxDelta = 0.064;\r\n framesPerSecond = 0;\r\n delta = 0;\r\n totalTime = 0;\r\n\r\n private lastTime = Date.now() / 1000;\r\n private frameCount = 0;\r\n private frameTime = 0;\r\n\r\n update () {\r\n var now = Date.now() / 1000;\r\n this.delta = now - this.lastTime;\r\n this.frameTime += this.delta;\r\n this.totalTime += this.delta;\r\n if (this.delta > this.maxDelta) this.delta = this.maxDelta;\r\n this.lastTime = now;\r\n\r\n this.frameCount++;\r\n if (this.frameTime > 1) {\r\n this.framesPerSecond = this.frameCount / this.frameTime;\r\n this.frameTime = 0;\r\n this.frameCount = 0;\r\n }\r\n }\r\n}\r\n","import {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport abstract class Attachment {\r\n name: string;\r\n\r\n constructor (name: string) {\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n}\r\n\r\nexport abstract class VertexAttachment extends Attachment {\r\n bones: Array;\r\n vertices: ArrayLike;\r\n worldVerticesLength = 0;\r\n\r\n constructor (name: string) {\r\n super(name);\r\n }\r\n\r\n computeWorldVertices (slot: Slot, worldVertices: ArrayLike) {\r\n this.computeWorldVerticesWith(slot, 0, this.worldVerticesLength, worldVertices, 0);\r\n }\r\n\r\n /** Transforms local vertices to world coordinates.\r\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\r\n * @param offset The worldVertices index to begin writing values. */\r\n computeWorldVerticesWith (slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number) {\r\n count += offset;\r\n let skeleton = slot.bone.skeleton;\r\n let x = skeleton.x, y = skeleton.y;\r\n let deformArray = slot.attachmentVertices;\r\n let vertices = this.vertices;\r\n let bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0) vertices = deformArray;\r\n let bone = slot.bone;\r\n let m = bone.matrix;\r\n x += m.tx;\r\n y += m.ty;\r\n let a = m.a, b = m.c, c = m.b, d = m.d;\r\n for (let v = start, w = offset; w < count; v += 2, w += 2) {\r\n let vx = vertices[v], vy = vertices[v + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n let v = 0, skip = 0;\r\n for (let i = 0; i < start; i += 2) {\r\n let n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n let skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (let w = offset, b = skip * 3; w < count; w += 2) {\r\n let wx = x, wy = y;\r\n let n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n let bone = skeletonBones[bones[v]];\r\n let m = bone.matrix;\r\n let vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\r\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n } else {\r\n let deform = deformArray;\r\n for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += 2) {\r\n let wx = x, wy = y;\r\n let n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n let bone = skeletonBones[bones[v]];\r\n let m = bone.matrix;\r\n let vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\r\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n }\r\n\r\n /** Returns true if a deform originally applied to the specified attachment should be applied to this attachment. */\r\n applyDeform (sourceAttachment: VertexAttachment) {\r\n return this == sourceAttachment;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum AttachmentType {\r\n Region, BoundingBox, Mesh, LinkedMesh, Path\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class BoundingBoxAttachment extends VertexAttachment {\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor(name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {TextureRegion} from \"../Texture\";\r\nimport {Color, Utils} from \"../Utils\";\r\nimport {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class MeshAttachment extends VertexAttachment {\r\n region: TextureRegion;\r\n path: string;\r\n regionUVs: ArrayLike;\r\n triangles: Array;\r\n color = new Color(1, 1, 1, 1);\r\n hullLength: number;\r\n private parentMesh: MeshAttachment;\r\n inheritDeform = false;\r\n tempColor = new Color(0, 0, 0, 0);\r\n\r\n constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\r\n return [];\r\n //nothing\r\n }\r\n\r\n updateUVs(region: TextureRegion, uvs: ArrayLike): ArrayLike {\r\n let regionUVs = this.regionUVs;\r\n let n = regionUVs.length;\r\n if (!uvs || uvs.length != n) {\r\n uvs = Utils.newFloatArray(n);\r\n }\r\n\r\n if (region == null) {\r\n return;\r\n }\r\n\r\n let texture = region.texture;\r\n let r = texture._uvs;\r\n let w1 = region.width, h1 = region.height, w2 = region.originalWidth, h2 = region.originalHeight;\r\n let x = region.offsetX, y = region.pixiOffsetY;\r\n\r\n for (let i = 0; i < n; i += 2) {\r\n let u = this.regionUVs[i], v = this.regionUVs[i + 1];\r\n u = (u * w2 - x) / w1;\r\n v = (v * h2 - y) / h1;\r\n uvs[i] = (r.x0 * (1 - u) + r.x1 * u) * (1 - v) + (r.x3 * (1 - u) + r.x2 * u) * v;\r\n uvs[i + 1] = (r.y0 * (1 - u) + r.y1 * u) * (1 - v) + (r.y3 * (1 - u) + r.y2 * u) * v;\r\n }\r\n\r\n return uvs;\r\n }\r\n\r\n applyDeform(sourceAttachment: VertexAttachment): boolean {\r\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n }\r\n\r\n getParentMesh() {\r\n return this.parentMesh;\r\n }\r\n\r\n /** @param parentMesh May be null. */\r\n setParentMesh(parentMesh: MeshAttachment) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n }\r\n }\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathAttachment extends VertexAttachment {\r\n lengths: Array;\r\n closed = false; constantSpeed = false;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor (name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {Attachment} from \"./Attachment\";\r\nimport {Color, Utils} from \"../Utils\";\r\nimport {TextureRegion} from \"../Texture\";\r\nimport {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class RegionAttachment extends Attachment {\r\n x = 0; y = 0; scaleX = 1; scaleY = 1; rotation = 0; width = 0; height = 0;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n path: string;\r\n region: TextureRegion;\r\n\r\n constructor (name:string) {\r\n super(name);\r\n }\r\n\r\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\r\n return [];\r\n //nothing\r\n }\r\n}\r\n","export {Attachment, VertexAttachment} from \"./Attachment\";\r\nexport {AttachmentLoader} from \"./AttachmentLoader\";\r\nexport {AttachmentType} from \"./AttachmentType\";\r\nexport {BoundingBoxAttachment} from \"./BoundingBoxAttachment\";\r\nexport {MeshAttachment} from \"./MeshAttachment\";\r\nexport {PathAttachment} from \"./PathAttachment\";\r\nexport {RegionAttachment} from \"./RegionAttachment\";\r\n","export * from \"./attachments\";\r\n\r\nexport {\r\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\r\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\r\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\r\n Animation, CurveTimeline\r\n} from \"./Animation\";\r\nexport {AnimationState} from \"./AnimationState\";\r\nexport {AnimationStateData} from \"./AnimationStateData\";\r\nexport {BlendMode} from \"./BlendMode\";\r\nexport {Bone} from \"./Bone\";\r\nexport {BoneData} from \"./BoneData\";\r\nexport {Event} from \"./Event\";\r\nexport {EventData} from \"./EventData\";\r\nexport {IkConstraint} from \"./IkConstraint\";\r\nexport {IkConstraintData} from \"./IkConstraintData\";\r\nexport {PathConstraint} from \"./PathConstraint\";\r\nexport {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\r\nexport {Skeleton} from \"./Skeleton\";\r\nexport {SkeletonBounds} from \"./SkeletonBounds\";\r\nexport {SkeletonData} from \"./SkeletonData\";\r\nexport {SkeletonJson} from \"./SkeletonJson\";\r\nexport {Skin} from \"./Skin\";\r\nexport {Slot} from \"./Slot\";\r\nexport {SlotData} from \"./SlotData\";\r\nexport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\r\nexport {TextureAtlas, TextureAtlasRegion} from \"./TextureAtlas\";\r\nexport {TextureAtlasAttachmentLoader} from \"./TextureAtlasAttachmentLoader\";\r\nexport {TransformConstraint} from \"./TransformConstraint\";\r\nexport {TransformConstraintData} from \"./TransformConstraintData\";\r\nexport {Updatable} from \"./Updatable\";\r\nexport {Disposable, Map, Utils, Pool, MathUtils, Color, Vector2} from \"./Utils\";\r\n","import * as spine from \"./core\";\r\n\r\nexport function atlasParser() {\r\n return function (resource: PIXI.loaders.Resource, next: () => any) {\r\n // skip if no data, its not json, or it isn't atlas data\r\n if (!resource.data || !resource.isJson || !resource.data.bones) {\r\n return next();\r\n }\r\n\r\n var metadataAtlas = resource.metadata ? resource.metadata.spineAtlas: null;\r\n if (metadataAtlas === false) {\r\n return next();\r\n }\r\n if (metadataAtlas && metadataAtlas.pages) {\r\n //its an atlas!\r\n var spineJsonParser = new spine.SkeletonJson(new spine.TextureAtlasAttachmentLoader(metadataAtlas));\r\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\r\n\r\n resource.spineData = skeletonData;\r\n resource.spineAtlas = metadataAtlas;\r\n\r\n return next();\r\n }\r\n\r\n var metadataAtlasSuffix = '.atlas';\r\n if (resource.metadata && resource.metadata.spineAtlasSuffix) {\r\n metadataAtlasSuffix = resource.metadata.spineAtlasSuffix;\r\n }\r\n\r\n /**\r\n * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files\r\n * that correspond to the spine file are in the same base URL and that the .json and .atlas files\r\n * have the same name\r\n */\r\n var atlasPath = resource.url.substr(0, resource.url.lastIndexOf('.')) + metadataAtlasSuffix;\r\n //remove the baseUrl\r\n atlasPath = atlasPath.replace(this.baseUrl, '');\r\n\r\n var atlasOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n xhrType: PIXI.loaders.Resource.XHR_RESPONSE_TYPE.TEXT,\r\n metadata: resource.metadata ? resource.metadata.spineMetadata : null\r\n };\r\n var imageOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n metadata: resource.metadata ? resource.metadata.imageMetadata: null\r\n };\r\n var baseUrl = resource.url.substr(0, resource.url.lastIndexOf('/') + 1);\r\n //remove the baseUrl\r\n baseUrl = baseUrl.replace(this.baseUrl, '');\r\n\r\n var adapter = imageLoaderAdapter(this, resource.name + '_atlas_page_', baseUrl, imageOptions);\r\n\r\n this.add(resource.name + '_atlas', atlasPath, atlasOptions, function () {\r\n new spine.TextureAtlas(this.xhr.responseText, adapter, function(spineAtlas) {\r\n var spineJsonParser = new spine.SkeletonJson(new spine.TextureAtlasAttachmentLoader(spineAtlas));\r\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\r\n\r\n resource.spineData = skeletonData;\r\n resource.spineAtlas = spineAtlas;\r\n\r\n next();\r\n });\r\n });\r\n };\r\n}\r\n\r\nexport function imageLoaderAdapter(loader: any, namePrefix: any, baseUrl: any, imageOptions: any) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\r\n {\r\n baseUrl += '/';\r\n }\r\n return function(line: String, callback: (baseTexture: PIXI.BaseTexture) => any) {\r\n var name = namePrefix + line;\r\n var url = baseUrl + line;\r\n loader.add(name, url, imageOptions, (resource: PIXI.loaders.Resource) => {\r\n callback(resource.texture.baseTexture);\r\n });\r\n }\r\n}\r\n\r\nexport function syncImageLoaderAdapter (baseUrl: any, crossOrigin: any) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\r\n {\r\n baseUrl += '/';\r\n }\r\n return function(line: any, callback: any) {\r\n callback(PIXI.BaseTexture.fromImage(line, crossOrigin));\r\n }\r\n}\r\n\r\nPIXI.loaders.Loader.addPixiMiddleware(atlasParser);\r\nPIXI.loader.use(atlasParser());\r\n","import * as core from \"./core\";\r\nimport * as loaders from \"./loaders\";\r\n\r\nexport {core, loaders}\r\nexport {Spine, SpineMesh, SpineSprite} from \"./Spine\";\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["../pixify/node_modules/browser-pack/_prelude.js","src/Spine.ts","src/core/Animation.ts","src/core/AnimationState.ts","src/core/AnimationStateData.ts","src/core/AtlasAttachmentLoader.ts","src/core/BlendMode.ts","src/core/Bone.ts","src/core/BoneData.ts","src/core/Event.ts","src/core/EventData.ts","src/core/IkConstraint.ts","src/core/IkConstraintData.ts","src/core/PathConstraint.ts","src/core/PathConstraintData.ts","src/core/Skeleton.ts","src/core/SkeletonBounds.ts","src/core/SkeletonData.ts","src/core/SkeletonJson.ts","src/core/Skin.ts","src/core/Slot.ts","src/core/SlotData.ts","src/core/Texture.ts","src/core/TextureAtlas.ts","src/core/TransformConstraint.ts","src/core/TransformConstraintData.ts","src/core/Utils.ts","src/core/attachments/Attachment.ts","src/core/attachments/AttachmentType.ts","src/core/attachments/BoundingBoxAttachment.ts","src/core/attachments/MeshAttachment.ts","src/core/attachments/PathAttachment.ts","src/core/attachments/RegionAttachment.ts","src/core/attachments/index.ts","src/core/index.ts","src/loaders.ts","src/index.ts"],"names":["f","exports","module","define","amd","g","window","global","self","this","PIXI","spine","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","SlotContainerUpdateTransformV3","pt","parent","worldTransform","wt","lt","localTransform","b","c","d","tx","ty","worldAlpha","alpha","_currentBounds","TransformBase","Bone","yDown","tempRgb","SpineSprite","_super","tex","__extends","Sprite","SpineMesh","texture","vertices","uvs","indices","drawMode","mesh","Mesh","Spine","spineData","hackTextureBySlotName","slotName","size","index","skeleton","findSlotIndex","hackTextureBySlotIndex","Skeleton","updateWorldTransform","stateData","AnimationStateData","state","AnimationState","slotContainers","slots","slot","attachment","slotContainer","Container","push","addChild","RegionAttachment","spriteName","region","name","sprite","createSprite","currentSprite","currentSpriteName","MeshAttachment","createMesh","currentMesh","currentMeshName","autoUpdate","tintRgb","Float32Array","Object","defineProperty","prototype","updateTransform","autoUpdateTransform","value","utils","rgb2hex","hex2rgb","update","dt","apply","drawOrder","children","data","r0","g0","b0","attColor","color","ar","visible","sprites","undefined","transform","lt_1","matrix2d","_dirtyVersion","version","isStatic","operMode","position","_dirtyLocal","TransformStatic","_dirtyParentVersion","_versionLocal","bone","matrix","copy","Matrix","displayObjectUpdateTransform","tint","blendMode","meshName","meshes","computeWorldVertices","VERSION","setSpriteRegion","scale","x","width","originalWidth","y","height","originalHeight","scaleX","scaleY","setMeshRegion","updateUVs","dirty","globalAutoUpdate","lastTime","Date","now","timeDelta","defName","tempAttachment","tempRegion","rotation","MathUtils","degRad","anchor","strip","regionUVs","Uint16Array","triangles","DRAW_MODES","TRIANGLES","canvasPadding","slotIndex","TextureRegion","Utils_1","attachments_1","Animation","timelines","duration","time","loop","events","mix","binarySearch","values","target","step","low","high","current","linearSearch","last","CurveTimeline","frameCount","curves","Utils","newFloatArray","BEZIER_SIZE","getFrameCount","setLinear","frameIndex","LINEAR","setStepped","STEPPED","getCurveType","type","BEZIER","setCurve","cx1","cy1","cx2","cy2","tmpx","tmpy","dddfx","dddfy","ddfx","ddfy","dfx","dfy","getCurvePercent","percent","clamp","start","prevX","prevY","RotateTimeline","frames","setFrame","degrees","ROTATION","bones","boneIndex","ENTRIES","amount_1","PREV_ROTATION","frame","prevRotation","frameTime","PREV_TIME","amount","TranslateTimeline","X","Y","PREV_X","PREV_Y","ScaleTimeline","ShearTimeline","shearX","shearY","ColorTimeline","R","G","B","A","PREV_R","PREV_G","PREV_B","PREV_A","add","set","AttachmentTimeline","attachmentNames","Array","attachmentName","setAttachment","getAttachment","EventTimeline","event","firedEvents","Number","MAX_VALUE","DrawOrderTimeline","drawOrders","drawOrderToSetupIndex","arrayCopy","DeformTimeline","frameVertices","slotAttachment","VertexAttachment","applyDeform","vertexCount","verticesArray","attachmentVertices","setArraySize","lastVertices","prevVertices","nextVertices","prev","IkConstraintTimeline","bendDirection","MIX","BEND_DIRECTION","constraint","ikConstraints","ikConstraintIndex","PREV_MIX","Math","floor","PREV_BEND_DIRECTION","TransformConstraintTimeline","rotateMix","translateMix","scaleMix","shearMix","ROTATE","TRANSLATE","SCALE","SHEAR","transformConstraints","transformConstraintIndex","PREV_ROTATE","PREV_TRANSLATE","PREV_SCALE","PREV_SHEAR","rotate","translate","shear","PathConstraintPositionTimeline","VALUE","pathConstraints","pathConstraintIndex","PREV_VALUE","PathConstraintSpacingTimeline","spacing","PathConstraintMixTimeline","tracks","timeScale","delta","next","nextTime","delay","nextDelta","setCurrent","endTime","clearTrack","previous","previousDelta","mixTime","animation","previousTime","mixDuration","ii","nn","event_1","onEvent","count","toInt","onComplete","clearTracks","trackIndex","onEnd","freeAll","entry","expandToIndex","getMix","onStart","setAnimation","animationName","skeletonData","findAnimation","setAnimationWith","TrackEntry","addAnimation","addAnimationWith","hasAnimation","getCurrent","setAnimationByName","deprecatedWarning1","console","warn","addAnimationByName","deprecatedWarning2","hasAnimationByName","deprecatedWarning3","reset","isComplete","animationToMixTime","defaultMix","setMix","fromName","toName","from","to","setMixWith","setMixByName","key","AtlasAttachmentLoader","atlas","newRegionAttachment","skin","path","findRegion","newMeshAttachment","newBoundingBoxAttachment","BoundingBoxAttachment","newPathAttachment","PathAttachment","BlendMode","BoneData_1","ax","ay","arotation","ascaleX","ascaleY","ashearX","ashearY","appliedValid","sorted","setToSetupPose","updateWorldTransformWith","m","rotationY","la","cosDeg","lb","lc","sinDeg","ld","flipX","flipY","pa","pb","pc","pd","transformMode","TransformMode","Normal","OnlyTranslation","NoRotationOrReflection","prx","abs","atan2","radDeg","rx","ry","NoScale","NoScaleOrReflection","cos","sin","za","zc","sqrt","PI","zb","zd","InheritRotation","temp","InheritScale","psx","psy","getWorldRotationX","getWorldRotationY","getWorldScaleX","getWorldScaleY","worldToLocalRotationX","pm","worldToLocalRotationY","rotateWorld","updateAppliedTransform","pid","dx","dy","ia","id","ib","ic","ra","rb","rc","rd","det","worldToLocal","world","invDet","localToWorld","local","BoneData","Event","EventData","IkConstraint","level","findBone","getOrder","order","apply1","worldX","worldY","apply2","targetX","targetY","pp","rotationIK","child","bendDir","px","py","csx","os1","os2","s2","cx","cy","cwx","cwy","ppm","l1","l2","a1","a2","outer","acos","aa","bb","dd","ta","c1","c2","q","r1","minAngle","minDist","minX","minY","maxAngle","maxDist","maxX","maxY","angle","os","IkConstraintData","PathConstraintData_1","PathConstraint","spaces","positions","lengths","segments","findSlot","spacingMode","lengthSpacing","SpacingMode","Length","rotateMode","tangents","RotateMode","Tangent","ChainScale","boneCount","spacesCount","length_1","max","computeWorldPositions","positionMode","PositionMode","Percent","boneX","boneY","offsetRotation","tip","Chain","p","length_2","length_3","PI2","percentPosition","percentSpacing","out","closed","verticesLength","worldVerticesLength","curveCount","prevCurve","NONE","constantSpeed","pathLength_1","curve","space","BEFORE","computeWorldVerticesWith","addBeforePosition","AFTER","addAfterPosition","length_4","addCurvePosition","pathLength","x1","y1","x2","y2","w","curveLength","segment","length_5","length_6","isNaN","tt","ttt","uu","uuu","ut","ut3","uut3","utt3","PathConstraintData","Slot_1","Bone_1","IkConstraint_1","TransformConstraint_1","PathConstraint_1","_updateCache","updateCacheReset","boneData","parent_1","slotData","Slot","ikConstraintData","transformConstraintData","TransformConstraint","pathConstraintData","Color","updateCache","ikCount","transformCount","pathCount","constraintCount","sortIkConstraint","sortTransformConstraint","sortPathConstraint","sortBone","constrained","indexOf","sortReset","slotBone","sortPathConstraintAttachment","defaultSkin","skins","sortPathConstraintAttachmentWith","attachments","pathBones","setBonesToSetupPose","setSlotsToSetupPose","getRootBone","boneName","findBoneIndex","setSkinByName","skinName","findSkin","setSkin","newSkin","attachAll","name_1","getAttachmentByName","findIkConstraint","constraintName","ikConstraint","findTransformConstraint","findPathConstraint","getBounds","offset","POSITIVE_INFINITY","NEGATIVE_INFINITY","updateWorldVertices","min","SkeletonBounds","boundingBoxes","polygons","polygonPool","Pool","updateAabb","slotCount","boundingBox","polygon","obtain","aabbCompute","aabbContainsPoint","aabbIntersectsSegment","aabbIntersectsSkeleton","bounds","containsPoint","containsPointPolygon","prevIndex","inside","vertexY","vertexX","intersectsSegment","intersectsSegmentPolygon","width12","height12","det1","x3","y3","x4","y4","det2","width34","height34","det3","getPolygon","getWidth","getHeight","SkeletonData","animations","fps","findEvent","eventDataName","findPathConstraintIndex","pathConstraintName","SkeletonData_1","SlotData_1","Event_1","IkConstraintData_1","TransformConstraintData_1","Skin_1","EventData_1","Animation_1","SkeletonJson","attachmentLoader","linkedMeshes","readSkeletonData","json","root","JSON","parse","skeletonMap","hash","imagesPath","images","boneMap","parentName","getValue","hasOwnProperty","transformModeLegacy","transformModeFromString","slotMap","SlotData","setFromString","blendModeFromString","ik","constraintMap","j","targetName","TransformConstraintData","offsetX","offsetY","offsetScaleX","offsetScaleY","offsetShearY","positionModeFromString","spacingModeFromString","rotateModeFromString","Fixed","skinMap","Skin","entryName","readAttachment","addAttachment","linkedMesh","parent_2","setParentMesh","eventName","eventMap","intValue","floatValue","stringValue","animationMap","readAnimation","map","box","readVertices","parent_3","inheritDeform","LinkedMesh","hullLength","newArray","toFloatArray","weights","timelineName","timelineMap","timeline","valueMap","readCurve","timelineScale","paths","deform","deformName","deformMap","weighted","deformLength","verticesValue","drawOrderNode","draworder","drawOrderMap","offsets","unchanged","originalIndex","unchangedIndex","offsetMap","eventData","toString","prop","defaultValue","str","BLEND_MODES","MULTIPLY","ADD","SCREEN","NORMAL","toLowerCase","inheritRotation","inheritScale","dictionary","oldSkin","skinAttachment","attachmentTime","setAttachmentTime","getAttachmentTime","setFromColor","Texture","image","_image","getImage","filterFromString","text","TextureFilter","Nearest","Linear","MipMap","MipMapNearestNearest","MipMapLinearNearest","MipMapNearestLinear","MipMapLinearLinear","wrapFromString","TextureWrap","MirroredRepeat","ClampToEdge","Repeat","crop","trim","orig","_uvs","x0","y0","spineOffsetY","Texture_1","TextureAtlas","atlasText","textureLoader","callback","pages","regions","addSpineAtlas","addTexture","page","baseTexture","TextureAtlasPage","realWidth","realHeight","minFilter","magFilter","uWrap","vWrap","TextureAtlasRegion","addTextureHash","textures","stripExtension","substr","lastIndexOf","load","_this","reader","TextureAtlasReader","tuple","iterateParser","line","readLine","readTuple","parseInt","direction","readValue","hasLoaded","setFilters","log","resolution","Rectangle","frame2","clone","_updateUvs","dispose","lines","split","colon","substring","lastMatch","comma","filter","scaleMode","SCALE_MODES","NEAREST","mipmap","arguments","Vector2","tb","tc","td","modified","ts","by","hex","charAt","WHITE","RED","GREEN","BLUE","MAGENTA","signum","ceil","cbrt","pow","radiansToDegrees","degreesToRadians","source","sourceStart","dest","destStart","numElements","array","oldSize","SUPPORTS_TYPED_ARRAYS","DebugUtils","logBones","instantiator","items","pop","free","item","clear","normalize","len","TimeKeeper","maxDelta","framesPerSecond","totalTime","Attachment","worldVertices","deformArray","v","skip","skeletonBones","wx","wy","vx","vy","weight","v_1","sourceAttachment","AttachmentType","Attachment_1","tempColor","premultipliedAlpha","w1","h1","w2","h2","pixiOffsetY","parentMesh","getParentMesh","AttachmentType_1","BoundingBoxAttachment_1","MeshAttachment_1","PathAttachment_1","RegionAttachment_1","__export","AnimationState_1","AnimationStateData_1","BlendMode_1","Skeleton_1","SkeletonBounds_1","SkeletonJson_1","TextureAtlas_1","AtlasAttachmentLoader_1","atlasParser","resource","isJson","metadataAtlas","metadata","spineAtlas","spineJsonParser","metadataAtlasSuffix","spineAtlasSuffix","atlasPath","url","replace","baseUrl","atlasOptions","crossOrigin","xhrType","loaders","Resource","XHR_RESPONSE_TYPE","TEXT","spineMetadata","imageOptions","imageMetadata","adapter","imageLoaderAdapter","xhr","responseText","loader","namePrefix","syncImageLoaderAdapter","BaseTexture","fromImage","Loader","addPixiMiddleware","use","core","Spine_1"],"mappings":";;;;;;;CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,MAAAJ,EAAAK,OAAAL,EAAAK,UAAAC,MAAAX,MAAA,WAAA,MAAA,SAAAY,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAjB,GAAA,GAAAsB,OAAA,uBAAAL,EAAA,IAAA,MAAAjB,GAAAuB,KAAA,m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hB,QAAAmqB,GAAmCG,EAAaC,EAAiBhB,EAAcS,GAK3E,MAJIT,IAAWA,EAAQ9H,YAAY,OAAU8H,EAAQ38B,OAAO,IAExD28B,GAAW,KAER,SAASvH,EAAc1B,GAC1B,GAAI9vB,GAAO+5B,EAAavI,EACpBqH,EAAME,EAAUvH,CACpBsI,GAAO5uB,IAAIlL,EAAM64B,EAAKW,EAAc,SAACpB,GACjCtI,EAASsI,EAASr6B,QAAQqyB,gBAKtC,QAAA4J,GAAwCjB,EAAcE,GAKlD,MAJIF,IAAWA,EAAQ9H,YAAY,OAAU8H,EAAQ38B,OAAO,IAExD28B,GAAW,KAER,SAASvH,EAAW1B,GACvBA,EAAS10B,KAAK6+B,YAAYC,UAAU1I,EAAMyH,KAvFlD,GAAY59B,GAAKS,EAAM,SAEPnB,GAAAw9B,YAAWA,EAiEXx9B,EAAAg/B,mBAAkBA,EAclBh/B,EAAAq/B,uBAAsBA,EAUtC5+B,KAAK+9B,QAAQgB,OAAOC,kBAAkBjC,GACtC/8B,KAAK0+B,OAAOO,IAAIlC,qDC5FhB,IAAYmC,GAAIx+B,EAAM,SAGdnB,GAAA2/B,KAAIA,CAFZ,IAAYnB,GAAOr9B,EAAM,YAEXnB,GAAAw+B,QAAOA,CACrB,IAAAoB,GAAAz+B,EAA4C,UAApCnB,GAAA2D,MAAAi8B,EAAAj8B,MAAO3D,EAAAmD,UAAAy8B,EAAAz8B,UAAWnD,EAAA8C,YAAA88B,EAAA98B","file":"pixi-spine.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o, uvs?: ArrayLike, indices?: ArrayLike, drawMode?: number) {\n super(texture, vertices, uvs, indices, drawMode);\n }\n}\n\n/**\n * A class that enables the you to import and run your spine animations in pixi.\n * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class\n * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\n *\n * ```js\n * var spineAnimation = new PIXI.Spine(spineData);\n * ```\n *\n * @class\n * @extends Container\n * @memberof PIXI.spine\n * @param spineData {object} The spine data loaded from a spine atlas.\n */\nexport class Spine extends PIXI.Container {\n static globalAutoUpdate: boolean = true;\n\n tintRgb: ArrayLike;\n spineData: spine.SkeletonData;\n skeleton: spine.Skeleton;\n stateData: spine.AnimationStateData;\n state: spine.AnimationState;\n slotContainers: Array;\n\n constructor(spineData: spine.SkeletonData) {\n super();\n\n if (!spineData) {\n throw new Error('The spineData param is required.');\n }\n\n if ((typeof spineData) === \"string\") {\n throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas(\"YOUR_RESOURCE_NAME\") from now on.');\n }\n\n /**\n * The spineData object\n *\n * @member {object}\n */\n this.spineData = spineData;\n\n /**\n * A spine Skeleton object\n *\n * @member {object}\n */\n this.skeleton = new spine.Skeleton(spineData);\n this.skeleton.updateWorldTransform();\n\n /**\n * A spine AnimationStateData object created from the spine data passed in the constructor\n *\n * @member {object}\n */\n this.stateData = new spine.AnimationStateData(spineData);\n\n /**\n * A spine AnimationState object created from the spine AnimationStateData object\n *\n * @member {object}\n */\n this.state = new spine.AnimationState(this.stateData);\n\n /**\n * An array of containers\n *\n * @member {Container[]}\n */\n this.slotContainers = [];\n\n for (var i = 0, n = this.skeleton.slots.length; i < n; i++) {\n var slot = this.skeleton.slots[i];\n var attachment : any = slot.attachment;\n var slotContainer = new PIXI.Container();\n this.slotContainers.push(slotContainer);\n this.addChild(slotContainer);\n\n if (attachment instanceof spine.RegionAttachment) {\n var spriteName = (attachment.region as TextureAtlasRegion).name;\n var sprite = this.createSprite(slot, attachment, spriteName);\n slot.currentSprite = sprite;\n slot.currentSpriteName = spriteName;\n slotContainer.addChild(sprite);\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = this.createMesh(slot, attachment);\n slot.currentMesh = mesh;\n slot.currentMeshName = attachment.name;\n slotContainer.addChild(mesh);\n }\n else {\n continue;\n }\n\n }\n\n /**\n * Should the Spine object update its transforms\n *\n * @member {boolean}\n */\n this.autoUpdate = true;\n\n /**\n * The tint applied to all spine slots. This is a [r,g,b] value. A value of [1,1,1] will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n */\n this.tintRgb = new Float32Array([1, 1, 1]);\n }\n\n /**\n * If this flag is set to true, the spine animation will be autoupdated every time\n * the object id drawn. The down side of this approach is that the delta time is\n * automatically calculated and you could miss out on cool effects like slow motion,\n * pause, skip ahead and the sorts. Most of these effects can be achieved even with\n * autoupdate enabled but are harder to achieve.\n *\n * @member {boolean}\n * @memberof PIXI.spine.Spine#\n * @default true\n */\n get autoUpdate(): boolean {\n return (this.updateTransform === Spine.prototype.autoUpdateTransform);\n }\n\n set autoUpdate(value: boolean) {\n this.updateTransform = value ? Spine.prototype.autoUpdateTransform : PIXI.Container.prototype.updateTransform;\n }\n\n /**\n * The tint applied to the spine object. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @memberof PIXI.spine.Spine#\n * @default 0xFFFFFF\n */\n get tint(): number {\n return PIXI.utils.rgb2hex(this.tintRgb);\n }\n\n set tint(value: number) {\n this.tintRgb = PIXI.utils.hex2rgb(value, this.tintRgb);\n }\n\n /**\n * Update the spine skeleton and its animations by delta time (dt)\n *\n * @param dt {number} Delta time. Time by which the animation should be updated\n */\n update(dt: number) {\n this.state.update(dt);\n this.state.apply(this.skeleton);\n this.skeleton.updateWorldTransform();\n\n let drawOrder = this.skeleton.drawOrder;\n let slots = this.skeleton.slots;\n\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n this.children[i] = this.slotContainers[drawOrder[i].data.index];\n }\n\n var r0 = this.tintRgb[0];\n var g0 = this.tintRgb[1];\n var b0 = this.tintRgb[2];\n\n for (i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n var attachment = slot.attachment;\n var slotContainer = this.slotContainers[i];\n\n if (!attachment) {\n slotContainer.visible = false;\n continue;\n }\n\n var attColor = (attachment as any).color;\n if (attachment instanceof spine.RegionAttachment) {\n let region = (attachment as spine.RegionAttachment).region;\n if (region) {\n let ar = region as TextureAtlasRegion;\n if (!slot.currentSpriteName || slot.currentSpriteName !== ar.name) {\n var spriteName = ar.name;\n if (slot.currentSprite) {\n slot.currentSprite.visible = false;\n }\n slot.sprites = slot.sprites || {};\n if (slot.sprites[spriteName] !== undefined) {\n slot.sprites[spriteName].visible = true;\n }\n else {\n var sprite = this.createSprite(slot, attachment, spriteName);\n slotContainer.addChild(sprite);\n }\n slot.currentSprite = slot.sprites[spriteName];\n slot.currentSpriteName = spriteName;\n }\n }\n\n if (slotContainer.transform) {\n var transform = slotContainer.transform;\n let lt : PIXI.Matrix;\n if (slotContainer.transform.matrix2d) {\n //gameofbombs pixi fork\n lt = transform.matrix2d;\n transform._dirtyVersion++;\n transform.version = transform._dirtyVersion;\n transform.isStatic = true;\n transform.operMode = 0;\n } else {\n if (TransformBase) {\n //PIXI v4.0\n if (transform.position) {\n transform = new PIXI.TransformBase();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n } else {\n //PIXI v4.0rc\n if (!transform._dirtyLocal) {\n transform = new PIXI.TransformStatic();\n slotContainer.transform = transform;\n }\n lt = transform.localTransform;\n transform._dirtyParentVersion = -1;\n transform._dirtyLocal = 1;\n transform._versionLocal = 1;\n }\n }\n slot.bone.matrix.copy(lt);\n } else {\n //PIXI v3\n var lt = slotContainer.localTransform || new PIXI.Matrix();\n slot.bone.matrix.copy(lt);\n slotContainer.localTransform = lt;\n slotContainer.displayObjectUpdateTransform = SlotContainerUpdateTransformV3;\n }\n tempRgb[0] = r0 * slot.color.r * attColor.r;\n tempRgb[1] = g0 * slot.color.g * attColor.g;\n tempRgb[2] = b0 * slot.color.b * attColor.b;\n slot.currentSprite.tint = PIXI.utils.rgb2hex(tempRgb);\n slot.currentSprite.blendMode = slot.blendMode;\n }\n else if (attachment instanceof spine.MeshAttachment) {\n if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) {\n var meshName = attachment.name;\n if (slot.currentMesh) {\n slot.currentMesh.visible = false;\n }\n\n slot.meshes = slot.meshes || {};\n\n if (slot.meshes[meshName] !== undefined) {\n slot.meshes[meshName].visible = true;\n }\n else {\n var mesh = this.createMesh(slot, attachment);\n slotContainer.addChild(mesh);\n }\n\n slot.currentMesh = slot.meshes[meshName];\n slot.currentMeshName = meshName;\n }\n (attachment as VertexAttachment).computeWorldVertices(slot, slot.currentMesh.vertices);\n if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // slot.currentMesh.dirty++;\n //only for PIXI v4\n var tintRgb = slot.currentMesh.tintRgb;\n tintRgb[0] = r0 * slot.color.r * attColor.r;\n tintRgb[1] = g0 * slot.color.g * attColor.g;\n tintRgb[2] = b0 * slot.color.b * attColor.b;\n }\n slot.currentMesh.blendMode = slot.blendMode;\n }\n else {\n slotContainer.visible = false;\n continue;\n }\n slotContainer.visible = true;\n\n slotContainer.alpha = slot.color.a;\n }\n };\n\n private setSpriteRegion(attachment: spine.RegionAttachment, sprite: SpineSprite, region: spine.TextureRegion) {\n sprite.region = region;\n sprite.texture = region.texture;\n if (!region.size) {\n sprite.scale.x = attachment.scaleX * attachment.width / region.originalWidth;\n sprite.scale.y = -attachment.scaleY * attachment.height / region.originalHeight;\n } else {\n //hacked!\n sprite.scale.x = region.size.width / region.originalWidth;\n sprite.scale.y = -region.size.height / region.originalHeight;\n }\n }\n\n private setMeshRegion(attachment: spine.MeshAttachment, mesh: SpineMesh, region: spine.TextureRegion) {\n mesh.region = region;\n mesh.texture = region.texture;\n attachment.updateUVs(region, mesh.uvs);\n // if (PIXI.VERSION[0] !== '3') {\n // PIXI version 4\n // mesh.indexDirty++;\n // } else {\n // PIXI version 3\n mesh.dirty++;\n // }\n }\n\n protected lastTime: number;\n\n /**\n * When autoupdate is set to yes this function is used as pixi's updateTransform function\n *\n * @private\n */\n autoUpdateTransform() {\n if (Spine.globalAutoUpdate) {\n this.lastTime = this.lastTime || Date.now();\n var timeDelta = (Date.now() - this.lastTime) * 0.001;\n this.lastTime = Date.now();\n this.update(timeDelta);\n } else {\n this.lastTime = 0;\n }\n\n PIXI.Container.prototype.updateTransform.call(this);\n };\n\n /**\n * Create a new sprite to be used with spine.RegionAttachment\n *\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createSprite(slot: spine.Slot, attachment: spine.RegionAttachment, defName: string) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n var texture = region.texture;\n var sprite = new SpineSprite(texture);\n sprite.rotation = attachment.rotation * spine.MathUtils.degRad;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n sprite.position.x = attachment.x;\n sprite.position.y = attachment.y;\n sprite.alpha = attachment.color.a;\n\n sprite.region = attachment.region;\n this.setSpriteRegion(attachment, sprite, attachment.region);\n\n slot.sprites = slot.sprites || {};\n slot.sprites[defName] = sprite;\n return sprite;\n };\n\n /**\n * Creates a Strip from the spine data\n * @param slot {spine.Slot} The slot to which the attachment is parented\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\n * @private\n */\n createMesh(slot: spine.Slot, attachment: spine.MeshAttachment) {\n let region = attachment.region;\n if (slot.tempAttachment === attachment) {\n region = slot.tempRegion;\n slot.tempAttachment = null;\n slot.tempRegion = null;\n }\n let strip = new SpineMesh(\n region.texture,\n new Float32Array(attachment.regionUVs.length),\n new Float32Array(attachment.regionUVs.length),\n new Uint16Array(attachment.triangles),\n PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);\n\n strip.canvasPadding = 1.5;\n\n strip.alpha = attachment.color.a;\n\n strip.region = attachment.region;\n this.setMeshRegion(attachment, strip, region);\n\n slot.meshes = slot.meshes || {};\n slot.meshes[attachment.name] = strip;\n return strip;\n };\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotIndex {number}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotIndex(slotIndex: number, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var slot = this.skeleton.slots[slotIndex];\n if (!slot) {\n return false;\n }\n var attachment: any = slot.attachment;\n var region: spine.TextureRegion = attachment.region;\n if (texture) {\n region = new spine.TextureRegion();\n region.texture = texture;\n region.size = size;\n }\n if (slot.currentSprite && slot.currentSprite.region != region) {\n this.setSpriteRegion(attachment, slot.currentSprite, region);\n slot.currentSprite.region = region;\n } else\n if (slot.currentMesh && slot.currentMesh.region != region) {\n this.setMeshRegion(attachment, slot.currentMesh, region);\n } else {\n slot.tempRegion = region;\n slot.tempAttachment = attachment;\n }\n return true;\n }\n\n /**\n * Changes texture in attachment in specific slot.\n *\n * PIXI runtime feature, it was made to satisfy our users.\n *\n * @param slotName {string}\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\n * @returns {boolean} Success flag\n */\n hackTextureBySlotName = function (slotName: String, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) {\n var index = this.skeleton.findSlotIndex(slotName);\n if (index == -1) {\n return false;\n }\n return this.hackTextureBySlotIndex(index, texture, size);\n }\n}\n\nfunction SlotContainerUpdateTransformV3() {\n var pt = this.parent.worldTransform;\n var wt = this.worldTransform;\n var lt = this.localTransform;\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n this._currentBounds = null;\n}\n","import {Event} from \"./Event\";\nimport {Skeleton} from \"./Skeleton\";\nimport {PathConstraint} from \"./PathConstraint\";\nimport {Utils, MathUtils, Color, ArrayLike} from \"./Utils\";\nimport {TransformConstraint} from \"./TransformConstraint\";\nimport {IkConstraint} from \"./IkConstraint\";\nimport {VertexAttachment, Attachment} from \"./attachments\";\nimport {Slot} from \"./Slot\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Animation {\n name: string;\n timelines: Array;\n duration: number;\n\n constructor (name: string, timelines: Array, duration: number) {\n if (name == null) throw new Error(\"name cannot be null.\");\n if (timelines == null) throw new Error(\"timelines cannot be null.\");\n this.name = name;\n this.timelines = timelines;\n this.duration = duration;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array) {\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n\n if (loop && this.duration != 0) {\n time %= this.duration;\n if (lastTime > 0) lastTime %= this.duration;\n }\n\n let timelines = this.timelines;\n for (let i = 0, n = timelines.length; i < n; i++)\n timelines[i].apply(skeleton, lastTime, time, events, 1);\n }\n\n mix (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number) {\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n\n if (loop && this.duration != 0) {\n time %= this.duration;\n if (lastTime > 0) lastTime %= this.duration;\n }\n\n let timelines = this.timelines;\n for (let i = 0, n = timelines.length; i < n; i++)\n timelines[i].apply(skeleton, lastTime, time, events, alpha);\n }\n\n static binarySearch (values: ArrayLike, target: number, step: number = 1) {\n let low = 0;\n let high = values.length / step - 2;\n if (high == 0) return step;\n let current = high >>> 1;\n while (true) {\n if (values[(current + 1) * step] <= target)\n low = current + 1;\n else\n high = current;\n if (low == high) return (low + 1) * step;\n current = (low + high) >>> 1;\n }\n }\n\n static linearSearch (values: ArrayLike, target: number, step: number) {\n for (let i = 0, last = values.length - step; i <= last; i += step)\n if (values[i] > target) return i;\n return -1;\n }\n}\n\nexport interface Timeline {\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\n}\n\nexport abstract class CurveTimeline implements Timeline {\n static LINEAR = 0; static STEPPED = 1; static BEZIER = 2;\n static BEZIER_SIZE = 10 * 2 - 1;\n\n private curves: ArrayLike; // type, x, y, ...\n\n constructor (frameCount: number) {\n if (frameCount <= 0) throw new Error(\"frameCount must be > 0: \" + frameCount);\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\n }\n\n getFrameCount () {\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\n }\n\n setLinear (frameIndex: number) {\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\n }\n\n setStepped (frameIndex: number) {\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\n }\n\n getCurveType (frameIndex: number): number {\n let index = frameIndex * CurveTimeline.BEZIER_SIZE;\n if (index == this.curves.length) return CurveTimeline.LINEAR;\n let type = this.curves[index];\n if (type == CurveTimeline.LINEAR) return CurveTimeline.LINEAR;\n if (type == CurveTimeline.STEPPED) return CurveTimeline.STEPPED;\n return CurveTimeline.BEZIER;\n }\n\n /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\n * the difference between the keyframe's values. */\n setCurve (frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number) {\n let tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\n let dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\n let ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\n let dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\n\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\n let curves = this.curves;\n curves[i++] = CurveTimeline.BEZIER;\n\n let x = dfx, y = dfy;\n for (let n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n curves[i] = x;\n curves[i + 1] = y;\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n x += dfx;\n y += dfy;\n }\n }\n\n getCurvePercent (frameIndex: number, percent: number) {\n percent = MathUtils.clamp(percent, 0, 1);\n let curves = this.curves;\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\n let type = curves[i];\n if (type == CurveTimeline.LINEAR) return percent;\n if (type == CurveTimeline.STEPPED) return 0;\n i++;\n let x = 0;\n for (let start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n x = curves[i];\n if (x >= percent) {\n let prevX: number, prevY: number;\n if (i == start) {\n prevX = 0;\n prevY = 0;\n } else {\n prevX = curves[i - 2];\n prevY = curves[i - 1];\n }\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\n }\n }\n let y = curves[i - 1];\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\n }\n\n abstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number): void;\n}\n\nexport class RotateTimeline extends CurveTimeline {\n static ENTRIES = 2;\n static PREV_TIME = -2; static PREV_ROTATION = -1;\n static ROTATION = 1;\n\n boneIndex: number;\n frames: ArrayLike; // time, degrees, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount << 1);\n }\n\n /** Sets the time and angle of the specified keyframe. */\n setFrame (frameIndex: number, time: number, degrees: number) {\n frameIndex <<= 1;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\n let amount = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION] - bone.rotation;\n while (amount > 180)\n amount -= 360;\n while (amount < -180)\n amount += 360;\n bone.rotation += amount * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\n let prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent((frame >> 1) - 1,\n 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\n\n let amount = frames[frame + RotateTimeline.ROTATION] - prevRotation;\n while (amount > 180)\n amount -= 360;\n while (amount < -180)\n amount += 360;\n amount = bone.data.rotation + (prevRotation + amount * percent) - bone.rotation;\n while (amount > 180)\n amount -= 360;\n while (amount < -180)\n amount += 360;\n bone.rotation += amount * alpha;\n }\n}\n\nexport class TranslateTimeline extends CurveTimeline {\n static ENTRIES = 3;\n static PREV_TIME = -3; static PREV_X = -2; static PREV_Y = -1;\n static X = 1; static Y = 2;\n\n boneIndex: number;\n frames: ArrayLike; // time, x, y, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, x: number, y: number) {\n frameIndex *= TranslateTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TranslateTimeline.X] = x;\n this.frames[frameIndex + TranslateTimeline.Y] = y;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\n bone.x += (bone.data.x + frames[frames.length + TranslateTimeline.PREV_X] - bone.x) * alpha;\n bone.y += (bone.data.y + frames[frames.length + TranslateTimeline.PREV_Y] - bone.y) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\n let prevX = frames[frame + TranslateTimeline.PREV_X];\n let prevY = frames[frame + TranslateTimeline.PREV_Y];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\n\n bone.x += (bone.data.x + prevX + (frames[frame + TranslateTimeline.X] - prevX) * percent - bone.x) * alpha;\n bone.y += (bone.data.y + prevY + (frames[frame + TranslateTimeline.Y] - prevY) * percent - bone.y) * alpha;\n }\n}\n\nexport class ScaleTimeline extends TranslateTimeline {\n constructor (frameCount: number) {\n super(frameCount);\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\n bone.scaleX += (bone.data.scaleX * frames[frames.length + ScaleTimeline.PREV_X] - bone.scaleX) * alpha;\n bone.scaleY += (bone.data.scaleY * frames[frames.length + ScaleTimeline.PREV_Y] - bone.scaleY) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\n let prevX = frames[frame + ScaleTimeline.PREV_X];\n let prevY = frames[frame + ScaleTimeline.PREV_Y];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\n\n bone.scaleX += (bone.data.scaleX * (prevX + (frames[frame + ScaleTimeline.X] - prevX) * percent) - bone.scaleX) * alpha;\n bone.scaleY += (bone.data.scaleY * (prevY + (frames[frame + ScaleTimeline.Y] - prevY) * percent) - bone.scaleY) * alpha;\n }\n}\n\nexport class ShearTimeline extends TranslateTimeline {\n constructor (frameCount: number) {\n super(frameCount);\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let bone = skeleton.bones[this.boneIndex];\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\n bone.shearX += (bone.data.shearX + frames[frames.length + ShearTimeline.PREV_X] - bone.shearX) * alpha;\n bone.shearY += (bone.data.shearY + frames[frames.length + ShearTimeline.PREV_Y] - bone.shearY) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\n let prevX = frames[frame + ShearTimeline.PREV_X];\n let prevY = frames[frame + ShearTimeline.PREV_Y];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\n\n bone.shearX += (bone.data.shearX + (prevX + (frames[frame + ShearTimeline.X] - prevX) * percent) - bone.shearX) * alpha;\n bone.shearY += (bone.data.shearY + (prevY + (frames[frame + ShearTimeline.Y] - prevY) * percent) - bone.shearY) * alpha;\n }\n}\n\nexport class ColorTimeline extends CurveTimeline {\n static ENTRIES = 5;\n static PREV_TIME = -5; static PREV_R = -4; static PREV_G = -3; static PREV_B = -2; static PREV_A = -1;\n static R = 1; static G = 2; static B = 3; static A = 4;\n\n slotIndex: number;\n frames: ArrayLike; // time, r, g, b, a, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, r: number, g: number, b: number, a: number) {\n frameIndex *= ColorTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + ColorTimeline.R] = r;\n this.frames[frameIndex + ColorTimeline.G] = g;\n this.frames[frameIndex + ColorTimeline.B] = b;\n this.frames[frameIndex + ColorTimeline.A] = a;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let r = 0, g = 0, b = 0, a = 0;\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n r = frames[i + ColorTimeline.PREV_R];\n g = frames[i + ColorTimeline.PREV_G];\n b = frames[i + ColorTimeline.PREV_B];\n a = frames[i + ColorTimeline.PREV_A];\n } else {\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\n r = frames[frame + ColorTimeline.PREV_R];\n g = frames[frame + ColorTimeline.PREV_G];\n b = frames[frame + ColorTimeline.PREV_B];\n a = frames[frame + ColorTimeline.PREV_A];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\n\n r += (frames[frame + ColorTimeline.R] - r) * percent;\n g += (frames[frame + ColorTimeline.G] - g) * percent;\n b += (frames[frame + ColorTimeline.B] - b) * percent;\n a += (frames[frame + ColorTimeline.A] - a) * percent;\n }\n let color: Color = skeleton.slots[this.slotIndex].color;\n if (alpha < 1)\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n else\n color.set(r, g, b, a);\n }\n}\n\nexport class AttachmentTimeline implements Timeline {\n slotIndex: number;\n frames: ArrayLike // time, ...\n attachmentNames: Array;\n\n constructor (frameCount: number) {\n this.frames = Utils.newFloatArray(frameCount);\n this.attachmentNames = new Array(frameCount);\n }\n\n getFrameCount () {\n return this.frames.length;\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, attachmentName: string) {\n this.frames[frameIndex] = time;\n this.attachmentNames[frameIndex] = attachmentName;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frameIndex = 0;\n if (time >= frames[frames.length - 1]) // Time is after last frame.\n frameIndex = frames.length - 1;\n else\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\n\n let attachmentName = this.attachmentNames[frameIndex];\n skeleton.slots[this.slotIndex]\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n }\n}\n\nexport class EventTimeline implements Timeline {\n frames: ArrayLike; // time, ...\n events: Array;\n\n constructor (frameCount: number) {\n this.frames = Utils.newFloatArray(frameCount);\n this.events = new Array(frameCount);\n }\n\n getFrameCount () {\n return this.frames.length;\n }\n\n /** Sets the time of the specified keyframe. */\n setFrame (frameIndex: number, event: Event) {\n this.frames[frameIndex] = event.time;\n this.events[frameIndex] = event;\n }\n\n /** Fires events for frames > lastTime and <= time. */\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n if (firedEvents == null) return;\n let frames = this.frames;\n let frameCount = this.frames.length;\n\n if (lastTime > time) { // Fire events after last time for looped animations.\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha);\n lastTime = -1;\n } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\n return;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frame = 0;\n if (lastTime < frames[0])\n frame = 0;\n else {\n frame = Animation.binarySearch(frames, lastTime);\n let frameTime = frames[frame];\n while (frame > 0) { // Fire multiple events with the same frame.\n if (frames[frame - 1] != frameTime) break;\n frame--;\n }\n }\n for (; frame < frameCount && time >= frames[frame]; frame++)\n firedEvents.push(this.events[frame]);\n }\n}\n\nexport class DrawOrderTimeline implements Timeline {\n frames: ArrayLike; // time, ...\n drawOrders: Array>;\n\n constructor (frameCount: number) {\n this.frames = Utils.newFloatArray(frameCount);\n this.drawOrders = new Array>(frameCount);\n }\n\n getFrameCount () {\n return this.frames.length;\n }\n\n /** Sets the time of the specified keyframe.\n * @param drawOrder May be null to use bind pose draw order. */\n setFrame (frameIndex: number, time: number, drawOrder: Array) {\n this.frames[frameIndex] = time;\n this.drawOrders[frameIndex] = drawOrder;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frame = 0;\n if (time >= frames[frames.length - 1]) // Time is after last frame.\n frame = frames.length - 1;\n else\n frame = Animation.binarySearch(frames, time) - 1;\n\n let drawOrder: Array = skeleton.drawOrder;\n let slots: Array = skeleton.slots;\n let drawOrderToSetupIndex = this.drawOrders[frame];\n if (drawOrderToSetupIndex == null)\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\n else {\n for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\n }\n }\n}\n\nexport class DeformTimeline extends CurveTimeline {\n frames: ArrayLike; // time, ...\n frameVertices: Array>;\n slotIndex: number;\n attachment: VertexAttachment;\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount);\n this.frameVertices = new Array>(frameCount);\n }\n\n /** Sets the time of the specified keyframe. */\n setFrame (frameIndex: number, time: number, vertices: ArrayLike) {\n this.frames[frameIndex] = time;\n this.frameVertices[frameIndex] = vertices;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let slot: Slot = skeleton.slots[this.slotIndex];\n let slotAttachment: Attachment = slot.getAttachment();\n if (!(slotAttachment instanceof VertexAttachment) || !(slotAttachment).applyDeform(this.attachment)) return;\n\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let frameVertices = this.frameVertices;\n let vertexCount = frameVertices[0].length;\n\n let verticesArray: Array = slot.attachmentVertices;\n if (verticesArray.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.\n let vertices: Array = Utils.setArraySize(verticesArray, vertexCount);\n\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\n let lastVertices = frameVertices[frames.length - 1];\n if (alpha < 1) {\n for (let i = 0; i < vertexCount; i++)\n vertices[i] += (lastVertices[i] - vertices[i]) * alpha;\n } else\n Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time);\n let prevVertices = frameVertices[frame - 1];\n let nextVertices = frameVertices[frame];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\n\n if (alpha < 1) {\n for (let i = 0; i < vertexCount; i++) {\n let prev = prevVertices[i];\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;\n }\n } else {\n for (let i = 0; i < vertexCount; i++) {\n let prev = prevVertices[i];\n vertices[i] = prev + (nextVertices[i] - prev) * percent;\n }\n }\n }\n}\n\nexport class IkConstraintTimeline extends CurveTimeline {\n static ENTRIES = 3;\n static PREV_TIME = -3; static PREV_MIX = -2; static PREV_BEND_DIRECTION = -1;\n static MIX = 1; static BEND_DIRECTION = 2;\n\n ikConstraintIndex: number;\n frames: ArrayLike; // time, mix, bendDirection, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\n }\n\n /** Sets the time, mix and bend direction of the specified keyframe. */\n setFrame (frameIndex: number, time: number, mix: number, bendDirection: number) {\n frameIndex *= IkConstraintTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: IkConstraint = skeleton.ikConstraints[this.ikConstraintIndex];\n\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\n constraint.bendDirection = Math.floor(frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION]);\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\n let mix = frames[frame + IkConstraintTimeline.PREV_MIX];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\n\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\n constraint.bendDirection = Math.floor(frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION]);\n }\n}\n\nexport class TransformConstraintTimeline extends CurveTimeline {\n static ENTRIES = 5;\n static PREV_TIME = -5; static PREV_ROTATE = -4; static PREV_TRANSLATE = -3; static PREV_SCALE = -2; static PREV_SHEAR = -1;\n static ROTATE = 1; static TRANSLATE = 2; static SCALE = 3; static SHEAR = 4;\n\n transformConstraintIndex: number;\n frames: ArrayLike; // time, rotate mix, translate mix, scale mix, shear mix, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\n }\n\n /** Sets the time and mixes of the specified keyframe. */\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number) {\n frameIndex *= TransformConstraintTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: TransformConstraint = skeleton.transformConstraints[this.transformConstraintIndex];\n\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.rotateMix += (frames[i + TransformConstraintTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\n constraint.translateMix += (frames[i + TransformConstraintTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\n constraint.scaleMix += (frames[i + TransformConstraintTimeline.PREV_SCALE] - constraint.scaleMix) * alpha;\n constraint.shearMix += (frames[i + TransformConstraintTimeline.PREV_SHEAR] - constraint.shearMix) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\n\n let rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\n let translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\n let scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\n let shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\n constraint.rotateMix += (rotate + (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\n constraint.translateMix += (translate + (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\n * alpha;\n constraint.scaleMix += (scale + (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent - constraint.scaleMix) * alpha;\n constraint.shearMix += (shear + (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent - constraint.shearMix) * alpha;\n }\n}\n\nexport class PathConstraintPositionTimeline extends CurveTimeline {\n static ENTRIES = 2;\n static PREV_TIME = -2; static PREV_VALUE = -1;\n static VALUE = 1;\n\n pathConstraintIndex: number;\n\n frames: ArrayLike; // time, position, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\n }\n\n /** Sets the time and value of the specified keyframe. */\n setFrame (frameIndex: number, time: number, value: number) {\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\n\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.position += (frames[i + PathConstraintPositionTimeline.PREV_VALUE] - constraint.position) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\n let position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\n\n constraint.position += (position + (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent - constraint.position) * alpha;\n }\n}\n\nexport class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {\n constructor (frameCount: number) {\n super(frameCount);\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\n\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.spacing += (frames[i + PathConstraintSpacingTimeline.PREV_VALUE] - constraint.spacing) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\n let spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\n\n constraint.spacing += (spacing + (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent - constraint.spacing) * alpha;\n }\n}\n\nexport class PathConstraintMixTimeline extends CurveTimeline {\n static ENTRIES = 3;\n static PREV_TIME = -3; static PREV_ROTATE = -2; static PREV_TRANSLATE = -1;\n static ROTATE = 1; static TRANSLATE = 2;\n\n pathConstraintIndex: number;\n\n frames: ArrayLike; // time, rotate mix, translate mix, ...\n\n constructor (frameCount: number) {\n super(frameCount);\n this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\n }\n\n /** Sets the time and mixes of the specified keyframe. */\n setFrame (frameIndex: number, time: number, rotateMix: number, translateMix: number) {\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\n }\n\n apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number) {\n let frames = this.frames;\n if (time < frames[0]) return; // Time is before first frame.\n\n let constraint: PathConstraint = skeleton.pathConstraints[this.pathConstraintIndex];\n\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\n let i = frames.length;\n constraint.rotateMix += (frames[i + PathConstraintMixTimeline.PREV_ROTATE] - constraint.rotateMix) * alpha;\n constraint.translateMix += (frames[i + PathConstraintMixTimeline.PREV_TRANSLATE] - constraint.translateMix) * alpha;\n return;\n }\n\n // Interpolate between the previous frame and the current frame.\n let frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\n let rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\n let translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\n let frameTime = frames[frame];\n let percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1,\n 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\n\n constraint.rotateMix += (rotate + (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent - constraint.rotateMix) * alpha;\n constraint.translateMix += (translate + (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent - constraint.translateMix)\n * alpha;\n }\n}\n","import {Skeleton} from \"./Skeleton\";\r\nimport {MathUtils, Utils} from \"./Utils\";\r\nimport {Animation} from \"./Animation\";\r\nimport {AnimationStateData} from \"./AnimationStateData\";\r\nimport {Event} from \"./Event\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class AnimationState {\r\n data: AnimationStateData;\r\n tracks = new Array();\r\n events = new Array();\r\n timeScale = 1;\r\n\r\n constructor (data: AnimationStateData = null) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n }\r\n\r\n update (delta: number) {\r\n delta *= this.timeScale;\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n let next = current.next;\r\n if (next != null) {\r\n let nextTime = current.lastTime - next.delay;\r\n if (nextTime >= 0) {\r\n let nextDelta = delta * next.timeScale;\r\n next.time = nextTime + nextDelta; // For start event to see correct time.\r\n current.time += delta * current.timeScale; // For end event to see correct time.\r\n this.setCurrent(i, next);\r\n next.time -= nextDelta; // Prevent increasing time twice, below.\r\n current = next;\r\n }\r\n } else if (!current.loop && current.lastTime >= current.endTime) {\r\n // End non-looping animation when it reaches its end time and there is no next entry.\r\n this.clearTrack(i);\r\n continue;\r\n }\r\n\r\n current.time += delta * current.timeScale;\r\n if (current.previous != null) {\r\n let previousDelta = delta * current.previous.timeScale;\r\n current.previous.time += previousDelta;\r\n current.mixTime += previousDelta;\r\n }\r\n }\r\n }\r\n\r\n apply (skeleton: Skeleton) {\r\n let events = this.events;\r\n\r\n for (let i = 0; i < this.tracks.length; i++) {\r\n let current = this.tracks[i];\r\n if (current == null) continue;\r\n\r\n events.length = 0;\r\n\r\n let time = current.time;\r\n let lastTime = current.lastTime;\r\n let endTime = current.endTime;\r\n let loop = current.loop;\r\n if (!loop && time > endTime) time = endTime;\r\n\r\n let previous = current.previous;\r\n if (previous == null)\r\n current.animation.mix(skeleton, lastTime, time, loop, events, current.mix);\r\n else {\r\n let previousTime = previous.time;\r\n if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime;\r\n previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null);\r\n\r\n let alpha = current.mixTime / current.mixDuration * current.mix;\r\n if (alpha >= 1) {\r\n alpha = 1;\r\n current.previous = null;\r\n }\r\n current.animation.mix(skeleton, lastTime, time, loop, events, alpha);\r\n }\r\n\r\n for (let ii = 0, nn = events.length; ii < nn; ii++) {\r\n let event = events[ii];\r\n if (current.onEvent) current.onEvent(i, event);\r\n if (this.onEvent) this.onEvent(i, event);\r\n }\r\n\r\n // Check if completed the animation or a loop iteration.\r\n if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) {\r\n let count = MathUtils.toInt(time / endTime);\r\n if (current.onComplete) current.onComplete(i, count);\r\n if (this.onComplete) this.onComplete(i, count);\r\n }\r\n\r\n current.lastTime = current.time;\r\n }\r\n }\r\n\r\n clearTracks () {\r\n for (let i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n }\r\n\r\n clearTrack (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return;\r\n let current = this.tracks[trackIndex];\r\n if (current == null) return;\r\n\r\n if (current.onEnd) current.onEnd(trackIndex);\r\n if (this.onEnd) this.onEnd(trackIndex);\r\n\r\n this.tracks[trackIndex] = null;\r\n\r\n this.freeAll(current);\r\n }\r\n\r\n freeAll (entry: TrackEntry) {\r\n while (entry != null) {\r\n let next = entry.next;\r\n entry = next;\r\n }\r\n }\r\n\r\n expandToIndex (index: number) {\r\n if (index < this.tracks.length) return this.tracks[index];\r\n Utils.setArraySize(this.tracks, index - this.tracks.length + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n }\r\n\r\n setCurrent (index: number, entry: TrackEntry) {\r\n let current = this.expandToIndex(index);\r\n if (current != null) {\r\n let previous = current.previous;\r\n current.previous = null;\r\n\r\n if (entry.onEnd) entry.onEnd(index);\r\n if (this.onEnd) this.onEnd(index);\r\n\r\n entry.mixDuration = this.data.getMix(current.animation, entry.animation);\r\n if (entry.mixDuration > 0) {\r\n entry.mixTime = 0;\r\n // If a mix is in progress, mix from the closest animation.\r\n if (previous != null && current.mixTime / current.mixDuration < 0.5) {\r\n entry.previous = previous;\r\n previous = current;\r\n } else\r\n entry.previous = current;\r\n }\r\n }\r\n\r\n this.tracks[index] = entry;\r\n\r\n if (entry.onStart) entry.onStart(index);\r\n if (this.onStart) this.onStart(index);\r\n }\r\n\r\n /** @see #setAnimation(int, Animation, boolean) */\r\n setAnimation (trackIndex: number, animationName: string, loop: boolean) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n }\r\n\r\n /** Set the current animation. Any queued animations are cleared. */\r\n setAnimationWith (trackIndex: number, animation: Animation, loop: boolean) {\r\n let current = this.expandToIndex(trackIndex);\r\n if (current != null) this.freeAll(current.next);\r\n\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n this.setCurrent(trackIndex, entry);\r\n return entry;\r\n }\r\n\r\n /** {@link #addAnimation(int, Animation, boolean, float)} */\r\n addAnimation (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null) throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n }\r\n\r\n hasAnimation(animationName: string): boolean\r\n {\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n\r\n /** Adds an animation to be played delay seconds after the current or last queued animation.\r\n * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */\r\n addAnimationWith (trackIndex: number, animation: Animation, loop: boolean, delay: number) {\r\n let entry = new TrackEntry();\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.endTime = animation.duration;\r\n\r\n let last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n last.next = entry;\r\n } else\r\n this.tracks[trackIndex] = entry;\r\n\r\n if (delay <= 0) {\r\n if (last != null)\r\n delay += last.endTime - this.data.getMix(last.animation, animation);\r\n else\r\n delay = 0;\r\n }\r\n entry.delay = delay;\r\n\r\n return entry;\r\n }\r\n\r\n /** @return May be null. */\r\n getCurrent (trackIndex: number) {\r\n if (trackIndex >= this.tracks.length) return null;\r\n return this.tracks[trackIndex];\r\n }\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n private static deprecatedWarning1: boolean = false;\r\n setAnimationByName (trackIndex: number, animationName: string, loop: boolean) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n }\r\n\r\n private static deprecatedWarning2: boolean = false;\r\n addAnimationByName (trackIndex: number, animationName: string, loop: boolean, delay: number) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n }\r\n\r\n private static deprecatedWarning3: boolean = false;\r\n hasAnimationByName (animationName: string): boolean\r\n {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n let animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n }\r\n}\r\n\r\nexport class TrackEntry {\r\n next: TrackEntry; previous: TrackEntry;\r\n animation: Animation;\r\n loop = false;\r\n delay = 0; time = 0; lastTime = -1; endTime = 0; timeScale = 1;\r\n mixTime = 0; mixDuration = 0;\r\n mix = 1;\r\n\r\n onComplete: (trackIndex: number, loopCount: number) => any;\r\n onEvent: (trackIndex: number, event: Event) => any;\r\n onStart: (trackIndex: number) => any;\r\n onEnd: (trackIndex: number) => any;\r\n\r\n reset () {\r\n this.next = null;\r\n this.previous = null;\r\n this.animation = null;\r\n this.timeScale = 1;\r\n this.lastTime = -1; // Trigger events on frame zero.\r\n this.time = 0;\r\n }\r\n\r\n /** Returns true if the current time is greater than the end time, regardless of looping. */\r\n isComplete () : boolean {\r\n return this.time >= this.endTime;\r\n }\r\n}\r\n","import {Animation} from \"./Animation\";\nimport {SkeletonData} from \"./SkeletonData\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class AnimationStateData {\n skeletonData: SkeletonData;\n animationToMixTime: Map = { };\n defaultMix = 0;\n\n constructor (skeletonData: SkeletonData) {\n if (skeletonData == null) throw new Error(\"skeletonData cannot be null.\");\n this.skeletonData = skeletonData;\n }\n\n setMix (fromName: string, toName: string, duration: number) {\n let from = this.skeletonData.findAnimation(fromName);\n if (from == null) throw new Error(\"Animation not found: \" + fromName);\n let to = this.skeletonData.findAnimation(toName);\n if (to == null) throw new Error(\"Animation not found: \" + toName);\n this.setMixWith(from, to, duration);\n }\n\n private static deprecatedWarning1: boolean = false;\n setMixByName(fromName: string, toName: string, duration: number) {\n if (!AnimationStateData.deprecatedWarning1) {\n AnimationStateData.deprecatedWarning1 = true;\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\n }\n this.setMix(fromName, toName, duration);\n }\n\n setMixWith (from: Animation, to: Animation, duration: number) {\n if (from == null) throw new Error(\"from cannot be null.\");\n if (to == null) throw new Error(\"to cannot be null.\");\n let key = from.name + to.name;\n this.animationToMixTime[key] = duration;\n }\n\n getMix (from: Animation, to: Animation) {\n let key = from.name + to.name;\n let value = this.animationToMixTime[key];\n return value === undefined ? this.defaultMix : value;\n }\n}\n","import {Skin} from \"./Skin\";\nimport {AttachmentLoader, BoundingBoxAttachment, MeshAttachment, PathAttachment, RegionAttachment} from \"./attachments\";\nimport {TextureAtlas} from \"./TextureAtlas\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class AtlasAttachmentLoader implements AttachmentLoader {\n atlas: TextureAtlas;\n\n constructor (atlas: TextureAtlas) {\n this.atlas = atlas;\n }\n\n /** @return May be null to not load an attachment. */\n newRegionAttachment (skin: Skin, name: string, path: string): RegionAttachment {\n let region = this.atlas.findRegion(path);\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\n let attachment = new RegionAttachment(name);\n attachment.region = region;\n return attachment;\n }\n\n /** @return May be null to not load an attachment. */\n newMeshAttachment (skin: Skin, name: string, path: string) : MeshAttachment {\n let region = this.atlas.findRegion(path);\n if (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\n let attachment = new MeshAttachment(name);\n attachment.region = region;\n return attachment;\n }\n\n /** @return May be null to not load an attachment. */\n newBoundingBoxAttachment (skin: Skin, name: string) : BoundingBoxAttachment {\n return new BoundingBoxAttachment(name);\n }\n\n /** @return May be null to not load an attachment */\n newPathAttachment (skin: Skin, name: string): PathAttachment {\n return new PathAttachment(name);\n }\n}\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum BlendMode {\r\n Normal,\r\n Additive,\r\n Multiply,\r\n Screen\r\n}\r\n","import {Updatable} from \"./Updatable\";\nimport {BoneData, TransformMode} from \"./BoneData\";\nimport {Skeleton} from \"./Skeleton\";\nimport {MathUtils, Vector2} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Bone implements Updatable {\n static yDown: boolean = false;\n //be careful! Spine b,c is c,b in pixi matrix\n matrix = new PIXI.Matrix();\n\n get worldX(): number {\n return this.matrix.tx;\n }\n\n get worldY(): number {\n return this.matrix.ty;\n }\n\n data: BoneData;\n skeleton: Skeleton;\n parent: Bone;\n children = new Array();\n x = 0; y = 0; rotation = 0; scaleX = 0; scaleY = 0; shearX = 0; shearY = 0;\n ax = 0; ay = 0; arotation = 0; ascaleX = 0; ascaleY = 0; ashearX = 0; ashearY = 0;\n appliedValid = false;\n\n sorted = false;\n\n /** @param parent May be null. */\n constructor (data: BoneData, skeleton: Skeleton, parent: Bone) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.skeleton = skeleton;\n this.parent = parent;\n this.setToSetupPose();\n }\n\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\n update () {\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n }\n\n /** Computes the world transform using the parent bone and this bone's local transform. */\n updateWorldTransform () {\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n }\n\n /** Computes the world transform using the parent bone and the specified local transform. */\n updateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\n this.ax = x;\n this.ay = y;\n this.arotation = rotation;\n this.ascaleX = scaleX;\n this.ascaleY = scaleY;\n this.ashearX = shearX;\n this.ashearY = shearY;\n this.appliedValid = true;\n\n let parent = this.parent;\n let m = this.matrix;\n if (parent == null) { // Root bone.\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n let skeleton = this.skeleton;\n if (skeleton.flipX) {\n x = -x;\n la = -la;\n lb = -lb;\n }\n if (skeleton.flipY !== Bone.yDown) {\n y = -y;\n lc = -lc;\n ld = -ld;\n }\n m.a = la;\n m.c = lb;\n m.b = lc;\n m.d = ld;\n m.tx = x + skeleton.x;\n m.ty = y + skeleton.y;\n return;\n }\n\n let pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\n m.tx = pa * x + pb * y + parent.matrix.tx;\n m.ty = pc * x + pd * y + parent.matrix.ty;\n switch (this.data.transformMode) {\n case TransformMode.Normal: {\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n m.a = pa * la + pb * lc;\n m.c = pa * lb + pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n return;\n }\n case TransformMode.OnlyTranslation: {\n let rotationY = rotation + 90 + shearY;\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\n break;\n }\n case TransformMode.NoRotationOrReflection: {\n let s = pa * pa + pc * pc;\n let prx = 0;\n if (s > 0.0001) {\n s = Math.abs(pa * pd - pb * pc) / s;\n pb = pc * s;\n pd = pa * s;\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\n } else {\n pa = 0;\n pc = 0;\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\n }\n let rx = rotation + shearX - prx;\n let ry = rotation + shearY - prx + 90;\n let la = MathUtils.cosDeg(rx) * scaleX;\n let lb = MathUtils.cosDeg(ry) * scaleY;\n let lc = MathUtils.sinDeg(rx) * scaleX;\n let ld = MathUtils.sinDeg(ry) * scaleY;\n m.a = pa * la - pb * lc;\n m.c = pa * lb - pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n break;\n }\n case TransformMode.NoScale:\n case TransformMode.NoScaleOrReflection: {\n let cos = MathUtils.cosDeg(rotation);\n let sin = MathUtils.sinDeg(rotation);\n let za = pa * cos + pb * sin;\n let zc = pc * cos + pd * sin;\n let s = Math.sqrt(za * za + zc * zc);\n if (s > 0.00001) s = 1 / s;\n za *= s;\n zc *= s;\n s = Math.sqrt(za * za + zc * zc);\n let r = Math.PI / 2 + Math.atan2(zc, za);\n let zb = Math.cos(r) * s;\n let zd = Math.sin(r) * s;\n let la = MathUtils.cosDeg(shearX) * scaleX;\n let lb = MathUtils.cosDeg(90 + shearY) * scaleY;\n let lc = MathUtils.sinDeg(shearX) * scaleX;\n let ld = MathUtils.sinDeg(90 + shearY) * scaleY;\n m.a = za * la + zb * lc;\n m.c = za * lb + zb * ld;\n m.b = zc * la + zd * lc;\n m.d = zc * lb + zd * ld;\n if (this.data.transformMode != TransformMode.NoScaleOrReflection ? pa * pd - pb * pc < 0 : (this.skeleton.flipX != this.skeleton.flipY) != Bone.yDown) {\n m.b = -m.b;\n m.d = -m.d;\n }\n return;\n }\n //old < 3.5 stuff\n case TransformMode.InheritRotation: {\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n\n pa = 1;\n pb = 0;\n pc = 0;\n pd = 1;\n do {\n let cos = MathUtils.cosDeg(parent.arotation), sin = MathUtils.sinDeg(parent.arotation);\n let temp = pa * cos + pb * sin;\n pb = pb * cos - pa * sin;\n pa = temp;\n temp = pc * cos + pd * sin;\n pd = pd * cos - pc * sin;\n pc = temp;\n\n if (parent.data.transformMode === TransformMode.InheritScale ||\n parent.data.transformMode === TransformMode.OnlyTranslation) break;\n parent = parent.parent;\n } while (parent != null);\n m.a = pa * la + pb * lc;\n m.c = pa * lb + pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n break;\n }\n //old < 3.5 stuff\n case TransformMode.InheritScale: {\n let rotationY = rotation + 90 + shearY;\n let la = MathUtils.cosDeg(rotation + shearX) * scaleX;\n let lb = MathUtils.cosDeg(rotationY) * scaleY;\n let lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\n let ld = MathUtils.sinDeg(rotationY) * scaleY;\n\n pa = 1;\n pb = 0;\n pc = 0;\n pd = 1;\n do {\n let cos = MathUtils.cosDeg(parent.arotation), sin = MathUtils.sinDeg(parent.arotation);\n let psx = parent.scaleX, psy = parent.scaleY;\n let za = cos * psx, zb = sin * psy, zc = sin * psx, zd = cos * psy;\n let temp = pa * za + pb * zc;\n pb = pb * zd - pa * zb;\n pa = temp;\n temp = pc * za + pd * zc;\n pd = pd * zd - pc * zb;\n pc = temp;\n\n if (psx >= 0) sin = -sin;\n temp = pa * cos + pb * sin;\n pb = pb * cos - pa * sin;\n pa = temp;\n temp = pc * cos + pd * sin;\n pd = pd * cos - pc * sin;\n pc = temp;\n\n if (parent.data.transformMode === TransformMode.InheritRotation ||\n parent.data.transformMode === TransformMode.OnlyTranslation) break;\n parent = parent.parent;\n } while (parent != null);\n m.a = pa * la + pb * lc;\n m.c = pa * lb + pb * ld;\n m.b = pc * la + pd * lc;\n m.d = pc * lb + pd * ld;\n break;\n }\n }\n if (this.skeleton.flipX) {\n m.a = -m.a;\n m.c = -m.c;\n }\n if (this.skeleton.flipY != Bone.yDown) {\n m.b = -m.b;\n m.d = -m.d;\n }\n }\n\n setToSetupPose () {\n let data = this.data;\n this.x = data.x;\n this.y = data.y;\n this.rotation = data.rotation;\n this.scaleX = data.scaleX;\n this.scaleY = data.scaleY;\n this.shearX = data.shearX;\n this.shearY = data.shearY;\n }\n\n getWorldRotationX () {\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\n }\n\n getWorldRotationY () {\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\n }\n\n getWorldScaleX () {\n let m = this.matrix;\n return Math.sqrt(m.a * m.a + m.c * m.c);\n }\n\n getWorldScaleY () {\n let m = this.matrix;\n return Math.sqrt(m.b * m.b + m.d * m.d);\n }\n\n worldToLocalRotationX () {\n let parent = this.parent;\n if (parent == null) return this.arotation;\n let pm = parent.matrix, m = this.matrix;\n return Math.atan2(pm.a * m.b - pm.b * m.a, pm.d * m.a - pm.c * m.b) * MathUtils.radDeg;\n }\n\n worldToLocalRotationY () {\n let parent = this.parent;\n if (parent == null) return this.arotation;\n let pm = parent.matrix, m = this.matrix;\n return Math.atan2(pm.a * m.d - pm.b * m.c, pm.d * m.c - pm.c * m.d) * MathUtils.radDeg;\n }\n\n rotateWorld (degrees: number) {\n let m = this.matrix;\n let a = this.matrix.a, b = m.c, c = m.b, d = m.d;\n let cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\n m.a = cos * a - sin * c;\n m.c = cos * b - sin * d;\n m.b = sin * a + cos * c;\n m.d = sin * b + cos * d;\n this.appliedValid = false;\n }\n\n /** Computes the individual applied transform values from the world transform. This can be useful to perform processing using\n * the applied transform after the world transform has been modified directly (eg, by a constraint).\n *

\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */\n updateAppliedTransform () {\n this.appliedValid = true;\n let parent = this.parent;\n let m = this.matrix;\n if (parent == null) {\n this.ax = m.tx;\n this.ay = m.ty;\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\n this.ashearX = 0;\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\n return;\n }\n let pm = parent.matrix;\n let pid = 1 / (pm.a * pm.d - pm.b * pm.c);\n let dx = m.tx - pm.tx, dy = m.ty - pm.ty;\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\n let ia = pid * pm.d;\n let id = pid * pm.a;\n let ib = pid * pm.c;\n let ic = pid * pm.b;\n let ra = ia * m.a - ib * m.b;\n let rb = ia * m.c - ib * m.d;\n let rc = id * m.b - ic * m.a;\n let rd = id * m.d - ic * m.c;\n this.ashearX = 0;\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\n if (this.ascaleX > 0.0001) {\n let det = ra * rd - rb * rc;\n this.ascaleY = det / this.ascaleX;\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\n } else {\n this.ascaleX = 0;\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\n this.ashearY = 0;\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\n }\n }\n\n worldToLocal (world: Vector2) {\n let m = this.matrix;\n let a = m.a, b = m.c, c = m.b, d = m.d;\n let invDet = 1 / (a * d - b * c);\n let x = world.x - m.tx, y = world.y - m.ty;\n world.x = (x * d * invDet - y * b * invDet);\n world.y = (y * a * invDet - x * c * invDet);\n return world;\n }\n\n localToWorld (local: Vector2) {\n let m = this.matrix;\n let x = local.x, y = local.y;\n local.x = x * m.a + y * m.c + m.tx;\n local.y = x * m.b + y * m.d + m.ty;\n return local;\n }\n}\n","/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class BoneData {\n index: number;\n name: string;\n parent: BoneData;\n length: number;\n x = 0; y = 0; rotation = 0; scaleX = 1; scaleY = 1; shearX = 0; shearY = 0;\n transformMode = TransformMode.Normal;\n\n constructor (index: number, name: string, parent: BoneData) {\n if (index < 0) throw new Error(\"index must be >= 0.\");\n if (name == null) throw new Error(\"name cannot be null.\");\n this.index = index;\n this.name = name;\n this.parent = parent;\n }\n}\n\nexport enum TransformMode {\n Normal, OnlyTranslation, NoRotationOrReflection, NoScale, NoScaleOrReflection, InheritRotation, InheritScale\n}\n","import {EventData} from \"./EventData\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Event {\r\n data: EventData;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n time: number;\r\n\r\n constructor (time: number, data: EventData) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n}\r\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class EventData {\r\n name: string;\r\n intValue: number;\r\n floatValue: number;\r\n stringValue: string;\r\n\r\n constructor (name: string) {\r\n this.name = name;\r\n }\r\n}\r\n","import {IkConstraintData} from \"./IkConstraintData\";\nimport {Bone} from \"./Bone\";\nimport {Skeleton} from \"./Skeleton\";\nimport {MathUtils} from \"./Utils\";\nimport {Constraint} from \"./Constraint\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class IkConstraint implements Constraint {\n data: IkConstraintData;\n bones: Array;\n target: Bone;\n mix = 1;\n bendDirection = 0;\n\n level = 0;\n\n constructor (data: IkConstraintData, skeleton: Skeleton) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.mix = data.mix;\n this.bendDirection = data.bendDirection;\n\n this.bones = new Array();\n for (let i = 0; i < data.bones.length; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findBone(data.target.name);\n }\n\n getOrder () {\n return this.data.order;\n }\n\n apply () {\n this.update();\n }\n\n update () {\n let target = this.target;\n let bones = this.bones;\n switch (bones.length) {\n case 1:\n this.apply1(bones[0], target.worldX, target.worldY, this.mix);\n break;\n case 2:\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix);\n break;\n }\n }\n\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\n * coordinate system. */\n apply1 (bone: Bone, targetX: number, targetY: number, alpha: number) {\n if (!bone.appliedValid) bone.updateAppliedTransform();\n let pp = bone.parent.matrix;\n let id = 1 / (pp.a * pp.d - pp.b * pp.c);\n let x = targetX - pp.tx, y = targetY - pp.ty;\n let tx = (x * pp.d - y * pp.c) * id - bone.ax, ty = (y * pp.a - x * pp.b) * id - bone.ay;\n let rotationIK = Math.atan2(ty, tx) * MathUtils.radDeg - bone.ashearX - bone.arotation;\n if (bone.ascaleX < 0) rotationIK += 180;\n if (rotationIK > 180)\n rotationIK -= 360;\n else if (rotationIK < -180) rotationIK += 360;\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, bone.ascaleX, bone.ascaleY, bone.ashearX,\n bone.ashearY);\n }\n\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\n * target is specified in the world coordinate system.\n * @param child A direct descendant of the parent bone. */\n apply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, alpha: number) {\n if (alpha == 0) {\n child.updateWorldTransform();\n return;\n }\n if (!parent.appliedValid) parent.updateAppliedTransform();\n if (!child.appliedValid) child.updateAppliedTransform();\n let px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, csx = child.ascaleX;\n\n let os1 = 0, os2 = 0, s2 = 0;\n if (psx < 0) {\n psx = -psx;\n os1 = 180;\n s2 = -1;\n } else {\n os1 = 0;\n s2 = 1;\n }\n if (psy < 0) {\n psy = -psy;\n s2 = -s2;\n }\n if (csx < 0) {\n csx = -csx;\n os2 = 180;\n } else\n os2 = 0;\n let pm = parent.matrix;\n let cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pm.a, b = pm.c, c = pm.b, d = pm.d;\n let u = Math.abs(psx - psy) <= 0.0001;\n if (!u) {\n cy = 0;\n cwx = a * cx + pm.tx;\n cwy = c * cx + pm.ty;\n } else {\n cy = child.ay;\n cwx = a * cx + b * cy + pm.tx;\n cwy = c * cx + d * cy + pm.ty;\n }\n let pp = parent.parent;\n let ppm = parent.parent.matrix;\n a = ppm.a;\n b = ppm.c;\n c = ppm.b;\n d = ppm.d;\n let id = 1 / (a * d - b * c), x = targetX - ppm.tx, y = targetY - ppm.ty;\n let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n x = cwx - ppm.tx;\n y = cwy - ppm.ty;\n let dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\n outer:\n if (u) {\n l2 *= psx;\n let cos = (tx * tx + ty * ty - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n if (cos < -1)\n cos = -1;\n else if (cos > 1) cos = 1;\n a2 = Math.acos(cos) * bendDir;\n a = l1 + l2 * cos;\n b = l2 * Math.sin(a2);\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n } else {\n a = psx * l2;\n b = psy * l2;\n let aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = Math.atan2(ty, tx);\n c = bb * l1 * l1 + aa * dd - aa * bb;\n let c1 = -2 * bb * l1, c2 = bb - aa;\n d = c1 * c1 - 4 * c2 * c;\n if (d >= 0) {\n let q = Math.sqrt(d);\n if (c1 < 0) q = -q;\n q = -(c1 + q) / 2;\n let r0 = q / c2, r1 = c / q;\n let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n if (r * r <= dd) {\n y = Math.sqrt(dd - r * r) * bendDir;\n a1 = ta - Math.atan2(y, r);\n a2 = Math.atan2(y / psy, (r - l1) / psx);\n break outer;\n }\n }\n let minAngle = 0, minDist = Number.MAX_VALUE, minX = 0, minY = 0;\n let maxAngle = 0, maxDist = 0, maxX = 0, maxY = 0;\n x = l1 + a;\n d = x * x;\n if (d > maxDist) {\n maxAngle = 0;\n maxDist = d;\n maxX = x;\n }\n x = l1 - a;\n d = x * x;\n if (d < minDist) {\n minAngle = MathUtils.PI;\n minDist = d;\n minX = x;\n }\n let angle = Math.acos(-a * l1 / (aa - bb));\n x = a * Math.cos(angle) + l1;\n y = b * Math.sin(angle);\n d = x * x + y * y;\n if (d < minDist) {\n minAngle = angle;\n minDist = d;\n minX = x;\n minY = y;\n }\n if (d > maxDist) {\n maxAngle = angle;\n maxDist = d;\n maxX = x;\n maxY = y;\n }\n if (dd <= (minDist + maxDist) / 2) {\n a1 = ta - Math.atan2(minY * bendDir, minX);\n a2 = minAngle * bendDir;\n } else {\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\n a2 = maxAngle * bendDir;\n }\n }\n let os = Math.atan2(cy, cx) * s2;\n let rotation = parent.arotation;\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\n if (a1 > 180)\n a1 -= 360;\n else if (a1 < -180) a1 += 360;\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, parent.ascaleX, parent.ascaleY, 0, 0);\n rotation = child.arotation;\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\n if (a2 > 180)\n a2 -= 360;\n else if (a2 < -180) a2 += 360;\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n }\n}\n","import {BoneData} from \"./BoneData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class IkConstraintData {\n name: string;\n order = 0;\n bones = new Array();\n target: BoneData;\n bendDirection = 1;\n mix = 1;\n\n constructor (name: string) {\n this.name = name;\n }\n}\n","import {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\nimport {Bone} from \"./Bone\";\nimport {Slot} from \"./Slot\";\nimport {Skeleton} from \"./Skeleton\";\nimport {PathAttachment} from \"./attachments\";\nimport {Utils, MathUtils} from \"./Utils\";\nimport {Constraint} from \"./Constraint\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class PathConstraint implements Constraint {\n static NONE = -1; static BEFORE = -2; static AFTER = -3;\n\n data: PathConstraintData;\n bones: Array;\n target: Slot;\n position = 0; spacing = 0; rotateMix = 0; translateMix = 0;\n\n spaces = new Array(); positions = new Array();\n world = new Array(); curves = new Array(); lengths = new Array();\n segments = new Array();\n\n constructor (data: PathConstraintData, skeleton: Skeleton) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.bones = new Array();\n for (let i = 0, n = data.bones.length; i < n; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findSlot(data.target.name);\n this.position = data.position;\n this.spacing = data.spacing;\n this.rotateMix = data.rotateMix;\n this.translateMix = data.translateMix;\n }\n\n apply () {\n this.update();\n }\n\n update () {\n let attachment = this.target.getAttachment();\n if (!(attachment instanceof PathAttachment)) return;\n\n let rotateMix = this.rotateMix, translateMix = this.translateMix;\n let translate = translateMix > 0, rotate = rotateMix > 0;\n if (!translate && !rotate) return;\n\n let data = this.data;\n let spacingMode = data.spacingMode;\n let lengthSpacing = spacingMode == SpacingMode.Length;\n let rotateMode = data.rotateMode;\n let tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\n let boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n let bones = this.bones;\n let spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = null;\n let spacing = this.spacing;\n if (scale || lengthSpacing) {\n if (scale) lengths = Utils.setArraySize(this.lengths, boneCount);\n for (let i = 0, n = spacesCount - 1; i < n;) {\n let bone = bones[i];\n let m = bone.matrix;\n let length = bone.data.length, x = length * m.a, y = length * m.b;\n length = Math.sqrt(x * x + y * y);\n if (scale) lengths[i] = length;\n spaces[++i] = lengthSpacing ? Math.max(0, length + spacing) : spacing;\n }\n } else {\n for (let i = 1; i < spacesCount; i++)\n spaces[i] = spacing;\n }\n\n let positions = this.computeWorldPositions(attachment, spacesCount, tangents,\n data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\n let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n let tip = rotateMode == RotateMode.Chain && offsetRotation == 0;\n for (let i = 0, p = 3; i < boneCount; i++, p += 3) {\n let bone = bones[i];\n let m = bone.matrix;\n m.tx += (boneX - m.tx) * translateMix;\n m.ty += (boneY - m.ty) * translateMix;\n let x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\n if (scale) {\n let length = lengths[i];\n if (length != 0) {\n let s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * rotateMix + 1;\n m.a *= s;\n m.b *= s;\n }\n }\n boneX = x;\n boneY = y;\n if (rotate) {\n let a = m.a, b = m.c, c = m.b, d = m.d, r = 0, cos = 0, sin = 0;\n if (tangents)\n r = positions[p - 1];\n else if (spaces[i + 1] == 0)\n r = positions[p + 2];\n else\n r = Math.atan2(dy, dx);\n r -= Math.atan2(c, a) - offsetRotation * MathUtils.degRad;\n if (tip) {\n cos = Math.cos(r);\n sin = Math.sin(r);\n let length = bone.data.length;\n boneX += (length * (cos * a - sin * c) - dx) * rotateMix;\n boneY += (length * (sin * a + cos * c) - dy) * rotateMix;\n }\n if (r > MathUtils.PI)\n r -= MathUtils.PI2;\n else if (r < -MathUtils.PI) //\n r += MathUtils.PI2;\n r *= rotateMix;\n cos = Math.cos(r);\n sin = Math.sin(r);\n m.a = cos * a - sin * c;\n m.c = cos * b - sin * d;\n m.b = sin * a + cos * c;\n m.d = sin * b + cos * d;\n }\n bone.appliedValid = false;\n }\n }\n\n computeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean, percentPosition: boolean,\n percentSpacing: boolean) {\n let target = this.target;\n let position = this.position;\n let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = null;\n let closed = path.closed;\n let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n\n if (!path.constantSpeed) {\n let lengths = path.lengths;\n curveCount -= closed ? 1 : 2;\n let pathLength = lengths[curveCount];\n if (percentPosition) position *= pathLength;\n if (percentSpacing) {\n for (let i = 0; i < spacesCount; i++)\n spaces[i] *= pathLength;\n }\n world = Utils.setArraySize(this.world, 8);\n for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n let space = spaces[i];\n position += space;\n let p = position;\n\n if (closed) {\n p %= pathLength;\n if (p < 0) p += pathLength;\n curve = 0;\n } else if (p < 0) {\n if (prevCurve != PathConstraint.BEFORE) {\n prevCurve = PathConstraint.BEFORE;\n path.computeWorldVerticesWith(target, 2, 4, world, 0);\n }\n this.addBeforePosition(p, world, 0, out, o);\n continue;\n } else if (p > pathLength) {\n if (prevCurve != PathConstraint.AFTER) {\n prevCurve = PathConstraint.AFTER;\n path.computeWorldVerticesWith(target, verticesLength - 6, 4, world, 0);\n }\n this.addAfterPosition(p - pathLength, world, 0, out, o);\n continue;\n }\n\n // Determine curve containing position.\n for (;; curve++) {\n let length = lengths[curve];\n if (p > length) continue;\n if (curve == 0)\n p /= length;\n else {\n let prev = lengths[curve - 1];\n p = (p - prev) / (length - prev);\n }\n break;\n }\n if (curve != prevCurve) {\n prevCurve = curve;\n if (closed && curve == curveCount) {\n path.computeWorldVerticesWith(target, verticesLength - 4, 4, world, 0);\n path.computeWorldVerticesWith(target, 0, 4, world, 4);\n } else\n path.computeWorldVerticesWith(target, curve * 6 + 2, 8, world, 0);\n }\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\n tangents || (i > 0 && space == 0));\n }\n return out;\n }\n\n // World vertices.\n if (closed) {\n verticesLength += 2;\n world = Utils.setArraySize(this.world, verticesLength);\n path.computeWorldVerticesWith(target, 2, verticesLength - 4, world, 0);\n path.computeWorldVerticesWith(target, 0, 2, world, verticesLength - 4);\n world[verticesLength - 2] = world[0];\n world[verticesLength - 1] = world[1];\n } else {\n curveCount--;\n verticesLength -= 4;\n world = Utils.setArraySize(this.world, verticesLength);\n path.computeWorldVerticesWith(target, 2, verticesLength, world, 0);\n }\n\n // Curve lengths.\n let curves = Utils.setArraySize(this.curves, curveCount);\n let pathLength = 0;\n let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n for (let i = 0, w = 2; i < curveCount; i++, w += 6) {\n cx1 = world[w];\n cy1 = world[w + 1];\n cx2 = world[w + 2];\n cy2 = world[w + 3];\n x2 = world[w + 4];\n y2 = world[w + 5];\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n ddfx = tmpx * 2 + dddfx;\n ddfy = tmpy * 2 + dddfy;\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx;\n dfy += ddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx + dddfx;\n dfy += ddfy + dddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n curves[i] = pathLength;\n x1 = x2;\n y1 = y2;\n }\n if (percentPosition) position *= pathLength;\n if (percentSpacing) {\n for (let i = 0; i < spacesCount; i++)\n spaces[i] *= pathLength;\n }\n\n let segments = this.segments;\n let curveLength = 0;\n for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n let space = spaces[i];\n position += space;\n let p = position;\n\n if (closed) {\n p %= pathLength;\n if (p < 0) p += pathLength;\n curve = 0;\n } else if (p < 0) {\n this.addBeforePosition(p, world, 0, out, o);\n continue;\n } else if (p > pathLength) {\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n continue;\n }\n\n // Determine curve containing position.\n for (;; curve++) {\n let length = curves[curve];\n if (p > length) continue;\n if (curve == 0)\n p /= length;\n else {\n let prev = curves[curve - 1];\n p = (p - prev) / (length - prev);\n }\n break;\n }\n\n // Curve segment lengths.\n if (curve != prevCurve) {\n prevCurve = curve;\n let ii = curve * 6;\n x1 = world[ii];\n y1 = world[ii + 1];\n cx1 = world[ii + 2];\n cy1 = world[ii + 3];\n cx2 = world[ii + 4];\n cy2 = world[ii + 5];\n x2 = world[ii + 6];\n y2 = world[ii + 7];\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n ddfx = tmpx * 2 + dddfx;\n ddfy = tmpy * 2 + dddfy;\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n segments[0] = curveLength;\n for (ii = 1; ii < 8; ii++) {\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[ii] = curveLength;\n }\n dfx += ddfx;\n dfy += ddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[8] = curveLength;\n dfx += ddfx + dddfx;\n dfy += ddfy + dddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[9] = curveLength;\n segment = 0;\n }\n\n // Weight by segment length.\n p *= curveLength;\n for (;; segment++) {\n let length = segments[segment];\n if (p > length) continue;\n if (segment == 0)\n p /= length;\n else {\n let prev = segments[segment - 1];\n p = segment + (p - prev) / (length - prev);\n }\n break;\n }\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\n }\n return out;\n }\n\n addBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\n let x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n out[o] = x1 + p * Math.cos(r);\n out[o + 1] = y1 + p * Math.sin(r);\n out[o + 2] = r;\n }\n\n addAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\n let x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n out[o] = x1 + p * Math.cos(r);\n out[o + 1] = y1 + p * Math.sin(r);\n out[o + 2] = r;\n }\n\n addCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\n out: Array, o: number, tangents: boolean) {\n if (p == 0 || isNaN(p)) p = 0.0001;\n let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n out[o] = x;\n out[o + 1] = y;\n if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n }\n\n getOrder () {\n return this.data.order;\n }\n}\n","import {BoneData} from \"./BoneData\";\nimport {SlotData} from \"./SlotData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class PathConstraintData {\n name: string;\n order = 0;\n bones = new Array();\n target: SlotData;\n positionMode: PositionMode;\n spacingMode: SpacingMode;\n rotateMode: RotateMode;\n offsetRotation: number;\n position: number; spacing: number; rotateMix: number; translateMix: number;\n\n constructor (name: string) {\n this.name = name;\n }\n}\n\nexport enum PositionMode {\n Fixed, Percent\n}\n\nexport enum SpacingMode {\n Length, Fixed, Percent\n}\n\nexport enum RotateMode {\n Tangent, Chain, ChainScale\n}\n","import {Slot} from \"./Slot\";\nimport {Bone} from \"./Bone\";\nimport {IkConstraint} from \"./IkConstraint\";\nimport {TransformConstraint} from \"./TransformConstraint\";\nimport {PathConstraint} from \"./PathConstraint\";\nimport {Color, Utils, Vector2} from \"./Utils\";\nimport {Skin} from \"./Skin\";\nimport {SkeletonData} from \"./SkeletonData\";\nimport {Updatable} from \"./Updatable\";\nimport {Attachment, PathAttachment, RegionAttachment, MeshAttachment} from \"./attachments\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Skeleton {\n data: SkeletonData;\n bones: Array;\n slots: Array;\n drawOrder: Array;\n ikConstraints: Array;\n transformConstraints: Array;\n pathConstraints: Array;\n _updateCache = new Array();\n updateCacheReset = new Array();\n skin: Skin;\n color: Color;\n time = 0;\n flipX = false; flipY = false;\n x = 0; y = 0;\n\n constructor (data: SkeletonData) {\n if (data == null) throw new Error(\"data cannot be null.\");\n this.data = data;\n\n this.bones = new Array();\n for (let i = 0; i < data.bones.length; i++) {\n let boneData = data.bones[i];\n let bone: Bone;\n if (boneData.parent == null)\n bone = new Bone(boneData, this, null);\n else {\n let parent = this.bones[boneData.parent.index];\n bone = new Bone(boneData, this, parent);\n parent.children.push(bone);\n }\n this.bones.push(bone);\n }\n\n this.slots = new Array();\n this.drawOrder = new Array();\n for (let i = 0; i < data.slots.length; i++) {\n let slotData = data.slots[i];\n let bone = this.bones[slotData.boneData.index];\n let slot = new Slot(slotData, bone);\n this.slots.push(slot);\n this.drawOrder.push(slot);\n }\n\n this.ikConstraints = new Array();\n for (let i = 0; i < data.ikConstraints.length; i++) {\n let ikConstraintData = data.ikConstraints[i];\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\n }\n\n this.transformConstraints = new Array();\n for (let i = 0; i < data.transformConstraints.length; i++) {\n let transformConstraintData = data.transformConstraints[i];\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\n }\n\n this.pathConstraints = new Array();\n for (let i = 0; i < data.pathConstraints.length; i++) {\n let pathConstraintData = data.pathConstraints[i];\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\n }\n\n this.color = new Color(1, 1, 1, 1);\n this.updateCache();\n }\n\n updateCache () {\n let updateCache = this._updateCache;\n updateCache.length = 0;\n\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n bones[i].sorted = false;\n\n let ikConstraints = this.ikConstraints;\n let transformConstraints = this.transformConstraints;\n let pathConstraints = this.pathConstraints;\n let ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\n let constraintCount = ikCount + transformCount + pathCount;\n\n outer:\n for (let i = 0; i < constraintCount; i++) {\n for (let ii = 0; ii < ikCount; ii++) {\n let constraint = ikConstraints[ii];\n if (constraint.data.order == i) {\n this.sortIkConstraint(constraint);\n continue outer;\n }\n }\n for (let ii = 0; ii < transformCount; ii++) {\n let constraint = transformConstraints[ii];\n if (constraint.data.order == i) {\n this.sortTransformConstraint(constraint);\n continue outer;\n }\n }\n for (let ii = 0; ii < pathCount; ii++) {\n let constraint = pathConstraints[ii];\n if (constraint.data.order == i) {\n this.sortPathConstraint(constraint);\n continue outer;\n }\n }\n }\n\n for (let i = 0, n = bones.length; i < n; i++)\n this.sortBone(bones[i]);\n }\n\n sortIkConstraint (constraint: IkConstraint) {\n let target = constraint.target;\n this.sortBone(target);\n\n let constrained = constraint.bones;\n let parent = constrained[0];\n this.sortBone(parent);\n\n if (constrained.length > 1) {\n let child = constrained[constrained.length - 1];\n if (!(this._updateCache.indexOf(child) > -1)) this.updateCacheReset.push(child);\n }\n\n this._updateCache.push(constraint);\n\n this.sortReset(parent.children);\n constrained[constrained.length - 1].sorted = true;\n }\n\n sortPathConstraint (constraint: PathConstraint) {\n let slot = constraint.target;\n let slotIndex = slot.data.index;\n let slotBone = slot.bone;\n if (this.skin != null) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\n for (let ii = 0, nn = this.data.skins.length; ii < nn; ii++)\n this.sortPathConstraintAttachment(this.data.skins[ii], slotIndex, slotBone);\n\n let attachment = slot.getAttachment();\n if (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\n\n let constrained = constraint.bones;\n let boneCount = constrained.length;\n for (let ii = 0; ii < boneCount; ii++)\n this.sortBone(constrained[ii]);\n\n this._updateCache.push(constraint);\n\n for (let ii = 0; ii < boneCount; ii++)\n this.sortReset(constrained[ii].children);\n for (let ii = 0; ii < boneCount; ii++)\n constrained[ii].sorted = true;\n }\n\n sortTransformConstraint (constraint: TransformConstraint) {\n this.sortBone(constraint.target);\n\n let constrained = constraint.bones;\n let boneCount = constrained.length;\n for (let ii = 0; ii < boneCount; ii++)\n this.sortBone(constrained[ii]);\n\n this._updateCache.push(constraint);\n\n for (let ii = 0; ii < boneCount; ii++)\n this.sortReset(constrained[ii].children);\n for (let ii = 0; ii < boneCount; ii++)\n constrained[ii].sorted = true;\n }\n\n sortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\n let attachments = skin.attachments[slotIndex];\n if (!attachments) return;\n for (let key in attachments) {\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\n }\n }\n\n sortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\n if (!(attachment instanceof PathAttachment)) return;\n let pathBones = (attachment).bones;\n if (pathBones == null)\n this.sortBone(slotBone);\n else {\n let bones = this.bones;\n let i = 0;\n while (i < pathBones.length) {\n let boneCount = pathBones[i++];\n for (let n = i + boneCount; i < n; i++) {\n let boneIndex = pathBones[i];\n this.sortBone(bones[boneIndex]);\n }\n }\n }\n }\n\n sortBone (bone: Bone) {\n if (bone.sorted) return;\n let parent = bone.parent;\n if (parent != null) this.sortBone(parent);\n bone.sorted = true;\n this._updateCache.push(bone);\n }\n\n sortReset (bones: Array) {\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n if (bone.sorted) this.sortReset(bone.children);\n bone.sorted = false;\n }\n }\n\n /** Updates the world transform for each bone and applies constraints. */\n updateWorldTransform () {\n let updateCacheReset = this.updateCacheReset;\n for (let i = 0, n = updateCacheReset.length; i < n; i++) {\n let bone = updateCacheReset[i] as Bone;\n bone.ax = bone.x;\n bone.ay = bone.y;\n bone.arotation = bone.rotation;\n bone.ascaleX = bone.scaleX;\n bone.ascaleY = bone.scaleY;\n bone.ashearX = bone.shearX;\n bone.ashearY = bone.shearY;\n bone.appliedValid = true;\n }\n let updateCache = this._updateCache;\n for (let i = 0, n = updateCache.length; i < n; i++)\n updateCache[i].update();\n }\n\n /** Sets the bones, constraints, and slots to their setup pose values. */\n setToSetupPose () {\n this.setBonesToSetupPose();\n this.setSlotsToSetupPose();\n }\n\n /** Sets the bones and constraints to their setup pose values. */\n setBonesToSetupPose () {\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n bones[i].setToSetupPose();\n\n let ikConstraints = this.ikConstraints;\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\n let constraint = ikConstraints[i];\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.mix = constraint.data.mix;\n }\n\n let transformConstraints = this.transformConstraints;\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\n let constraint = transformConstraints[i];\n let data = constraint.data;\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n constraint.scaleMix = data.scaleMix;\n constraint.shearMix = data.shearMix;\n }\n\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\n let constraint = pathConstraints[i];\n let data = constraint.data;\n constraint.position = data.position;\n constraint.spacing = data.spacing;\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n }\n }\n\n setSlotsToSetupPose () {\n let slots = this.slots;\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n for (let i = 0, n = slots.length; i < n; i++)\n slots[i].setToSetupPose();\n }\n\n /** @return May return null. */\n getRootBone () {\n if (this.bones.length == 0) return null;\n return this.bones[0];\n }\n\n /** @return May be null. */\n findBone (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n if (bone.data.name == boneName) return bone;\n }\n return null;\n }\n\n /** @return -1 if the bone was not found. */\n findBoneIndex (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n if (bones[i].data.name == boneName) return i;\n return -1;\n }\n\n /** @return May be null. */\n findSlot (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n if (slot.data.name == slotName) return slot;\n }\n return null;\n }\n\n /** @return -1 if the bone was not found. */\n findSlotIndex (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++)\n if (slots[i].data.name == slotName) return i;\n return -1;\n }\n\n /** Sets a skin by name.\n * @see #setSkin(Skin) */\n setSkinByName (skinName: string) {\n let skin = this.data.findSkin(skinName);\n if (skin == null) throw new Error(\"Skin not found: \" + skinName);\n this.setSkin(skin);\n }\n\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\n * old skin, each slot's setup mode attachment is attached from the new skin.\n * @param newSkin May be null. */\n setSkin (newSkin: Skin) {\n if (newSkin != null) {\n if (this.skin != null)\n newSkin.attachAll(this, this.skin);\n else {\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n let name = slot.data.attachmentName;\n if (name != null) {\n let attachment: Attachment = newSkin.getAttachment(i, name);\n if (attachment != null) slot.setAttachment(attachment);\n }\n }\n }\n }\n this.skin = newSkin;\n }\n\n /** @return May be null. */\n getAttachmentByName (slotName: string, attachmentName: string): Attachment {\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\n }\n\n /** @return May be null. */\n getAttachment (slotIndex: number, attachmentName: string): Attachment {\n if (attachmentName == null) throw new Error(\"attachmentName cannot be null.\");\n if (this.skin != null) {\n let attachment: Attachment = this.skin.getAttachment(slotIndex, attachmentName);\n if (attachment != null) return attachment;\n }\n if (this.data.defaultSkin != null) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n return null;\n }\n\n /** @param attachmentName May be null. */\n setAttachment (slotName: string, attachmentName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n if (slot.data.name == slotName) {\n let attachment: Attachment = null;\n if (attachmentName != null) {\n attachment = this.getAttachment(i, attachmentName);\n if (attachment == null)\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\n }\n slot.setAttachment(attachment);\n return;\n }\n }\n throw new Error(\"Slot not found: \" + slotName);\n }\n\n /** @return May be null. */\n findIkConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let ikConstraints = this.ikConstraints;\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\n let ikConstraint = ikConstraints[i];\n if (ikConstraint.data.name == constraintName) return ikConstraint;\n }\n return null;\n }\n\n /** @return May be null. */\n findTransformConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let transformConstraints = this.transformConstraints;\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\n let constraint = transformConstraints[i];\n if (constraint.data.name == constraintName) return constraint;\n }\n return null;\n }\n\n /** @return May be null. */\n findPathConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\n let constraint = pathConstraints[i];\n if (constraint.data.name == constraintName) return constraint;\n }\n return null;\n }\n\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\n * @param size The width and height of the AABB. */\n getBounds (offset: Vector2, size: Vector2) {\n if (offset == null) throw new Error(\"offset cannot be null.\");\n if (size == null) throw new Error(\"size cannot be null.\");\n let drawOrder = this.drawOrder;\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n for (let i = 0, n = drawOrder.length; i < n; i++) {\n let slot = drawOrder[i];\n let vertices: ArrayLike = null;\n let attachment = slot.getAttachment();\n if (attachment instanceof RegionAttachment)\n vertices = (attachment).updateWorldVertices(slot, false);\n else if (attachment instanceof MeshAttachment) //\n vertices = (attachment).updateWorldVertices(slot, true);\n if (vertices != null) {\n for (let ii = 0, nn = vertices.length; ii < nn; ii += 8) {\n let x = vertices[ii], y = vertices[ii + 1];\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x);\n maxY = Math.max(maxY, y);\n }\n }\n }\n offset.set(minX, minY);\n size.set(maxX - minX, maxY - minY);\n }\n\n update (delta: number) {\n this.time += delta;\n }\n}\n","import {Utils, Pool} from \"./Utils\";\r\nimport {Skeleton} from \"./Skeleton\";\r\nimport {BoundingBoxAttachment} from \"./attachments\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SkeletonBounds {\r\n minX = 0; minY = 0; maxX = 0; maxY = 0;\r\n boundingBoxes = new Array();\r\n polygons = new Array>();\r\n private polygonPool = new Pool>(() => {\r\n return Utils.newFloatArray(16);\r\n });\r\n\r\n update (skeleton: Skeleton, updateAabb: boolean) {\r\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\r\n let boundingBoxes = this.boundingBoxes;\r\n let polygons = this.polygons;\r\n let polygonPool = this.polygonPool;\r\n let slots = skeleton.slots;\r\n let slotCount = slots.length;\r\n\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n\r\n for (let i = 0; i < slotCount; i++) {\r\n let slot = slots[i];\r\n let attachment = slot.getAttachment();\r\n if (attachment instanceof BoundingBoxAttachment) {\r\n let boundingBox = attachment as BoundingBoxAttachment;\r\n boundingBoxes.push(boundingBox);\r\n\r\n let polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, polygon);\r\n }\r\n }\r\n\r\n if (updateAabb) this.aabbCompute();\r\n }\r\n\r\n aabbCompute () {\r\n let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++) {\r\n let polygon = polygons[i];\r\n let vertices = polygon;\r\n for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n let x = vertices[ii];\r\n let y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box contains the point. */\r\n aabbContainsPoint (x: number, y: number) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the line segment. */\r\n aabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let minX = this.minX;\r\n let minY = this.minY;\r\n let maxX = this.maxX;\r\n let maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n let m = (y2 - y1) / (x2 - x1);\r\n let y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY) return true;\r\n let x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX) return true;\r\n return false;\r\n }\r\n\r\n /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\r\n aabbIntersectsSkeleton (bounds: SkeletonBounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\r\n * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\r\n containsPoint (x: number, y: number): BoundingBoxAttachment {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains the point. */\r\n containsPointPolygon (polygon: ArrayLike, x: number, y: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let prevIndex = nn - 2;\r\n let inside = false;\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let vertexY = vertices[ii + 1];\r\n let prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n let vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n }\r\n\r\n /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\r\n * is usually more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns\r\n * true. */\r\n intersectsSegment (x1: number, y1: number, x2: number, y2: number) {\r\n let polygons = this.polygons;\r\n for (let i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\r\n return null;\r\n }\r\n\r\n /** Returns true if the polygon contains any part of the line segment. */\r\n intersectsSegmentPolygon (polygon: ArrayLike, x1: number, y1: number, x2: number, y2: number) {\r\n let vertices = polygon;\r\n let nn = polygon.length;\r\n\r\n let width12 = x1 - x2, height12 = y1 - y2;\r\n let det1 = x1 * y2 - y1 * x2;\r\n let x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (let ii = 0; ii < nn; ii += 2) {\r\n let x4 = vertices[ii], y4 = vertices[ii + 1];\r\n let det2 = x3 * y4 - y3 * x4;\r\n let width34 = x3 - x4, height34 = y3 - y4;\r\n let det3 = width12 * height34 - height12 * width34;\r\n let x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n let y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n }\r\n\r\n /** Returns the polygon for the specified bounding box, or null. */\r\n getPolygon (boundingBox: BoundingBoxAttachment) {\r\n if (boundingBox == null) throw new Error(\"boundingBox cannot be null.\");\r\n let index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n }\r\n\r\n getWidth () {\r\n return this.maxX - this.minX;\r\n }\r\n\r\n getHeight () {\r\n return this.maxY - this.minY;\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\nimport {SlotData} from \"./SlotData\";\nimport {Skin} from \"./Skin\";\nimport {EventData} from \"./EventData\";\nimport {Animation} from \"./Animation\";\nimport {IkConstraintData} from \"./IkConstraintData\";\nimport {TransformConstraintData} from \"./TransformConstraintData\";\nimport {PathConstraintData} from \"./PathConstraintData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class SkeletonData {\n name: string;\n bones = new Array(); // Ordered parents first.\n slots = new Array(); // Setup pose draw order.\n skins = new Array();\n defaultSkin: Skin;\n events = new Array();\n animations = new Array();\n ikConstraints = new Array();\n transformConstraints = new Array();\n pathConstraints = new Array();\n width: number; height: number;\n version: string; hash: string;\n\n // Nonessential\n fps = 0;\n imagesPath: string;\n\n findBone (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n if (bone.name == boneName) return bone;\n }\n return null;\n }\n\n findBoneIndex (boneName: string) {\n if (boneName == null) throw new Error(\"boneName cannot be null.\");\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++)\n if (bones[i].name == boneName) return i;\n return -1;\n }\n\n findSlot (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++) {\n let slot = slots[i];\n if (slot.name == slotName) return slot;\n }\n return null;\n }\n\n findSlotIndex (slotName: string) {\n if (slotName == null) throw new Error(\"slotName cannot be null.\");\n let slots = this.slots;\n for (let i = 0, n = slots.length; i < n; i++)\n if (slots[i].name == slotName) return i;\n return -1;\n }\n\n findSkin (skinName: string) {\n if (skinName == null) throw new Error(\"skinName cannot be null.\");\n let skins = this.skins;\n for (let i = 0, n = skins.length; i < n; i++) {\n let skin = skins[i];\n if (skin.name == skinName) return skin;\n }\n return null;\n }\n\n findEvent (eventDataName: string) {\n if (eventDataName == null) throw new Error(\"eventDataName cannot be null.\");\n let events = this.events;\n for (let i = 0, n = events.length; i < n; i++) {\n let event = events[i];\n if (event.name == eventDataName) return event;\n }\n return null;\n }\n\n findAnimation (animationName: string) {\n if (animationName == null) throw new Error(\"animationName cannot be null.\");\n let animations = this.animations;\n for (let i = 0, n = animations.length; i < n; i++) {\n let animation = animations[i];\n if (animation.name == animationName) return animation;\n }\n return null;\n }\n\n findIkConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let ikConstraints = this.ikConstraints;\n for (let i = 0, n = ikConstraints.length; i < n; i++) {\n let constraint = ikConstraints[i];\n if (constraint.name == constraintName) return constraint;\n }\n return null;\n }\n\n findTransformConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let transformConstraints = this.transformConstraints;\n for (let i = 0, n = transformConstraints.length; i < n; i++) {\n let constraint = transformConstraints[i];\n if (constraint.name == constraintName) return constraint;\n }\n return null;\n }\n\n findPathConstraint (constraintName: string) {\n if (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++) {\n let constraint = pathConstraints[i];\n if (constraint.name == constraintName) return constraint;\n }\n return null;\n }\n\n findPathConstraintIndex (pathConstraintName: string) {\n if (pathConstraintName == null) throw new Error(\"pathConstraintName cannot be null.\");\n let pathConstraints = this.pathConstraints;\n for (let i = 0, n = pathConstraints.length; i < n; i++)\n if (pathConstraints[i].name == pathConstraintName) return i;\n return -1;\n }\n}\n","import {SkeletonData} from \"./SkeletonData\";\nimport {BoneData, TransformMode} from \"./BoneData\";\nimport {SlotData} from \"./SlotData\";\nimport {Event} from \"./Event\";\nimport {IkConstraintData} from \"./IkConstraintData\";\nimport {TransformConstraintData} from \"./TransformConstraintData\";\nimport {PathConstraintData, PositionMode, SpacingMode, RotateMode} from \"./PathConstraintData\";\nimport {Skin} from \"./Skin\";\nimport {EventData} from \"./EventData\";\nimport {Attachment, AttachmentLoader, MeshAttachment, VertexAttachment} from \"./attachments\";\nimport {Utils, Color, ArrayLike} from \"./Utils\";\nimport {\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\n Animation, CurveTimeline\n} from \"./Animation\";\nimport {BlendMode} from \"./BlendMode\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class SkeletonJson {\n attachmentLoader: AttachmentLoader;\n scale = 1;\n private linkedMeshes = new Array();\n\n constructor (attachmentLoader: AttachmentLoader) {\n this.attachmentLoader = attachmentLoader;\n }\n\n readSkeletonData (json: string | any ): SkeletonData {\n let scale = this.scale;\n let skeletonData = new SkeletonData();\n let root = typeof(json) === \"string\" ? JSON.parse(json) : json;\n\n // Skeleton\n let skeletonMap = root.skeleton;\n if (skeletonMap != null) {\n skeletonData.hash = skeletonMap.hash;\n skeletonData.version = skeletonMap.spine;\n skeletonData.width = skeletonMap.width;\n skeletonData.height = skeletonMap.height;\n skeletonData.fps = skeletonMap.fps;\n skeletonData.imagesPath = skeletonMap.images;\n }\n\n // Bones\n if (root.bones) {\n for (let i = 0; i < root.bones.length; i++) {\n let boneMap = root.bones[i];\n\n let parent: BoneData = null;\n let parentName: string = this.getValue(boneMap, \"parent\", null);\n if (parentName != null) {\n parent = skeletonData.findBone(parentName);\n if (parent == null) throw new Error(\"Parent bone not found: \" + parentName);\n }\n let data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\n\n //this is legacy\n if (boneMap.hasOwnProperty(\"inheritScale\") || boneMap.hasOwnProperty(\"inheritRotation\")) {\n //before 3.5\n data.transformMode = SkeletonJson.transformModeLegacy(\n this.getValue(boneMap, \"inheritRotation\", true),\n this.getValue(boneMap, \"inheritScale\", true));\n } else {\n //after 3.5\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\n }\n\n skeletonData.bones.push(data);\n }\n }\n\n // Slots.\n if (root.slots) {\n for (let i = 0; i < root.slots.length; i++) {\n let slotMap = root.slots[i];\n let slotName: string = slotMap.name;\n let boneName: string = slotMap.bone;\n let boneData = skeletonData.findBone(boneName);\n if (boneData == null) throw new Error(\"Slot bone not found: \" + boneName);\n let data = new SlotData(skeletonData.slots.length, slotName, boneData);\n\n let color: string = this.getValue(slotMap, \"color\", null);\n if (color != null) data.color.setFromString(color);\n\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\n skeletonData.slots.push(data);\n }\n }\n\n // IK constraints\n if (root.ik) {\n for (let i = 0; i < root.ik.length; i++) {\n let constraintMap = root.ik[i];\n let data = new IkConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n\n for (let j = 0; j < constraintMap.bones.length; j++) {\n let boneName = constraintMap.bones[j];\n let bone = skeletonData.findBone(boneName);\n if (bone == null) throw new Error(\"IK bone not found: \" + boneName);\n data.bones.push(bone);\n }\n\n let targetName: string = constraintMap.target;\n data.target = skeletonData.findBone(targetName);\n if (data.target == null) throw new Error(\"IK target bone not found: \" + targetName);\n\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n data.mix = this.getValue(constraintMap, \"mix\", 1);\n\n skeletonData.ikConstraints.push(data);\n }\n }\n\n // Transform constraints.\n if (root.transform) {\n for (let i = 0; i < root.transform.length; i++) {\n let constraintMap = root.transform[i];\n let data = new TransformConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n\n for (let j = 0; j < constraintMap.bones.length; j++) {\n let boneName = constraintMap.bones[j];\n let bone = skeletonData.findBone(boneName);\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\n data.bones.push(bone);\n }\n\n let targetName: string = constraintMap.target;\n data.target = skeletonData.findBone(targetName);\n if (data.target == null) throw new Error(\"Transform constraint target bone not found: \" + targetName);\n\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\n\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\n\n skeletonData.transformConstraints.push(data);\n }\n }\n\n // Path constraints.\n if (root.path) {\n for (let i = 0; i < root.path.length; i++) {\n let constraintMap = root.path[i];\n let data = new PathConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n\n for (let j = 0; j < constraintMap.bones.length; j++) {\n let boneName = constraintMap.bones[j];\n let bone = skeletonData.findBone(boneName);\n if (bone == null) throw new Error(\"Transform constraint bone not found: \" + boneName);\n data.bones.push(bone);\n }\n\n let targetName: string = constraintMap.target;\n data.target = skeletonData.findSlot(targetName);\n if (data.target == null) throw new Error(\"Path target slot not found: \" + targetName);\n\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\n data.position = this.getValue(constraintMap, \"position\", 0);\n if (data.positionMode == PositionMode.Fixed) data.position *= scale;\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\n\n skeletonData.pathConstraints.push(data);\n }\n }\n\n // Skins.\n if (root.skins) {\n for (let skinName in root.skins) {\n let skinMap = root.skins[skinName]\n let skin = new Skin(skinName);\n for (let slotName in skinMap) {\n let slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\n let slotMap = skinMap[slotName];\n for (let entryName in slotMap) {\n let attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName);\n if (attachment != null) skin.addAttachment(slotIndex, entryName, attachment);\n }\n }\n skeletonData.skins.push(skin);\n if (skin.name == \"default\") skeletonData.defaultSkin = skin;\n }\n }\n\n // Linked meshes.\n for (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\n let linkedMesh = this.linkedMeshes[i];\n let skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n if (skin == null) throw new Error(\"Skin not found: \" + linkedMesh.skin);\n let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n if (parent == null) throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\n linkedMesh.mesh.setParentMesh( parent);\n // linkedMesh.mesh.updateUVs();\n }\n this.linkedMeshes.length = 0;\n\n // Events.\n if (root.events) {\n for (let eventName in root.events) {\n let eventMap = root.events[eventName];\n let data = new EventData(eventName);\n data.intValue = this.getValue(eventMap, \"int\", 0);\n data.floatValue = this.getValue(eventMap, \"float\", 0);\n data.stringValue = this.getValue(eventMap, \"string\", null);\n skeletonData.events.push(data);\n }\n }\n\n // Animations.\n if (root.animations) {\n for (let animationName in root.animations) {\n let animationMap = root.animations[animationName];\n this.readAnimation(animationMap, animationName, skeletonData);\n }\n }\n\n return skeletonData;\n }\n\n readAttachment (map: any, skin: Skin, slotIndex: number, name: string): Attachment {\n let scale = this.scale;\n name = this.getValue(map, \"name\", name);\n\n let type = this.getValue(map, \"type\", \"region\");\n\n switch (type) {\n case \"region\": {\n let path = this.getValue(map, \"path\", name);\n let region = this.attachmentLoader.newRegionAttachment(skin, name, path);\n if (region == null) return null;\n region.path = path;\n region.x = this.getValue(map, \"x\", 0) * scale;\n region.y = this.getValue(map, \"y\", 0) * scale;\n region.scaleX = this.getValue(map, \"scaleX\", 1);\n region.scaleY = this.getValue(map, \"scaleY\", 1);\n region.rotation = this.getValue(map, \"rotation\", 0);\n region.width = map.width * scale;\n region.height = map.height * scale;\n\n let color: string = this.getValue(map, \"color\", null);\n if (color != null) region.color.setFromString(color);\n\n return region;\n }\n case \"boundingbox\": {\n let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n if (box == null) return null;\n this.readVertices(map, box, map.vertexCount << 1);\n let color: string = this.getValue(map, \"color\", null);\n if (color != null) box.color.setFromString(color);\n return box;\n }\n //weightedmesh is deprecated but who cares\n case \"weightedmesh\":\n case \"skinnedmesh\":\n case \"mesh\":\n case \"linkedmesh\": {\n let path = this.getValue(map, \"path\", name);\n let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\n if (mesh == null) return null;\n mesh.path = path;\n\n let color = this.getValue(map, \"color\", null);\n if (color != null) mesh.color.setFromString(color);\n\n let parent: string = this.getValue(map, \"parent\", null);\n if (parent != null) {\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent));\n return mesh;\n }\n\n let uvs: Array = map.uvs;\n this.readVertices(map, mesh, uvs.length);\n mesh.triangles = map.triangles;\n mesh.regionUVs = uvs;\n // mesh.updateUVs();\n\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\n return mesh;\n }\n case \"path\": {\n let path = this.attachmentLoader.newPathAttachment(skin, name);\n if (path == null) return null;\n path.closed = this.getValue(map, \"closed\", false);\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\n\n let vertexCount = map.vertexCount;\n this.readVertices(map, path, vertexCount << 1);\n\n let lengths: Array = Utils.newArray(vertexCount / 3, 0);\n for (let i = 0; i < map.lengths.length; i++)\n lengths[i++] = map.lengths[i] * scale;\n path.lengths = lengths;\n\n let color: string = this.getValue(map, \"color\", null);\n if (color != null) path.color.setFromString(color);\n return path;\n }\n }\n return null;\n }\n\n readVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\n let scale = this.scale;\n attachment.worldVerticesLength = verticesLength;\n let vertices: Array = map.vertices;\n if (verticesLength == vertices.length) {\n if (scale != 1) {\n for (let i = 0, n = vertices.length; i < n; i++)\n vertices[i] *= scale;\n }\n attachment.vertices = Utils.toFloatArray(vertices);\n return;\n }\n let weights = new Array();\n let bones = new Array();\n for (let i = 0, n = vertices.length; i < n;) {\n let boneCount = vertices[i++];\n bones.push(boneCount);\n for (let nn = i + boneCount * 4; i < nn; i += 4) {\n bones.push(vertices[i]);\n weights.push(vertices[i + 1] * scale);\n weights.push(vertices[i + 2] * scale);\n weights.push(vertices[i + 3]);\n }\n }\n attachment.bones = bones;\n attachment.vertices = Utils.toFloatArray(weights);\n }\n\n readAnimation (map: any, name: string, skeletonData: SkeletonData) {\n let scale = this.scale;\n let timelines = new Array();\n let duration = 0;\n\n // Slot timelines.\n if (map.slots) {\n for (let slotName in map.slots) {\n let slotMap = map.slots[slotName];\n let slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotName);\n for (let timelineName in slotMap) {\n let timelineMap = slotMap[timelineName];\n if (timelineName == \"color\") {\n let timeline = new ColorTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n let color = new Color();\n color.setFromString(valueMap.color);\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\n\n } else if (timelineName = \"attachment\") {\n let timeline = new AttachmentTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n } else\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\n }\n }\n }\n\n // Bone timelines.\n if (map.bones) {\n for (let boneName in map.bones) {\n let boneMap = map.bones[boneName];\n let boneIndex = skeletonData.findBoneIndex(boneName);\n if (boneIndex == -1) throw new Error(\"Bone not found: \" + boneName);\n for (let timelineName in boneMap) {\n let timelineMap = boneMap[timelineName];\n if (timelineName === \"rotate\") {\n let timeline = new RotateTimeline(timelineMap.length);\n timeline.boneIndex = boneIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\n\n } else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\n let timeline: TranslateTimeline = null;\n let timelineScale = 1;\n if (timelineName === \"scale\")\n timeline = new ScaleTimeline(timelineMap.length);\n else if (timelineName === \"shear\")\n timeline = new ShearTimeline(timelineMap.length);\n else {\n timeline = new TranslateTimeline(timelineMap.length);\n timelineScale = scale;\n }\n timeline.boneIndex = boneIndex;\n\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n let x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\n\n } else\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\n }\n }\n }\n\n // IK constraint timelines.\n if (map.ik) {\n for (let constraintName in map.ik) {\n let constraintMap = map.ik[constraintName];\n let constraint = skeletonData.findIkConstraint(constraintName);\n let timeline = new IkConstraintTimeline(constraintMap.length);\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\n let frameIndex = 0;\n for (let i = 0; i < constraintMap.length; i++) {\n let valueMap = constraintMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1),\n this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\n }\n }\n\n // Transform constraint timelines.\n if (map.transform) {\n for (let constraintName in map.transform) {\n let constraintMap = map.transform[constraintName];\n let constraint = skeletonData.findTransformConstraint(constraintName);\n let timeline = new TransformConstraintTimeline(constraintMap.length);\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\n let frameIndex = 0;\n for (let i = 0; i < constraintMap.length; i++) {\n let valueMap = constraintMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\n this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration,\n timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\n }\n }\n\n // Path constraint timelines.\n if (map.paths) {\n for (let constraintName in map.paths) {\n let constraintMap = map.paths[constraintName];\n let index = skeletonData.findPathConstraintIndex(constraintName);\n if (index == -1) throw new Error(\"Path constraint not found: \" + constraintName);\n let data = skeletonData.pathConstraints[index];\n for (let timelineName in constraintMap) {\n let timelineMap = constraintMap[timelineName];\n if (timelineName === \"position\" || timelineName === \"spacing\") {\n let timeline: PathConstraintPositionTimeline = null;\n let timelineScale = 1;\n if (timelineName === \"spacing\") {\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) timelineScale = scale;\n } else {\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\n if (data.positionMode == PositionMode.Fixed) timelineScale = scale;\n }\n timeline.pathConstraintIndex = index;\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration,\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\n } else if (timelineName === \"mix\") {\n let timeline = new PathConstraintMixTimeline(timelineMap.length);\n timeline.pathConstraintIndex = index;\n let frameIndex = 0;\n for (let i = 0; i < timelineMap.length; i++) {\n let valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1),\n this.getValue(valueMap, \"translateMix\", 1));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration,\n timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\n }\n }\n }\n }\n\n // Deform timelines.\n if (map.deform) {\n for (let deformName in map.deform) {\n let deformMap = map.deform[deformName];\n let skin = skeletonData.findSkin(deformName);\n if (skin == null) throw new Error(\"Skin not found: \" + deformName);\n for (let slotName in deformMap) {\n let slotMap = deformMap[slotName];\n let slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + slotMap.name);\n for (let timelineName in slotMap) {\n let timelineMap = slotMap[timelineName];\n let attachment = skin.getAttachment(slotIndex, timelineName);\n if (attachment == null) throw new Error(\"Deform attachment not found: \" + timelineMap.name);\n let weighted = attachment.bones != null;\n let vertices = attachment.vertices;\n let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n let timeline = new DeformTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n timeline.attachment = attachment;\n\n let frameIndex = 0;\n for (let j = 0; j < timelineMap.length; j++) {\n let valueMap = timelineMap[j];\n let deform: ArrayLike;\n let verticesValue: Array = this.getValue(valueMap, \"vertices\", null);\n if (verticesValue == null)\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n else {\n deform = Utils.newFloatArray(deformLength);\n let start = this.getValue(valueMap, \"offset\", 0);\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n if (scale != 1) {\n for (let i = start, n = i + verticesValue.length; i < n; i++)\n deform[i] *= scale;\n }\n if (!weighted) {\n for (let i = 0; i < deformLength; i++)\n deform[i] += vertices[i];\n }\n }\n\n timeline.setFrame(frameIndex, valueMap.time, deform);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n }\n }\n }\n\n // Draw order timeline.\n let drawOrderNode = map.drawOrder;\n if (drawOrderNode == null) drawOrderNode = map.draworder;\n if (drawOrderNode != null) {\n let timeline = new DrawOrderTimeline(drawOrderNode.length);\n let slotCount = skeletonData.slots.length;\n let frameIndex = 0;\n for (let j = 0; j < drawOrderNode.length; j++) {\n let drawOrderMap = drawOrderNode[j];\n let drawOrder: Array = null;\n let offsets = this.getValue(drawOrderMap, \"offsets\", null);\n if (offsets != null) {\n drawOrder = Utils.newArray(slotCount, -1);\n let unchanged = Utils.newArray(slotCount - offsets.length, 0);\n let originalIndex = 0, unchangedIndex = 0;\n for (let i = 0; i < offsets.length; i++) {\n let offsetMap = offsets[i];\n let slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\n if (slotIndex == -1) throw new Error(\"Slot not found: \" + offsetMap.slot);\n // Collect unchanged items.\n while (originalIndex != slotIndex)\n unchanged[unchangedIndex++] = originalIndex++;\n // Set changed items.\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n }\n // Collect remaining unchanged items.\n while (originalIndex < slotCount)\n unchanged[unchangedIndex++] = originalIndex++;\n // Fill in unchanged items.\n for (let i = slotCount - 1; i >= 0; i--)\n if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex];\n }\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n\n // Event timeline.\n if (map.events) {\n let timeline = new EventTimeline(map.events.length);\n let frameIndex = 0;\n for (let i = 0; i < map.events.length; i++) {\n let eventMap = map.events[i];\n let eventData = skeletonData.findEvent(eventMap.name);\n if (eventData == null) throw new Error(\"Event not found: \" + eventMap.name);\n let event = new Event(eventMap.time, eventData);\n event.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\n event.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\n event.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\n timeline.setFrame(frameIndex++, event);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n\n if (isNaN(duration)) {\n throw new Error(\"Error while parsing animation, duration is NaN\");\n }\n\n skeletonData.animations.push(new Animation(name, timelines, duration));\n }\n\n readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {\n if (!map.curve) return;\n if (map.curve === \"stepped\")\n timeline.setStepped(frameIndex);\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\n let curve: Array = map.curve;\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\n }\n }\n\n getValue (map: any, prop: string, defaultValue: any) {\n return map[prop] !== undefined ? map[prop] : defaultValue;\n }\n\n static blendModeFromString (str: string): number {\n if (str === 'multiply') return PIXI.BLEND_MODES.MULTIPLY;\n if (str === 'additive') return PIXI.BLEND_MODES.ADD;\n if (str === 'screen') return PIXI.BLEND_MODES.SCREEN;\n if (str === 'normal') return PIXI.BLEND_MODES.NORMAL;\n throw new Error(`Unknown blend mode: ${str}`);\n }\n\n static positionModeFromString (str: string) {\n str = str.toLowerCase();\n if (str == \"fixed\") return PositionMode.Fixed;\n if (str == \"percent\") return PositionMode.Percent;\n throw new Error(`Unknown position mode: ${str}`);\n }\n\n static spacingModeFromString (str: string) {\n str = str.toLowerCase();\n if (str == \"length\") return SpacingMode.Length;\n if (str == \"fixed\") return SpacingMode.Fixed;\n if (str == \"percent\") return SpacingMode.Percent;\n throw new Error(`Unknown position mode: ${str}`);\n }\n\n static rotateModeFromString (str: string) {\n str = str.toLowerCase();\n if (str == \"tangent\") return RotateMode.Tangent;\n if (str == \"chain\") return RotateMode.Chain;\n if (str == \"chainscale\") return RotateMode.ChainScale;\n throw new Error(`Unknown rotate mode: ${str}`);\n }\n\n static transformModeFromString(str: string) {\n str = str.toLowerCase();\n if (str == \"normal\") return TransformMode.Normal;\n if (str == \"onlytranslation\") return TransformMode.OnlyTranslation;\n if (str == \"norotationorreflection\") return TransformMode.NoRotationOrReflection;\n if (str == \"noscale\") return TransformMode.NoScale;\n if (str == \"noscaleorreflection\") return TransformMode.NoScaleOrReflection;\n throw new Error(`Unknown transform mode: ${str}`);\n }\n\n static transformModeLegacy(inheritRotation: boolean, inheritScale: boolean) {\n if (inheritRotation && inheritScale) {\n return TransformMode.Normal;\n } else if (inheritRotation) {\n return TransformMode.InheritRotation;\n } else if (inheritScale) {\n return TransformMode.InheritScale;\n } else {\n return TransformMode.OnlyTranslation;\n }\n }\n}\n\nclass LinkedMesh {\n parent: string; skin: string;\n slotIndex: number;\n mesh: MeshAttachment;\n\n constructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string) {\n this.mesh = mesh;\n this.skin = skin;\n this.slotIndex = slotIndex;\n this.parent = parent;\n }\n}\n","import {Attachment} from \"./attachments\";\nimport {Skeleton} from \"./Skeleton\";\nimport {Map} from \"./Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Skin {\n name: string;\n attachments = new Array>();\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n\n addAttachment (slotIndex: number, name: string, attachment: Attachment) {\n if (attachment == null) throw new Error(\"attachment cannot be null.\");\n let attachments = this.attachments;\n if (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n if (!attachments[slotIndex]) attachments[slotIndex] = { };\n attachments[slotIndex][name] = attachment;\n }\n\n /** @return May be null. */\n getAttachment (slotIndex: number, name: string): Attachment {\n let dictionary = this.attachments[slotIndex];\n return dictionary ? dictionary[name] : null;\n }\n\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n attachAll (skeleton: Skeleton, oldSkin: Skin) {\n let slotIndex = 0;\n for (let i = 0; i < skeleton.slots.length; i++) {\n let slot = skeleton.slots[i];\n let slotAttachment = slot.getAttachment();\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\n let dictionary = oldSkin.attachments[slotIndex];\n for (let key in dictionary) {\n let skinAttachment:Attachment = dictionary[key];\n if (slotAttachment == skinAttachment) {\n let attachment = this.getAttachment(slotIndex, name);\n if (attachment != null) slot.setAttachment(attachment);\n break;\n }\n }\n }\n slotIndex++;\n }\n }\n}\n","import {Attachment} from \"./attachments\";\r\nimport {SlotData} from \"./SlotData\";\r\nimport {Bone} from \"./Bone\";\r\nimport {Color} from \"./Utils\";\r\nimport {TextureRegion} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class Slot {\r\n //this is for PIXI\r\n currentMesh: any;\r\n currentSprite: any;\r\n meshes: any;\r\n currentMeshName: String;\r\n sprites: any;\r\n currentSpriteName: String;\r\n blendMode: number;\r\n //assign hack region a bit later\r\n tempRegion: TextureRegion;\r\n tempAttachment: Attachment;\r\n\r\n //canon\r\n data: SlotData;\r\n bone: Bone;\r\n color: Color;\r\n attachment: Attachment;\r\n private attachmentTime: number;\r\n attachmentVertices = new Array();\r\n\r\n constructor (data: SlotData, bone: Bone) {\r\n if (data == null) throw new Error(\"data cannot be null.\");\r\n if (bone == null) throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.blendMode = data.blendMode;\r\n this.setToSetupPose();\r\n }\r\n\r\n /** @return May be null. */\r\n getAttachment (): Attachment {\r\n return this.attachment;\r\n }\r\n\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n setAttachment (attachment: Attachment) {\r\n if (this.attachment == attachment) return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n }\r\n\r\n setAttachmentTime (time: number) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n }\r\n\r\n /** Returns the time since the attachment was set. */\r\n getAttachmentTime (): number {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n }\r\n\r\n setToSetupPose () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n }\r\n}\r\n","import {BoneData} from \"./BoneData\";\r\nimport {Color} from \"./Utils\";\r\nimport {BlendMode} from \"./BlendMode\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class SlotData {\r\n index: number;\r\n name: string;\r\n boneData: BoneData;\r\n color = new Color(1, 1, 1, 1);\r\n attachmentName: string;\r\n blendMode: number;\r\n\r\n constructor (index: number, name: string, boneData: BoneData) {\r\n if (index < 0) throw new Error(\"index must be >= 0.\");\r\n if (name == null) throw new Error(\"name cannot be null.\");\r\n if (boneData == null) throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n}\r\n","export abstract class Texture {\r\n protected _image: HTMLImageElement;\r\n\r\n constructor (image: HTMLImageElement) {\r\n this._image = image;\r\n }\r\n\r\n getImage (): HTMLImageElement {\r\n return this._image;\r\n }\r\n\r\n abstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\r\n abstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\r\n abstract dispose (): void;\r\n\r\n\r\n public static filterFromString (text: string): TextureFilter {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(`Unknown texture filter ${text}`);\r\n }\r\n }\r\n\r\n public static wrapFromString (text: string): TextureWrap {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(`Unknown texture wrap ${text}`);\r\n }\r\n }\r\n}\r\n\r\nexport enum TextureFilter {\r\n Nearest = 9728, // WebGLRenderingContext.NEAREST\r\n Linear = 9729, // WebGLRenderingContext.LINEAR\r\n MipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n MipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\r\n MipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\r\n MipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\r\n MipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n}\r\n\r\nexport enum TextureWrap {\r\n MirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\r\n ClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\r\n Repeat = 10497 // WebGLRenderingContext.REPEAT\r\n}\r\n\r\nexport class TextureRegion {\r\n texture: PIXI.Texture;\r\n\r\n //thats for overrides\r\n size: PIXI.Rectangle = null;\r\n\r\n get width(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.width;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get height(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n return tex.crop.height;\r\n }\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get u(): number {\r\n return this.texture._uvs.x0;\r\n }\r\n\r\n get v(): number {\r\n return this.texture._uvs.y0;\r\n }\r\n\r\n get u2(): number {\r\n return this.texture._uvs.x2;\r\n }\r\n\r\n get v2(): number {\r\n return this.texture._uvs.y2;\r\n }\r\n\r\n get offsetX(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.x : 0;\r\n }\r\n\r\n get offsetY(): number {\r\n console.warn(\"Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on.\");\r\n return this.spineOffsetY;\r\n }\r\n\r\n get pixiOffsetY(): number {\r\n const tex = this.texture;\r\n return tex.trim ? tex.trim.y : 0;\r\n }\r\n\r\n get spineOffsetY(): number {\r\n var tex = this.texture;\r\n return this.originalHeight - this.height - (tex.trim ? tex.trim.y : 0);\r\n }\r\n\r\n get originalWidth(): number {\r\n var tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.crop.width;\r\n }\r\n return tex.orig.width;\r\n }\r\n\r\n get originalHeight(): number {\r\n const tex = this.texture;\r\n if (PIXI.VERSION[0] == '3') {\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.crop.height;\r\n }\r\n return tex.orig.height;\r\n }\r\n\r\n get x(): number {\r\n return this.texture.frame.x;\r\n }\r\n\r\n get y(): number {\r\n return this.texture.frame.y;\r\n }\r\n\r\n get rotate(): boolean {\r\n return this.texture.rotate !== 0;\r\n }\r\n}\r\n","import {Disposable, Map} from \"./Utils\";\r\nimport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class TextureAtlas implements Disposable {\r\n pages = new Array();\r\n regions = new Array();\r\n\r\n constructor(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (atlasText) {\r\n this.addSpineAtlas(atlasText, textureLoader, callback);\r\n }\r\n }\r\n\r\n addTexture(name: string, texture: PIXI.Texture) {\r\n let pages = this.pages;\r\n let page: TextureAtlasPage = null;\r\n for (var i=0;i, stripExtension: boolean) {\r\n for (var key in textures) {\r\n if (textures.hasOwnProperty(key)) {\r\n this.addTexture(stripExtension && key.indexOf('.') !== -1 ? key.substr(0, key.lastIndexOf('.')) : key, textures[key]);\r\n }\r\n }\r\n }\r\n\r\n public addSpineAtlas(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n return this.load(atlasText, textureLoader, callback);\r\n }\r\n\r\n private load(atlasText: string, textureLoader: (path: string, loaderFunction: (tex: PIXI.BaseTexture) => any) => any, callback: (obj: TextureAtlas) => any) {\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n\r\n let reader = new TextureAtlasReader(atlasText);\r\n let tuple = new Array(4);\r\n let page: TextureAtlasPage = null;\r\n\r\n let iterateParser = () => {\r\n while (true) {\r\n let line = reader.readLine();\r\n if (line == null) {\r\n return callback && callback(this);\r\n }\r\n line = line.trim();\r\n if (line.length == 0)\r\n page = null;\r\n else if (!page) {\r\n page = new TextureAtlasPage();\r\n page.name = line;\r\n\r\n if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker.\r\n page.width = parseInt(tuple[0]);\r\n page.height = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n }\r\n // page.format = Format[tuple[0]]; we don't need format in WebGL\r\n\r\n reader.readTuple(tuple);\r\n page.minFilter = Texture.filterFromString(tuple[0]);\r\n page.magFilter = Texture.filterFromString(tuple[1]);\r\n\r\n let direction = reader.readValue();\r\n page.uWrap = TextureWrap.ClampToEdge;\r\n page.vWrap = TextureWrap.ClampToEdge;\r\n if (direction == \"x\")\r\n page.uWrap = TextureWrap.Repeat;\r\n else if (direction == \"y\")\r\n page.vWrap = TextureWrap.Repeat;\r\n else if (direction == \"xy\")\r\n page.uWrap = page.vWrap = TextureWrap.Repeat;\r\n\r\n textureLoader(line, (texture: PIXI.BaseTexture) => {\r\n page.baseTexture = texture;\r\n if (!texture.hasLoaded) {\r\n texture.width = page.width;\r\n texture.height = page.height;\r\n }\r\n this.pages.push(page);\r\n page.setFilters();\r\n\r\n if (!page.width || !page.height) {\r\n page.width = texture.realWidth;\r\n page.height = texture.realHeight;\r\n if (!page.width || !page.height) {\r\n console.log(\"ERROR spine atlas page \" + page.name + \": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)\");\r\n }\r\n }\r\n iterateParser();\r\n });\r\n this.pages.push(page);\r\n break;\r\n } else {\r\n let region: TextureAtlasRegion = new TextureAtlasRegion();\r\n region.name = line;\r\n region.page = page;\r\n\r\n let rotate: number = reader.readValue() == \"true\" ? 6 : 0;\r\n\r\n reader.readTuple(tuple);\r\n let x = parseInt(tuple[0]);\r\n let y = parseInt(tuple[1]);\r\n\r\n reader.readTuple(tuple);\r\n let width = parseInt(tuple[0]);\r\n let height = parseInt(tuple[1]);\r\n\r\n let resolution = page.baseTexture.resolution;\r\n x /= resolution;\r\n y /= resolution;\r\n width /= resolution;\r\n height /= resolution;\r\n\r\n let frame = new PIXI.Rectangle(x, y, rotate ? height : width, rotate ? width : height);\r\n\r\n if (reader.readTuple(tuple) == 4) { // split is optional\r\n // region.splits = new Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits\r\n //region.pads = Vector.(parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3]));\r\n\r\n reader.readTuple(tuple);\r\n }\r\n }\r\n\r\n let originalWidth = parseInt(tuple[0]) / resolution;\r\n let originalHeight = parseInt(tuple[1]) / resolution;\r\n reader.readTuple(tuple);\r\n let offsetX = parseInt(tuple[0]) / resolution;\r\n let offsetY = parseInt(tuple[1]) / resolution;\r\n\r\n let orig = new PIXI.Rectangle(0, 0, originalWidth, originalHeight);\r\n let trim = new PIXI.Rectangle(offsetX, originalHeight - height - offsetY, width, height);\r\n\r\n //TODO: pixiv3 uses different frame/crop/trim\r\n\r\n if (PIXI.VERSION[0] == '4') {\r\n // pixi v4.0.0\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame, orig, trim, rotate);\r\n } else {\r\n // pixi v3.0.11\r\n var frame2 = new PIXI.Rectangle(x, y, width, height);\r\n var crop = frame2.clone();\r\n trim.width = originalWidth;\r\n trim.height = originalHeight;\r\n region.texture = new PIXI.Texture(region.page.baseTexture, frame2, crop, trim, rotate);\r\n }\r\n\r\n region.index = parseInt(reader.readValue());\r\n region.texture._updateUvs();\r\n\r\n this.regions.push(region);\r\n }\r\n }\r\n }\r\n\r\n iterateParser();\r\n }\r\n\r\n findRegion(name: string): TextureAtlasRegion {\r\n for (let i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n dispose() {\r\n for (let i = 0; i < this.pages.length; i++) {\r\n this.pages[i].baseTexture.dispose();\r\n }\r\n }\r\n}\r\n\r\nclass TextureAtlasReader {\r\n lines: Array;\r\n index: number = 0;\r\n\r\n constructor(text: string) {\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n\r\n readLine(): string {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n }\r\n\r\n readValue(): string {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n return line.substring(colon + 1).trim();\r\n }\r\n\r\n readTuple(tuple: Array): number {\r\n let line = this.readLine();\r\n let colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n let i = 0, lastMatch = colon + 1;\r\n for (; i < 3; i++) {\r\n let comma = line.indexOf(\",\", lastMatch);\r\n if (comma == -1) break;\r\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n }\r\n tuple[i] = line.substring(lastMatch).trim();\r\n return i + 1;\r\n }\r\n}\r\n\r\nexport class TextureAtlasPage {\r\n name: string;\r\n minFilter: TextureFilter;\r\n magFilter: TextureFilter;\r\n uWrap: TextureWrap;\r\n vWrap: TextureWrap;\r\n baseTexture: PIXI.BaseTexture;\r\n width: number;\r\n height: number;\r\n\r\n public setFilters() {\r\n let tex = this.baseTexture;\r\n let filter = this.minFilter;\r\n if (filter == TextureFilter.Linear) {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n } else if (this.minFilter == TextureFilter.Nearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.mipmap = true;\r\n if (filter == TextureFilter.MipMapNearestNearest) {\r\n tex.scaleMode = PIXI.SCALE_MODES.NEAREST;\r\n } else {\r\n tex.scaleMode = PIXI.SCALE_MODES.LINEAR;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport class TextureAtlasRegion extends TextureRegion {\r\n page: TextureAtlasPage;\r\n name: string;\r\n index: number;\r\n}\r\n","import {TransformConstraintData} from \"./TransformConstraintData\";\nimport {Bone} from \"./Bone\";\nimport {Vector2, MathUtils} from \"./Utils\";\nimport {Skeleton} from \"./Skeleton\";\nimport {Constraint} from \"./Constraint\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class TransformConstraint implements Constraint {\n data: TransformConstraintData;\n bones: Array;\n target: Bone;\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\n temp = new Vector2();\n\n constructor (data: TransformConstraintData, skeleton: Skeleton) {\n if (data == null) throw new Error(\"data cannot be null.\");\n if (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.rotateMix = data.rotateMix;\n this.translateMix = data.translateMix;\n this.scaleMix = data.scaleMix;\n this.shearMix = data.shearMix;\n this.bones = new Array();\n for (let i = 0; i < data.bones.length; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findBone(data.target.name);\n }\n\n apply () {\n this.update();\n }\n\n update () {\n let rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\n let target = this.target;\n let ta = target.matrix.a, tb = target.matrix.c, tc = target.matrix.b, td = target.matrix.d;\n let bones = this.bones;\n for (let i = 0, n = bones.length; i < n; i++) {\n let bone = bones[i];\n let m = bone.matrix;\n let modified = false;\n\n if (rotateMix != 0) {\n let a = m.a, b = m.c, c = m.b, d = m.d;\n let r = Math.atan2(tc, ta) - Math.atan2(c, a) + this.data.offsetRotation * MathUtils.degRad;\n if (r > MathUtils.PI)\n r -= MathUtils.PI2;\n else if (r < -MathUtils.PI)\n r += MathUtils.PI2;\n r *= rotateMix;\n let cos = Math.cos(r), sin = Math.sin(r);\n m.a = cos * a - sin * c;\n m.c = cos * b - sin * d;\n m.b = sin * a + cos * c;\n m.d = sin * b + cos * d;\n modified = true;\n }\n\n if (translateMix != 0) {\n let temp = this.temp;\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n m.tx += (temp.x - m.tx) * translateMix;\n m.ty += (temp.y - m.ty) * translateMix;\n modified = true;\n }\n\n if (scaleMix > 0) {\n let s = Math.sqrt(m.a * m.a + m.b * m.b);\n let ts = Math.sqrt(ta * ta + tc * tc);\n if (s > 0.00001) s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\n m.a *= s;\n m.b *= s;\n s = Math.sqrt(m.c * m.c + m.d * m.d);\n ts = Math.sqrt(tb * tb + td * td);\n if (s > 0.00001) s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\n m.c *= s;\n m.d *= s;\n modified = true;\n }\n\n if (shearMix > 0) {\n let b = m.c, d = m.d;\n let by = Math.atan2(d, b);\n let r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(m.b, m.a));\n if (r > MathUtils.PI)\n r -= MathUtils.PI2;\n else if (r < -MathUtils.PI)\n r += MathUtils.PI2;\n r = by + (r + this.data.offsetShearY * MathUtils.degRad) * shearMix;\n let s = Math.sqrt(b * b + d * d);\n m.c = Math.cos(r) * s;\n m.d = Math.sin(r) * s;\n modified = true;\n }\n\n if (modified) bone.appliedValid = false;\n }\n }\n\n getOrder () {\n return this.data.order;\n }\n}\n","import {BoneData} from \"./BoneData\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class TransformConstraintData {\n name: string;\n order = 0;\n bones = new Array();\n target: BoneData;\n rotateMix = 0; translateMix = 0; scaleMix = 0; shearMix = 0;\n offsetRotation = 0; offsetX = 0; offsetY = 0; offsetScaleX = 0; offsetScaleY = 0; offsetShearY = 0;\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n}\n","import {Skeleton} from \"./Skeleton\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport interface Map {\n [key: string]: T;\n}\n\nexport interface Disposable {\n dispose (): void;\n}\n\nexport class Color {\n public static WHITE = new Color(1, 1, 1, 1);\n public static RED = new Color(1, 0, 0, 1);\n public static GREEN = new Color(0, 1, 0, 1);\n public static BLUE = new Color(0, 0, 1, 1);\n public static MAGENTA = new Color(1, 0, 1, 1);\n\n constructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\n }\n\n set (r: number, g: number, b: number, a: number) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n this.clamp();\n return this;\n }\n\n setFromColor (c: Color) {\n this.r = c.r;\n this.g = c.g;\n this.b = c.b;\n this.a = c.a;\n return this;\n }\n\n setFromString (hex: string) {\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\n return this;\n }\n\n add (r: number, g: number, b: number, a: number) {\n this.r += r;\n this.g += g;\n this.b += b;\n this.a += a;\n this.clamp();\n return this;\n }\n\n clamp () {\n if (this.r < 0) this.r = 0;\n else if (this.r > 1) this.r = 1;\n\n if (this.g < 0) this.g = 0;\n else if (this.g > 1) this.g = 1;\n\n if (this.b < 0) this.b = 0;\n else if (this.b > 1) this.b = 1;\n\n if (this.a < 0) this.a = 0;\n else if (this.a > 1) this.a = 1;\n return this;\n }\n}\n\nexport class MathUtils {\n static PI = 3.1415927;\n static PI2 = MathUtils.PI * 2;\n static radiansToDegrees = 180 / MathUtils.PI;\n static radDeg = MathUtils.radiansToDegrees;\n static degreesToRadians = MathUtils.PI / 180;\n static degRad = MathUtils.degreesToRadians;\n\n static clamp (value: number, min: number, max: number) {\n if (value < min) return min;\n if (value > max) return max;\n return value;\n }\n\n static cosDeg (degrees: number) {\n return Math.cos(degrees * MathUtils.degRad);\n }\n\n static sinDeg (degrees: number) {\n return Math.sin(degrees * MathUtils.degRad);\n }\n\n static signum (value: number): number {\n return value >= 0 ? 1 : -1;\n }\n\n static toInt (x: number) {\n return x > 0 ? Math.floor(x) : Math.ceil(x);\n }\n\n static cbrt (x: number) {\n var y = Math.pow(Math.abs(x), 1/3);\n return x < 0 ? -y : y;\n }\n}\n\nexport class Utils {\n static SUPPORTS_TYPED_ARRAYS = typeof(Float32Array) !== \"undefined\";\n\n static arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\n for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n dest[j] = source[i];\n }\n }\n\n static setArraySize (array: Array, size: number, value: any = 0): Array {\n let oldSize = array.length;\n if (oldSize == size) return array;\n array.length = size;\n if (oldSize < size) {\n for (let i = oldSize; i < size; i++) array[i] = value;\n }\n return array;\n }\n\n static newArray (size: number, defaultValue: T): Array {\n let array = new Array(size);\n for (let i = 0; i < size; i++) array[i] = defaultValue;\n return array;\n }\n\n static newFloatArray (size: number): ArrayLike {\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\n return new Float32Array(size)\n } else {\n let array = new Array(size);\n for (let i = 0; i < array.length; i++) array[i] = 0;\n return array;\n }\n }\n\n static toFloatArray (array: Array) {\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n }\n}\n\nexport class DebugUtils {\n static logBones(skeleton: Skeleton) {\n for (let i = 0; i < skeleton.bones.length; i++) {\n let bone = skeleton.bones[i];\n let m = bone.matrix;\n console.log(bone.data.name + \", \" + m.a + \", \" + m.b + \", \" + m.c + \", \" + m.d + \", \" + m.tx + \", \" + m.ty);\n }\n }\n}\n\nexport class Pool {\n private items = new Array();\n private instantiator: () => T;\n\n constructor (instantiator: () => T) {\n this.instantiator = instantiator;\n }\n\n obtain () {\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\n }\n\n free (item: T) {\n this.items.push(item);\n }\n\n freeAll (items: ArrayLike) {\n for (let i = 0; i < items.length; i++) this.items[i] = items[i];\n }\n\n clear () {\n this.items.length = 0;\n }\n}\n\nexport class Vector2 {\n constructor (public x = 0, public y = 0) {\n }\n\n set (x: number, y: number): Vector2 {\n this.x = x;\n this.y = y;\n return this;\n }\n\n length () {\n let x = this.x;\n let y = this.y;\n return Math.sqrt(x * x + y * y);\n }\n\n normalize () {\n let len = this.length();\n if (len != 0) {\n this.x /= len;\n this.y /= len;\n }\n return this;\n }\n}\n\nexport class TimeKeeper {\n maxDelta = 0.064;\n framesPerSecond = 0;\n delta = 0;\n totalTime = 0;\n\n private lastTime = Date.now() / 1000;\n private frameCount = 0;\n private frameTime = 0;\n\n update () {\n var now = Date.now() / 1000;\n this.delta = now - this.lastTime;\n this.frameTime += this.delta;\n this.totalTime += this.delta;\n if (this.delta > this.maxDelta) this.delta = this.maxDelta;\n this.lastTime = now;\n\n this.frameCount++;\n if (this.frameTime > 1) {\n this.framesPerSecond = this.frameCount / this.frameTime;\n this.frameTime = 0;\n this.frameCount = 0;\n }\n }\n}\n\nexport interface ArrayLike {\n length: number;\n [n: number]: T;\n}\n","import {Slot} from \"../Slot\";\nimport {ArrayLike} from \"../Utils\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport abstract class Attachment {\n name: string;\n\n constructor (name: string) {\n if (name == null) throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n}\n\nexport abstract class VertexAttachment extends Attachment {\n bones: Array;\n vertices: ArrayLike;\n worldVerticesLength = 0;\n\n constructor (name: string) {\n super(name);\n }\n\n computeWorldVertices (slot: Slot, worldVertices: ArrayLike) {\n this.computeWorldVerticesWith(slot, 0, this.worldVerticesLength, worldVertices, 0);\n }\n\n /** Transforms local vertices to world coordinates.\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\n * @param offset The worldVertices index to begin writing values. */\n computeWorldVerticesWith (slot: Slot, start: number, count: number, worldVertices: ArrayLike, offset: number) {\n count += offset;\n let skeleton = slot.bone.skeleton;\n let deformArray = slot.attachmentVertices;\n let vertices = this.vertices;\n let bones = this.bones;\n if (bones == null) {\n if (deformArray.length > 0) vertices = deformArray;\n let bone = slot.bone;\n let m = bone.matrix;\n let x = m.tx;\n let y = m.ty;\n let a = m.a, b = m.c, c = m.b, d = m.d;\n for (let v = start, w = offset; w < count; v += 2, w += 2) {\n let vx = vertices[v], vy = vertices[v + 1];\n worldVertices[w] = vx * a + vy * b + x;\n worldVertices[w + 1] = vx * c + vy * d + y;\n }\n return;\n }\n let v = 0, skip = 0;\n for (let i = 0; i < start; i += 2) {\n let n = bones[v];\n v += n + 1;\n skip += n;\n }\n let skeletonBones = skeleton.bones;\n if (deformArray.length == 0) {\n for (let w = offset, b = skip * 3; w < count; w += 2) {\n let wx = 0, wy = 0;\n let n = bones[v++];\n n += v;\n for (; v < n; v++, b += 3) {\n let bone = skeletonBones[bones[v]];\n let m = bone.matrix;\n let vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\n }\n worldVertices[w] = wx;\n worldVertices[w + 1] = wy;\n }\n } else {\n let deform = deformArray;\n for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += 2) {\n let wx = 0, wy = 0;\n let n = bones[v++];\n n += v;\n for (; v < n; v++, b += 3, f += 2) {\n let bone = skeletonBones[bones[v]];\n let m = bone.matrix;\n let vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n wx += (vx * m.a + vy * m.c + m.tx) * weight;\n wy += (vx * m.b + vy * m.d + m.ty) * weight;\n }\n worldVertices[w] = wx;\n worldVertices[w + 1] = wy;\n }\n }\n }\n\n /** Returns true if a deform originally applied to the specified attachment should be applied to this attachment. */\n applyDeform (sourceAttachment: VertexAttachment) {\n return this == sourceAttachment;\n }\n}\n","/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport enum AttachmentType {\r\n Region, BoundingBox, Mesh, LinkedMesh, Path\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class BoundingBoxAttachment extends VertexAttachment {\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor(name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {VertexAttachment} from \"./Attachment\";\nimport {TextureRegion} from \"../Texture\";\nimport {Color, Utils, ArrayLike} from \"../Utils\";\nimport {Slot} from \"../Slot\";\n/******************************************************************************\n * Spine Runtimes Software License\n * Version 2.5\n *\n * Copyright (c) 2013-2016, Esoteric Software\n * All rights reserved.\n *\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\n * non-transferable license to use, install, execute, and perform the Spine\n * Runtimes software and derivative works solely for personal or internal\n * use. Without the written permission of Esoteric Software (see Section 2 of\n * the Spine Software License Agreement), you may not (a) modify, translate,\n * adapt, or develop new applications using the Spine Runtimes or otherwise\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\n * or other intellectual property or proprietary rights notices on or in the\n * Software, including any copy thereof. Redistributions in binary or source\n * form must include this license and terms.\n *\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class MeshAttachment extends VertexAttachment {\n region: TextureRegion;\n path: string;\n regionUVs: ArrayLike;\n triangles: Array;\n color = new Color(1, 1, 1, 1);\n hullLength: number;\n private parentMesh: MeshAttachment;\n inheritDeform = false;\n tempColor = new Color(0, 0, 0, 0);\n\n constructor(name: string) {\n super(name);\n }\n\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\n return [];\n //nothing\n }\n\n updateUVs(region: TextureRegion, uvs: ArrayLike): ArrayLike {\n let regionUVs = this.regionUVs;\n let n = regionUVs.length;\n if (!uvs || uvs.length != n) {\n uvs = Utils.newFloatArray(n);\n }\n\n if (region == null) {\n return;\n }\n\n let texture = region.texture;\n let r = texture._uvs;\n let w1 = region.width, h1 = region.height, w2 = region.originalWidth, h2 = region.originalHeight;\n let x = region.offsetX, y = region.pixiOffsetY;\n\n for (let i = 0; i < n; i += 2) {\n let u = this.regionUVs[i], v = this.regionUVs[i + 1];\n u = (u * w2 - x) / w1;\n v = (v * h2 - y) / h1;\n uvs[i] = (r.x0 * (1 - u) + r.x1 * u) * (1 - v) + (r.x3 * (1 - u) + r.x2 * u) * v;\n uvs[i + 1] = (r.y0 * (1 - u) + r.y1 * u) * (1 - v) + (r.y3 * (1 - u) + r.y2 * u) * v;\n }\n\n return uvs;\n }\n\n applyDeform(sourceAttachment: VertexAttachment): boolean {\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\n }\n\n getParentMesh() {\n return this.parentMesh;\n }\n\n /** @param parentMesh May be null. */\n setParentMesh(parentMesh: MeshAttachment) {\n this.parentMesh = parentMesh;\n if (parentMesh != null) {\n this.bones = parentMesh.bones;\n this.vertices = parentMesh.vertices;\n this.regionUVs = parentMesh.regionUVs;\n this.triangles = parentMesh.triangles;\n this.hullLength = parentMesh.hullLength;\n }\n }\n}\n","import {VertexAttachment} from \"./Attachment\";\r\nimport {Color} from \"../Utils\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class PathAttachment extends VertexAttachment {\r\n lengths: Array;\r\n closed = false; constantSpeed = false;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n constructor (name: string) {\r\n super(name);\r\n }\r\n}\r\n","import {Attachment} from \"./Attachment\";\r\nimport {Color, Utils} from \"../Utils\";\r\nimport {TextureRegion} from \"../Texture\";\r\nimport {Slot} from \"../Slot\";\r\n/******************************************************************************\r\n * Spine Runtimes Software License\r\n * Version 2.5\r\n *\r\n * Copyright (c) 2013-2016, Esoteric Software\r\n * All rights reserved.\r\n *\r\n * You are granted a perpetual, non-exclusive, non-sublicensable, and\r\n * non-transferable license to use, install, execute, and perform the Spine\r\n * Runtimes software and derivative works solely for personal or internal\r\n * use. Without the written permission of Esoteric Software (see Section 2 of\r\n * the Spine Software License Agreement), you may not (a) modify, translate,\r\n * adapt, or develop new applications using the Spine Runtimes or otherwise\r\n * create derivative works or improvements of the Spine Runtimes or (b) remove,\r\n * delete, alter, or obscure any trademarks or any copyright, trademark, patent,\r\n * or other intellectual property or proprietary rights notices on or in the\r\n * Software, including any copy thereof. Redistributions in binary or source\r\n * form must include this license and terms.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE \"AS IS\" AND ANY EXPRESS OR\r\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\r\n * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF\r\n * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\r\n * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *****************************************************************************/\r\n\r\nexport class RegionAttachment extends Attachment {\r\n x = 0; y = 0; scaleX = 1; scaleY = 1; rotation = 0; width = 0; height = 0;\r\n color = new Color(1, 1, 1, 1);\r\n\r\n path: string;\r\n region: TextureRegion;\r\n\r\n constructor (name:string) {\r\n super(name);\r\n }\r\n\r\n updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike {\r\n return [];\r\n //nothing\r\n }\r\n}\r\n","export {Attachment, VertexAttachment} from \"./Attachment\";\r\nexport {AttachmentLoader} from \"./AttachmentLoader\";\r\nexport {AttachmentType} from \"./AttachmentType\";\r\nexport {BoundingBoxAttachment} from \"./BoundingBoxAttachment\";\r\nexport {MeshAttachment} from \"./MeshAttachment\";\r\nexport {PathAttachment} from \"./PathAttachment\";\r\nexport {RegionAttachment} from \"./RegionAttachment\";\r\n","export * from \"./attachments\";\n\nexport {\n Timeline, ColorTimeline, AttachmentTimeline, RotateTimeline, TranslateTimeline,\n ScaleTimeline, ShearTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline,\n PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline,\n Animation, CurveTimeline\n} from \"./Animation\";\nexport {AnimationState} from \"./AnimationState\";\nexport {AnimationStateData} from \"./AnimationStateData\";\nexport {BlendMode} from \"./BlendMode\";\nexport {Bone} from \"./Bone\";\nexport {BoneData, TransformMode} from \"./BoneData\";\nexport {Constraint} from \"./Constraint\";\nexport {Event} from \"./Event\";\nexport {EventData} from \"./EventData\";\nexport {IkConstraint} from \"./IkConstraint\";\nexport {IkConstraintData} from \"./IkConstraintData\";\nexport {PathConstraint} from \"./PathConstraint\";\nexport {PathConstraintData, SpacingMode, RotateMode, PositionMode} from \"./PathConstraintData\";\nexport {Skeleton} from \"./Skeleton\";\nexport {SkeletonBounds} from \"./SkeletonBounds\";\nexport {SkeletonData} from \"./SkeletonData\";\nexport {SkeletonJson} from \"./SkeletonJson\";\nexport {Skin} from \"./Skin\";\nexport {Slot} from \"./Slot\";\nexport {SlotData} from \"./SlotData\";\nexport {Texture, TextureWrap, TextureRegion, TextureFilter} from \"./Texture\";\nexport {TextureAtlas, TextureAtlasRegion} from \"./TextureAtlas\";\nexport {AtlasAttachmentLoader} from \"./AtlasAttachmentLoader\";\nexport {TransformConstraint} from \"./TransformConstraint\";\nexport {TransformConstraintData} from \"./TransformConstraintData\";\nexport {Updatable} from \"./Updatable\";\nexport {Disposable, Map, Utils, Pool, MathUtils, Color, Vector2} from \"./Utils\";\n","import * as spine from \"./core\";\n\nexport function atlasParser() {\n return function (resource: PIXI.loaders.Resource, next: () => any) {\n // skip if no data, its not json, or it isn't atlas data\n if (!resource.data || !resource.isJson || !resource.data.bones) {\n return next();\n }\n\n var metadataAtlas = resource.metadata ? resource.metadata.spineAtlas: null;\n if (metadataAtlas === false) {\n return next();\n }\n if (metadataAtlas && metadataAtlas.pages) {\n //its an atlas!\n var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(metadataAtlas));\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\n\n resource.spineData = skeletonData;\n resource.spineAtlas = metadataAtlas;\n\n return next();\n }\n\n var metadataAtlasSuffix = '.atlas';\n if (resource.metadata && resource.metadata.spineAtlasSuffix) {\n metadataAtlasSuffix = resource.metadata.spineAtlasSuffix;\n }\n\n /**\n * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files\n * that correspond to the spine file are in the same base URL and that the .json and .atlas files\n * have the same name\n */\n var atlasPath = resource.url.substr(0, resource.url.lastIndexOf('.')) + metadataAtlasSuffix;\n //remove the baseUrl\n atlasPath = atlasPath.replace(this.baseUrl, '');\n\n var atlasOptions = {\n crossOrigin: resource.crossOrigin,\n xhrType: PIXI.loaders.Resource.XHR_RESPONSE_TYPE.TEXT,\n metadata: resource.metadata ? resource.metadata.spineMetadata : null\n };\n var imageOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata ? resource.metadata.imageMetadata: null\n };\n var baseUrl = resource.url.substr(0, resource.url.lastIndexOf('/') + 1);\n //remove the baseUrl\n baseUrl = baseUrl.replace(this.baseUrl, '');\n\n var adapter = imageLoaderAdapter(this, resource.name + '_atlas_page_', baseUrl, imageOptions);\n\n this.add(resource.name + '_atlas', atlasPath, atlasOptions, function () {\n new spine.TextureAtlas(this.xhr.responseText, adapter, function(spineAtlas) {\n var spineJsonParser = new spine.SkeletonJson(new spine.AtlasAttachmentLoader(spineAtlas));\n var skeletonData = spineJsonParser.readSkeletonData(resource.data);\n\n resource.spineData = skeletonData;\n resource.spineAtlas = spineAtlas;\n\n next();\n });\n });\n };\n}\n\nexport function imageLoaderAdapter(loader: any, namePrefix: any, baseUrl: any, imageOptions: any) {\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\n {\n baseUrl += '/';\n }\n return function(line: String, callback: (baseTexture: PIXI.BaseTexture) => any) {\n var name = namePrefix + line;\n var url = baseUrl + line;\n loader.add(name, url, imageOptions, (resource: PIXI.loaders.Resource) => {\n callback(resource.texture.baseTexture);\n });\n }\n}\n\nexport function syncImageLoaderAdapter (baseUrl: any, crossOrigin: any) {\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length-1))\n {\n baseUrl += '/';\n }\n return function(line: any, callback: any) {\n callback(PIXI.BaseTexture.fromImage(line, crossOrigin));\n }\n}\n\nPIXI.loaders.Loader.addPixiMiddleware(atlasParser);\nPIXI.loader.use(atlasParser());\n","import * as core from \"./core\";\r\nimport * as loaders from \"./loaders\";\r\n\r\nexport {core, loaders}\r\nexport {Spine, SpineMesh, SpineSprite} from \"./Spine\";\r\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/package.json b/package.json index c8676093..df9b2037 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi-spine", - "version": "1.1.3", + "version": "1.2.0", "description": "Spine implementation for pixi v^3 and v^4", "author": "Mat Groves", "contributors": [