diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java index f1f189343..ed30a4f96 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java @@ -121,8 +121,8 @@ public class Bone implements Updatable { b = lb; c = lc; d = ld; - worldX = x; - worldY = y; + worldX = x + skeleton.x; + worldY = y + skeleton.y; return; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java index 2dff74a6a..ab90a7ef0 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java @@ -90,14 +90,12 @@ public class PathConstraint implements Constraint { float[] positions = computeWorldPositions((PathAttachment)attachment, spacesCount, tangents, data.positionMode == PositionMode.percent, spacingMode == SpacingMode.percent); - Skeleton skeleton = target.getSkeleton(); - float skeletonX = skeleton.x, skeletonY = skeleton.y; float boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; boolean tip = rotateMode == RotateMode.chain && offsetRotation == 0; for (int i = 0, p = 3; i < boneCount; i++, p += 3) { Bone bone = (Bone)bones[i]; - bone.worldX += (boneX - skeletonX - bone.worldX) * translateMix; - bone.worldY += (boneY - skeletonY - bone.worldY) * translateMix; + bone.worldX += (boneX - bone.worldX) * translateMix; + bone.worldY += (boneY - bone.worldY) * translateMix; float x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; if (scale) { float length = lengths[i]; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonMeshRenderer.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonMeshRenderer.java index b1cd887e5..344dcc3be 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonMeshRenderer.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonMeshRenderer.java @@ -74,7 +74,7 @@ public class SkeletonMeshRenderer extends SkeletonRenderer { float oldScaleX = rootBone.getScaleX(); float oldScaleY = rootBone.getScaleY(); float oldRotation = rootBone.getRotation(); - attachmentSkeleton.setPosition(skeleton.getX() + bone.getWorldX(), skeleton.getY() + bone.getWorldY()); + attachmentSkeleton.setPosition(bone.getWorldX(), bone.getWorldY()); // rootBone.setScaleX(1 + bone.getWorldScaleX() - oldScaleX); // rootBone.setScaleY(1 + bone.getWorldScaleY() - oldScaleY); // Set shear. diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java index 0a2ac34c5..c59c46932 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java @@ -70,7 +70,7 @@ public class SkeletonRenderer { float oldScaleX = rootBone.getScaleX(); float oldScaleY = rootBone.getScaleY(); float oldRotation = rootBone.getRotation(); - attachmentSkeleton.setPosition(skeleton.getX() + bone.getWorldX(), skeleton.getY() + bone.getWorldY()); + attachmentSkeleton.setPosition(bone.getWorldX(), bone.getWorldY()); // rootBone.setScaleX(1 + bone.getWorldScaleX() - oldScaleX); // rootBone.setScaleY(1 + bone.getWorldScaleY() - oldScaleY); // Set shear. diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java index 23c94ea17..9282ce8a1 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java @@ -110,7 +110,6 @@ public class MeshAttachment extends VertexAttachment { | ((int)(skeletonColor.g * slotColor.g * meshColor.g * multiplier) << 8) // | (int)(skeletonColor.r * slotColor.r * meshColor.r * multiplier)); - float x = skeleton.getX(), y = skeleton.getY(); FloatArray deformArray = slot.getAttachmentVertices(); float[] vertices = this.vertices, worldVertices = this.worldVertices; int[] bones = this.bones; @@ -118,8 +117,7 @@ public class MeshAttachment extends VertexAttachment { int verticesLength = vertices.length; if (deformArray.size > 0) vertices = deformArray.items; Bone bone = slot.getBone(); - x += bone.getWorldX(); - y += bone.getWorldY(); + float x = bone.getWorldX(), y = bone.getWorldY(); float a = bone.getA(), b = bone.getB(), c = bone.getC(), d = bone.getD(); for (int v = 0, w = 0; v < verticesLength; v += 2, w += 5) { float vx = vertices[v], vy = vertices[v + 1]; @@ -132,7 +130,7 @@ public class MeshAttachment extends VertexAttachment { Object[] skeletonBones = skeleton.getBones().items; if (deformArray.size == 0) { for (int w = 0, v = 0, b = 0, n = bones.length; v < n; w += 5) { - float wx = x, wy = y; + float wx = 0, wy = 0; int nn = bones[v++] + v; for (; v < nn; v++, b += 3) { Bone bone = (Bone)skeletonBones[bones[v]]; @@ -147,7 +145,7 @@ public class MeshAttachment extends VertexAttachment { } else { float[] deform = deformArray.items; for (int w = 0, v = 0, b = 0, f = 0, n = bones.length; v < n; w += 5) { - float wx = x, wy = y; + float wx = 0, wy = 0; int nn = bones[v++] + v; for (; v < nn; v++, b += 3, f += 2) { Bone bone = (Bone)skeletonBones[bones[v]]; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java index cc5a36242..ee3a30654 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/RegionAttachment.java @@ -163,7 +163,7 @@ public class RegionAttachment extends Attachment { float[] vertices = this.vertices; float[] offset = this.offset; Bone bone = slot.getBone(); - float x = skeleton.getX() + bone.getWorldX(), y = skeleton.getY() + bone.getWorldY(); + float x = bone.getWorldX(), y = bone.getWorldY(); float a = bone.getA(), b = bone.getB(), c = bone.getC(), d = bone.getD(); float offsetX, offsetY; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java index 51829d38d..b6a838a60 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java @@ -58,15 +58,13 @@ public class VertexAttachment extends Attachment { protected void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset) { count += offset; Skeleton skeleton = slot.getSkeleton(); - float x = skeleton.getX(), y = skeleton.getY(); FloatArray deformArray = slot.getAttachmentVertices(); float[] vertices = this.vertices; int[] bones = this.bones; if (bones == null) { if (deformArray.size > 0) vertices = deformArray.items; Bone bone = slot.getBone(); - x += bone.getWorldX(); - y += bone.getWorldY(); + float x = bone.getWorldX(), y = bone.getWorldY(); float a = bone.getA(), b = bone.getB(), c = bone.getC(), d = bone.getD(); for (int v = start, w = offset; w < count; v += 2, w += 2) { float vx = vertices[v], vy = vertices[v + 1]; @@ -84,7 +82,7 @@ public class VertexAttachment extends Attachment { Object[] skeletonBones = skeleton.getBones().items; if (deformArray.size == 0) { for (int w = offset, b = skip * 3; w < count; w += 2) { - float wx = x, wy = y; + float wx = 0, wy = 0; int n = bones[v++]; n += v; for (; v < n; v++, b += 3) { @@ -99,7 +97,7 @@ public class VertexAttachment extends Attachment { } else { float[] deform = deformArray.items; for (int w = offset, b = skip * 3, f = skip << 1; w < count; w += 2) { - float wx = x, wy = y; + float wx = 0, wy = 0; int n = bones[v++]; n += v; for (; v < n; v++, b += 3, f += 2) {