diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java index c86c4f7ac..cd55bb9bb 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java @@ -141,7 +141,7 @@ public class Animation { * @param add If true, for timelines that support it, their values are added to the setup or current values (depending on * fromSetup). * @param out True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant transitions. - * @param appliedPose True to modify {@link Posed#getAppliedPose()}, else {@link Posed#pose} is modified. */ + * @param appliedPose True to modify {@link Posed#appliedPose}, else {@link Posed#pose} is modified. */ public void apply (Skeleton skeleton, float lastTime, float time, boolean loop, @Null Array events, float alpha, boolean fromSetup, boolean add, boolean out, boolean appliedPose) { if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); @@ -254,7 +254,7 @@ public class Animation { * fromSetup). * @param out True when the animation is mixing out, else it is mixing in. Used by timelines that perform instant * transitions. - * @param appliedPose True to modify {@link Posed#getAppliedPose()}, else {@link Posed#pose} is modified. */ + * @param appliedPose True to modify {@link Posed#appliedPose}, else {@link Posed#pose} is modified. */ abstract public void apply (Skeleton skeleton, float lastTime, float time, @Null Array events, float alpha, boolean fromSetup, boolean add, boolean out, boolean appliedPose); @@ -514,7 +514,8 @@ public class Animation { public void apply (Skeleton skeleton, float lastTime, float time, @Null Array events, float alpha, boolean fromSetup, boolean add, boolean out, boolean appliedPose) { Bone bone = skeleton.bones.items[boneIndex]; - if (bone.active) apply(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, fromSetup, add, out); + if (bone.active) + apply(appliedPose ? bone.appliedPose : bone.pose, bone.data.setupPose, time, alpha, fromSetup, add, out); } abstract protected void apply (BonePose pose, BonePose setup, float time, float alpha, boolean fromSetup, boolean add, @@ -556,7 +557,8 @@ public class Animation { public void apply (Skeleton skeleton, float lastTime, float time, @Null Array events, float alpha, boolean fromSetup, boolean add, boolean out, boolean appliedPose) { Bone bone = skeleton.bones.items[boneIndex]; - if (bone.active) apply(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, fromSetup, add, out); + if (bone.active) + apply(appliedPose ? bone.appliedPose : bone.pose, bone.data.setupPose, time, alpha, fromSetup, add, out); } abstract protected void apply (BonePose pose, BonePose setup, float time, float alpha, boolean fromSetup, boolean add, @@ -841,14 +843,14 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { Bone bone = skeleton.bones.items[boneIndex]; if (!bone.active) return; - BonePose pose = appliedPose ? bone.applied : bone.pose; + BonePose pose = appliedPose ? bone.appliedPose : bone.pose; if (out) { - if (fromSetup) pose.inherit = bone.data.setup.inherit; + if (fromSetup) pose.inherit = bone.data.setupPose.inherit; } else { float[] frames = this.frames; if (time < frames[0]) { - if (fromSetup) pose.inherit = bone.data.setup.inherit; + if (fromSetup) pose.inherit = bone.data.setupPose.inherit; } else pose.inherit = Inherit.values[(int)frames[search(frames, time, ENTRIES) + INHERIT]]; } @@ -871,7 +873,7 @@ public class Animation { public void apply (Skeleton skeleton, float lastTime, float time, @Null Array events, float alpha, boolean fromSetup, boolean add, boolean out, boolean appliedPose) { Slot slot = skeleton.slots.items[slotIndex]; - if (slot.bone.active) apply(slot, appliedPose ? slot.applied : slot.pose, time, alpha, fromSetup, add); + if (slot.bone.active) apply(slot, appliedPose ? slot.appliedPose : slot.pose, time, alpha, fromSetup, add); } abstract protected void apply (Slot slot, SlotPose pose, float time, float alpha, boolean fromSetup, boolean add); @@ -908,7 +910,7 @@ public class Animation { Color color = pose.color; float[] frames = this.frames; if (time < frames[0]) { - if (fromSetup) color.set(slot.data.setup.color); + if (fromSetup) color.set(slot.data.setupPose.color); return; } @@ -945,7 +947,7 @@ public class Animation { color.set(r, g, b, a); else { if (fromSetup) { - Color setup = slot.data.setup.color; + Color setup = slot.data.setupPose.color; color.set(setup.r + (r - setup.r) * alpha, setup.g + (g - setup.g) * alpha, setup.b + (b - setup.b) * alpha, setup.a + (a - setup.a) * alpha); } else @@ -984,7 +986,7 @@ public class Animation { float[] frames = this.frames; if (time < frames[0]) { if (fromSetup) { - Color setup = slot.data.setup.color; + Color setup = slot.data.setupPose.color; color.r = setup.r; color.g = setup.g; color.b = setup.b; @@ -1018,7 +1020,7 @@ public class Animation { if (alpha != 1) { if (fromSetup) { - Color setup = slot.data.setup.color; + Color setup = slot.data.setupPose.color; r = setup.r + (r - setup.r) * alpha; g = setup.g + (g - setup.g) * alpha; b = setup.b + (b - setup.b) * alpha; @@ -1052,18 +1054,18 @@ public class Animation { Slot slot = skeleton.slots.items[slotIndex]; if (!slot.bone.active) return; - Color color = (appliedPose ? slot.applied : slot.pose).color; + Color color = (appliedPose ? slot.appliedPose : slot.pose).color; float a; float[] frames = this.frames; if (time < frames[0]) { - if (fromSetup) color.a = slot.data.setup.color.a; + if (fromSetup) color.a = slot.data.setupPose.color.a; return; } a = getCurveValue(time); if (alpha != 1) { if (fromSetup) { - Color setup = slot.data.setup.color; + Color setup = slot.data.setupPose.color; a = setup.a + (a - setup.a) * alpha; } else a = color.a + (a - color.a) * alpha; @@ -1109,7 +1111,7 @@ public class Animation { float[] frames = this.frames; if (time < frames[0]) { if (fromSetup) { - SlotPose setup = slot.data.setup; + SlotPose setup = slot.data.setupPose; light.set(setup.color); Color setupDark = setup.darkColor; dark.r = setupDark.r; @@ -1163,7 +1165,7 @@ public class Animation { if (alpha == 1) light.set(r, g, b, a); else if (fromSetup) { - SlotPose setupPose = slot.data.setup; + SlotPose setupPose = slot.data.setupPose; Color setup = setupPose.color; light.set(setup.r + (r - setup.r) * alpha, setup.g + (g - setup.g) * alpha, setup.b + (b - setup.b) * alpha, setup.a + (a - setup.a) * alpha); @@ -1218,7 +1220,7 @@ public class Animation { float[] frames = this.frames; if (time < frames[0]) { if (fromSetup) { - SlotPose setup = slot.data.setup; + SlotPose setup = slot.data.setupPose; Color setupLight = setup.color, setupDark = setup.darkColor; light.r = setupLight.r; light.g = setupLight.g; @@ -1268,7 +1270,7 @@ public class Animation { if (alpha != 1) { if (fromSetup) { - SlotPose setupPose = slot.data.setup; + SlotPose setupPose = slot.data.setupPose; Color setup = setupPose.color; r = setup.r + (r - setup.r) * alpha; g = setup.g + (g - setup.g) * alpha; @@ -1332,7 +1334,7 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { Slot slot = skeleton.slots.items[slotIndex]; if (!slot.bone.active) return; - SlotPose pose = appliedPose ? slot.applied : slot.pose; + SlotPose pose = appliedPose ? slot.appliedPose : slot.pose; if (out || time < this.frames[0]) { if (fromSetup) setAttachment(skeleton, pose, slot.data.attachmentName); @@ -1599,7 +1601,7 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { Slot slot = skeleton.slots.items[slotIndex]; if (!slot.bone.active) return; - SlotPose pose = appliedPose ? slot.applied : slot.pose; + SlotPose pose = appliedPose ? slot.appliedPose : slot.pose; Attachment slotAttachment = pose.attachment; if (!(slotAttachment instanceof HasSequence hasSequence) || slotAttachment.getTimelineAttachment() != attachment) return; @@ -1887,12 +1889,12 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (IkConstraint)skeleton.constraints.items[constraintIndex]; if (!constraint.active) return; - IkConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; + IkConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; float[] frames = this.frames; if (time < frames[0]) { if (fromSetup) { - IkConstraintPose setup = constraint.data.setup; + IkConstraintPose setup = constraint.data.setupPose; pose.mix = setup.mix; pose.softness = setup.softness; pose.bendDirection = setup.bendDirection; @@ -1923,7 +1925,7 @@ public class Animation { } } - IkConstraintPose base = fromSetup ? constraint.data.setup : pose; + IkConstraintPose base = fromSetup ? constraint.data.setupPose : pose; pose.mix = base.mix + (mix - base.mix) * alpha; pose.softness = base.softness + (softness - base.softness) * alpha; if (out) { @@ -1982,12 +1984,12 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (TransformConstraint)skeleton.constraints.items[constraintIndex]; if (!constraint.active) return; - TransformConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; + TransformConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; float[] frames = this.frames; if (time < frames[0]) { if (fromSetup) { - TransformConstraintPose setup = constraint.data.setup; + TransformConstraintPose setup = constraint.data.setupPose; pose.mixRotate = setup.mixRotate; pose.mixX = setup.mixX; pose.mixY = setup.mixY; @@ -2035,7 +2037,7 @@ public class Animation { } } - TransformConstraintPose base = fromSetup ? constraint.data.setup : pose; + TransformConstraintPose base = fromSetup ? constraint.data.setupPose : pose; if (add) { pose.mixRotate = base.mixRotate + rotate * alpha; pose.mixX = base.mixX + x * alpha; @@ -2079,8 +2081,8 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (PathConstraint)skeleton.constraints.items[constraintIndex]; if (constraint.active) { - PathConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; - pose.position = getAbsoluteValue(time, alpha, fromSetup, add, pose.position, constraint.data.setup.position); + PathConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; + pose.position = getAbsoluteValue(time, alpha, fromSetup, add, pose.position, constraint.data.setupPose.position); } } } @@ -2095,8 +2097,8 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (PathConstraint)skeleton.constraints.items[constraintIndex]; if (constraint.active) { - PathConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; - pose.spacing = getAbsoluteValue(time, alpha, fromSetup, false, pose.spacing, constraint.data.setup.spacing); + PathConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; + pose.spacing = getAbsoluteValue(time, alpha, fromSetup, false, pose.spacing, constraint.data.setupPose.spacing); } } } @@ -2137,12 +2139,12 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (PathConstraint)skeleton.constraints.items[constraintIndex]; if (!constraint.active) return; - PathConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; + PathConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; float[] frames = this.frames; if (time < frames[0]) { if (fromSetup) { - PathConstraintPose setup = constraint.data.setup; + PathConstraintPose setup = constraint.data.setupPose; pose.mixRotate = setup.mixRotate; pose.mixX = setup.mixX; pose.mixY = setup.mixY; @@ -2175,7 +2177,7 @@ public class Animation { } } - PathConstraintPose base = fromSetup ? constraint.data.setup : pose; + PathConstraintPose base = fromSetup ? constraint.data.setupPose : pose; if (add) { pose.mixRotate = base.mixRotate + rotate * alpha; pose.mixX = base.mixX + x * alpha; @@ -2204,15 +2206,15 @@ public class Animation { for (int i = 0, n = skeleton.physics.size; i < n; i++) { PhysicsConstraint constraint = constraints[i]; if (constraint.active && global(constraint.data)) { - PhysicsConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; - set(pose, getAbsoluteValue(time, alpha, fromSetup, add, get(pose), get(constraint.data.setup), value)); + PhysicsConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; + set(pose, getAbsoluteValue(time, alpha, fromSetup, add, get(pose), get(constraint.data.setupPose), value)); } } } else { var constraint = (PhysicsConstraint)skeleton.constraints.items[constraintIndex]; if (constraint.active) { - PhysicsConstraintPose pose = appliedPose ? constraint.applied : constraint.pose; - set(pose, getAbsoluteValue(time, alpha, fromSetup, add, get(pose), get(constraint.data.setup))); + PhysicsConstraintPose pose = appliedPose ? constraint.appliedPose : constraint.pose; + set(pose, getAbsoluteValue(time, alpha, fromSetup, add, get(pose), get(constraint.data.setupPose))); } } } @@ -2431,8 +2433,8 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (Slider)skeleton.constraints.items[constraintIndex]; if (constraint.active) { - SliderPose pose = appliedPose ? constraint.applied : constraint.pose; - pose.time = getAbsoluteValue(time, alpha, fromSetup, add, pose.time, constraint.data.setup.time); + SliderPose pose = appliedPose ? constraint.appliedPose : constraint.pose; + pose.time = getAbsoluteValue(time, alpha, fromSetup, add, pose.time, constraint.data.setupPose.time); } } } @@ -2448,8 +2450,8 @@ public class Animation { boolean add, boolean out, boolean appliedPose) { var constraint = (Slider)skeleton.constraints.items[constraintIndex]; if (constraint.active) { - SliderPose pose = appliedPose ? constraint.applied : constraint.pose; - pose.mix = getAbsoluteValue(time, alpha, fromSetup, add, pose.mix, constraint.data.setup.mix); + SliderPose pose = appliedPose ? constraint.appliedPose : constraint.pose; + pose.mix = getAbsoluteValue(time, alpha, fromSetup, add, pose.mix, constraint.data.setupPose.mix); } } } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java index 47b4792ae..d5f5413b6 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/AnimationState.java @@ -345,7 +345,7 @@ public class AnimationState { Bone bone = skeleton.bones.items[timeline.boneIndex]; if (!bone.active) return; - BonePose pose = bone.pose, setup = bone.data.setup; + BonePose pose = bone.pose, setup = bone.data.setupPose; float[] frames = timeline.frames; if (time < frames[0]) { // Time is before first frame. if (fromSetup) pose.rotation = setup.rotation; 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 6294de3a9..f8ee64e97 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java @@ -37,8 +37,8 @@ import com.badlogic.gdx.utils.Null; *
    *
  • {@link #data}: The setup pose. *
  • {@link #pose}: The unconstrained local pose. Set by animations and application code. - *
  • {@link #getAppliedPose()}: The constrained local pose. The {@link #pose} with modifications by constraints. - *
  • World transform (on the applied pose): the {@link #getAppliedPose()} combined with the parent world transform. Computed by + *
  • {@link #appliedPose}: The constrained local pose. The {@link #pose} with modifications by constraints. + *
  • World transform (on the applied pose): the {@link #appliedPose} combined with the parent world transform. Computed by * {@link Skeleton#updateWorldTransform(Physics)} and {@link BonePose#updateWorldTransform(Skeleton)}. *
*/ @@ -50,8 +50,8 @@ public class Bone extends PosedActive { public Bone (BoneData data, @Null Bone parent) { super(data, new BonePose(), new BonePose()); this.parent = parent; - applied.bone = this; - constrained.bone = this; + appliedPose.bone = this; + constrainedPose.bone = this; } /** Copy constructor. Does not copy the {@link #children} bones. */ diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java index aef3ff418..f2da19497 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java @@ -55,7 +55,7 @@ public class BoneData extends PosedData { public BoneData (BoneData data, @Null BoneData parent) { this(data.index, data.name, parent); length = data.length; - setup.set(data.setup); + setupPose.set(data.setupPose); } /** The bone's name, unique across all bones in the skeleton. diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java index 4567cdf2c..af53273e7 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java @@ -160,7 +160,7 @@ public class BonePose implements Pose, Update { return; } - BonePose parent = bone.parent.applied; + BonePose parent = bone.parent.appliedPose; float pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; worldX = pa * x + pb * y + parent.worldX; worldY = pc * x + pd * y + parent.worldY; @@ -264,7 +264,7 @@ public class BonePose implements Pose, Update { return; } - BonePose parent = bone.parent.applied; + BonePose parent = bone.parent.appliedPose; float pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; float pid = 1 / (pa * pd - pb * pc); float ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid; @@ -351,7 +351,7 @@ public class BonePose implements Pose, Update { void resetWorld (int update) { Bone[] children = bone.children.items; for (int i = 0, n = bone.children.size; i < n; i++) { - BonePose child = children[i].applied; + BonePose child = children[i].appliedPose; if (child.world == update) { child.world = 0; child.local = 0; @@ -472,13 +472,13 @@ public class BonePose implements Pose, Update { /** Transforms a point from world coordinates to the parent bone's local coordinates. */ public Vector2 worldToParent (Vector2 world) { if (world == null) throw new IllegalArgumentException("world cannot be null."); - return bone.parent == null ? world : bone.parent.applied.worldToLocal(world); + return bone.parent == null ? world : bone.parent.appliedPose.worldToLocal(world); } /** Transforms a point from the parent bone's coordinates to world coordinates. */ public Vector2 parentToWorld (Vector2 world) { if (world == null) throw new IllegalArgumentException("world cannot be null."); - return bone.parent == null ? world : bone.parent.applied.localToWorld(world); + return bone.parent == null ? world : bone.parent.appliedPose.localToWorld(world); } /** Transforms a world rotation to a local rotation. */ diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java index bf55d5956..b8dc2b4fd 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java @@ -49,7 +49,7 @@ public class IkConstraint extends Constraint apply(skeleton, bones[0], target.worldX, target.worldY, p.compress, p.stretch, data.uniform, p.mix); @@ -108,7 +108,7 @@ public class IkConstraint extends Constraint 0 ? degRad : -degRad; } for (int i = 0, ip = 3, u = skeleton.update; i < boneCount; i++, ip += 3) { @@ -201,7 +201,7 @@ public class PathConstraint extends Constraint *
  • {@link #data}: The setup pose. *
  • {@link #pose}: The unconstrained pose. Set by animations and application code. - *
  • {@link #getAppliedPose()}: The constrained pose. The {@link #pose} with modifications by constraints. + *
  • {@link #appliedPose}: The constrained pose. The {@link #pose} with modifications by constraints. * */ abstract public class Posed< // @@ -14,20 +14,20 @@ abstract public class Posed< // final D data; final P pose; - final P constrained; - P applied; + final P constrainedPose; + P appliedPose; - protected Posed (D data, P pose, P constrained) { + protected Posed (D data, P pose, P constrainedPose) { if (data == null) throw new IllegalArgumentException("data cannot be null."); this.data = data; this.pose = pose; - this.constrained = constrained; - applied = pose; + this.constrainedPose = constrainedPose; + appliedPose = pose; } /** Sets the unconstrained pose to the setup pose. */ public void setupPose () { - pose.set(data.setup); + pose.set(data.setupPose); } /** The setup pose data. May be shared with multiple instances. */ @@ -43,22 +43,22 @@ abstract public class Posed< // /** If no constraints modify this object, the applied pose is the same as the {@link #pose}. Otherwise it is a copy of the * {@link #pose} modified by constraints. */ public P getAppliedPose () { - return applied; + return appliedPose; } /** Sets the applied pose to the unconstrained pose, for when no constraints will modify the pose. */ void pose () { // Port: usePose - applied = pose; + appliedPose = pose; } /** Sets the applied pose to the constrained pose, in anticipation of the applied pose being modified by constraints. */ void constrained () { // Port: useConstrained - applied = constrained; + appliedPose = constrainedPose; } /** Sets the constrained pose to the unconstrained pose, as a starting point for constraints to be applied. */ void reset () { // Port: resetConstrained - constrained.set(pose); + constrainedPose.set(pose); } public String toString () { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java index 6a4f1b3be..d7fef074a 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PosedData.java @@ -32,13 +32,13 @@ package com.esotericsoftware.spine; /** The base class for storing setup data for a posed object. May be shared with multiple instances. */ abstract public class PosedData

    { final String name; - final P setup; + final P setupPose; boolean skinRequired; - protected PosedData (String name, P setup) { + protected PosedData (String name, P setupPose) { if (name == null) throw new IllegalArgumentException("name cannot be null."); this.name = name; - this.setup = setup; + this.setupPose = setupPose; } public String getName () { @@ -47,7 +47,7 @@ abstract public class PosedData

    { /** The setup pose that most animations are relative to. */ public P getSetupPose () { - return setup; + return setupPose; } /** When true, {@link Skeleton#updateWorldTransform(Physics)} only updates this constraint if the {@link Skeleton#skin} diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java index a327816d5..b9875d22f 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java @@ -195,11 +195,11 @@ public class Skeleton { Object[] updateCache = this.updateCache.items; n = this.updateCache.size; for (int i = 0; i < n; i++) - if (updateCache[i] instanceof Bone bone) updateCache[i] = bone.applied; + if (updateCache[i] instanceof Bone bone) updateCache[i] = bone.appliedPose; } void constrained (Posed object) { - if (object.pose == object.applied) { + if (object.pose == object.appliedPose) { object.constrained(); resetCache.add(object); } @@ -255,7 +255,7 @@ public class Skeleton { resetCache[i].reset(); // Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection. - BonePose rootBone = getRootBone().applied; + BonePose rootBone = getRootBone().appliedPose; float pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; rootBone.worldX = pa * x + pb * y + parent.worldX; rootBone.worldY = pc * x + pd * y + parent.worldY; @@ -498,7 +498,7 @@ public class Skeleton { if (attachment instanceof RegionAttachment region) { verticesLength = 8; vertices = temp.setSize(8); - region.computeWorldVertices(slot, region.getOffsets(slot.applied), vertices, 0, 2); + region.computeWorldVertices(slot, region.getOffsets(slot.appliedPose), vertices, 0, 2); triangles = quadTriangles; } else if (attachment instanceof MeshAttachment mesh) { verticesLength = mesh.getWorldVerticesLength(); diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java index ab8879fd1..723d977b3 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java @@ -230,7 +230,7 @@ public class SkeletonBinary extends SkeletonLoader { String name = input.readString(); BoneData parent = i == 0 ? null : bones[input.readInt(true)]; var data = new BoneData(i, name, parent); - BonePose setup = data.setup; + BonePose setup = data.setupPose; setup.rotation = input.readFloat(); setup.x = input.readFloat() * scale; setup.y = input.readFloat() * scale; @@ -255,10 +255,10 @@ public class SkeletonBinary extends SkeletonLoader { String slotName = input.readString(); var boneData = bones[input.readInt(true)]; var data = new SlotData(i, slotName, boneData); - Color.rgba8888ToColor(data.setup.color, input.readInt()); + Color.rgba8888ToColor(data.setupPose.color, input.readInt()); int darkColor = input.readInt(); - if (darkColor != -1) Color.rgb888ToColor(data.setup.darkColor = new Color(), darkColor); + if (darkColor != -1) Color.rgb888ToColor(data.setupPose.darkColor = new Color(), darkColor); data.attachmentName = input.readStringRef(); data.blendMode = BlendMode.values[input.readInt(true)]; @@ -282,7 +282,7 @@ public class SkeletonBinary extends SkeletonLoader { int flags = input.read(); data.skinRequired = (flags & 1) != 0; data.uniform = (flags & 2) != 0; - IkConstraintPose setup = data.setup; + IkConstraintPose setup = data.setupPose; setup.bendDirection = (flags & 4) != 0 ? -1 : 1; setup.compress = (flags & 8) != 0; setup.stretch = (flags & 16) != 0; @@ -354,7 +354,7 @@ public class SkeletonBinary extends SkeletonLoader { if ((flags & 16) != 0) data.offsets[TransformConstraintData.SCALEY] = input.readFloat(); if ((flags & 32) != 0) data.offsets[TransformConstraintData.SHEARY] = input.readFloat(); flags = input.read(); - TransformConstraintPose setup = data.setup; + TransformConstraintPose setup = data.setupPose; if ((flags & 1) != 0) setup.mixRotate = input.readFloat(); if ((flags & 2) != 0) setup.mixX = input.readFloat(); if ((flags & 4) != 0) setup.mixY = input.readFloat(); @@ -375,7 +375,7 @@ public class SkeletonBinary extends SkeletonLoader { data.spacingMode = SpacingMode.values[(flags >> 2) & 0b11]; data.rotateMode = RotateMode.values[(flags >> 4) & 0b11]; if ((flags & 128) != 0) data.offsetRotation = input.readFloat(); - PathConstraintPose setup = data.setup; + PathConstraintPose setup = data.setupPose; setup.position = input.readFloat(); if (data.positionMode == PositionMode.fixed) setup.position *= scale; setup.spacing = input.readFloat(); @@ -397,7 +397,7 @@ public class SkeletonBinary extends SkeletonLoader { if ((flags & 32) != 0) data.shearX = input.readFloat(); data.limit = ((flags & 64) != 0 ? input.readFloat() : 5000) * scale; data.step = 1f / input.readUnsignedByte(); - PhysicsConstraintPose setup = data.setup; + PhysicsConstraintPose setup = data.setupPose; setup.inertia = input.readFloat(); setup.strength = input.readFloat(); setup.damping = input.readFloat(); @@ -421,8 +421,8 @@ public class SkeletonBinary extends SkeletonLoader { data.skinRequired = (flags & 1) != 0; data.loop = (flags & 2) != 0; data.additive = (flags & 4) != 0; - if ((flags & 8) != 0) data.setup.time = input.readFloat(); - if ((flags & 16) != 0) data.setup.mix = (flags & 32) != 0 ? input.readFloat() : 1; + if ((flags & 8) != 0) data.setupPose.time = input.readFloat(); + if ((flags & 16) != 0) data.setupPose.mix = (flags & 32) != 0 ? input.readFloat() : 1; if ((flags & 64) != 0) { data.local = (flags & 128) != 0; data.bone = bones[input.readInt(true)]; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java index e57f6b3b4..0dfcc1b60 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java @@ -67,7 +67,7 @@ public class SkeletonBounds { for (int i = 0; i < slotCount; i++) { Slot slot = slots[i]; if (!slot.bone.active) continue; - Attachment attachment = slot.applied.attachment; + Attachment attachment = slot.appliedPose.attachment; if (attachment instanceof BoundingBoxAttachment boundingBox) { boundingBoxes.add(boundingBox); diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java index f3d69d700..b801d8cb6 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonJson.java @@ -189,7 +189,7 @@ public class SkeletonJson extends SkeletonLoader { } var data = new BoneData(skeletonData.bones.size, boneMap.getString("name"), parent); data.length = boneMap.getFloat("length", 0) * scale; - BonePose setup = data.setup; + BonePose setup = data.setupPose; setup.x = boneMap.getFloat("x", 0) * scale; setup.y = boneMap.getFloat("y", 0) * scale; setup.rotation = boneMap.getFloat("rotation", 0); @@ -219,10 +219,10 @@ public class SkeletonJson extends SkeletonLoader { var data = new SlotData(skeletonData.slots.size, slotName, boneData); String color = slotMap.getString("color", null); - if (color != null) Color.valueOf(color, data.setup.getColor()); + if (color != null) Color.valueOf(color, data.setupPose.getColor()); String dark = slotMap.getString("dark", null); - if (dark != null) data.setup.darkColor = Color.valueOf(dark); + if (dark != null) data.setupPose.darkColor = Color.valueOf(dark); data.attachmentName = slotMap.getString("attachment", null); data.blendMode = BlendMode.valueOf(slotMap.getString("blend", BlendMode.normal.name())); @@ -250,7 +250,7 @@ public class SkeletonJson extends SkeletonLoader { if (data.target == null) throw new SerializationException("IK target bone not found: " + targetName); data.uniform = constraintMap.getBoolean("uniform", false); - IkConstraintPose setup = data.setup; + IkConstraintPose setup = data.setupPose; setup.mix = constraintMap.getFloat("mix", 1); setup.softness = constraintMap.getFloat("softness", 0) * scale; setup.bendDirection = constraintMap.getBoolean("bendPositive", true) ? 1 : -1; @@ -331,7 +331,7 @@ public class SkeletonJson extends SkeletonLoader { data.offsets[TransformConstraintData.SCALEY] = constraintMap.getFloat("scaleY", 0); data.offsets[TransformConstraintData.SHEARY] = constraintMap.getFloat("shearY", 0); - TransformConstraintPose setup = data.setup; + TransformConstraintPose setup = data.setupPose; if (rotate) setup.mixRotate = constraintMap.getFloat("mixRotate", 1); if (x) setup.mixX = constraintMap.getFloat("mixX", 1); if (y) setup.mixY = constraintMap.getFloat("mixY", setup.mixX); @@ -359,7 +359,7 @@ public class SkeletonJson extends SkeletonLoader { data.spacingMode = SpacingMode.valueOf(constraintMap.getString("spacingMode", "length")); data.rotateMode = RotateMode.valueOf(constraintMap.getString("rotateMode", "tangent")); data.offsetRotation = constraintMap.getFloat("rotation", 0); - PathConstraintPose setup = data.setup; + PathConstraintPose setup = data.setupPose; setup.position = constraintMap.getFloat("position", 0); if (data.positionMode == PositionMode.fixed) setup.position *= scale; setup.spacing = constraintMap.getFloat("spacing", 0); @@ -385,7 +385,7 @@ public class SkeletonJson extends SkeletonLoader { data.shearX = constraintMap.getFloat("shearX", 0); data.limit = constraintMap.getFloat("limit", 5000) * scale; data.step = 1f / constraintMap.getInt("fps", 60); - PhysicsConstraintPose setup = data.setup; + PhysicsConstraintPose setup = data.setupPose; setup.inertia = constraintMap.getFloat("inertia", 0.5f); setup.strength = constraintMap.getFloat("strength", 100); setup.damping = constraintMap.getFloat("damping", 0.85f); @@ -408,8 +408,8 @@ public class SkeletonJson extends SkeletonLoader { data.skinRequired = skinRequired; data.additive = constraintMap.getBoolean("additive", false); data.loop = constraintMap.getBoolean("loop", false); - data.setup.time = constraintMap.getFloat("time", 0); - data.setup.mix = constraintMap.getFloat("mix", 1); + data.setupPose.time = constraintMap.getFloat("time", 0); + data.setupPose.mix = constraintMap.getFloat("mix", 1); String boneName = constraintMap.getString("bone", null); if (boneName != null) { 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 3e4c7fac7..71ca81ec7 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java @@ -81,7 +81,7 @@ public class SkeletonRenderer { for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) { Slot slot = drawOrder[i]; if (!slot.bone.active) continue; - SlotPose pose = slot.applied; + SlotPose pose = slot.appliedPose; Attachment attachment = pose.attachment; if (attachment instanceof RegionAttachment region) { Sequence sequence = region.getSequence(); @@ -150,7 +150,7 @@ public class SkeletonRenderer { for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) { Slot slot = drawOrder[i]; if (slot.bone.active) { - SlotPose pose = slot.applied; + SlotPose pose = slot.appliedPose; Attachment attachment = pose.attachment; if (attachment != null) { Texture texture = null; @@ -249,7 +249,7 @@ public class SkeletonRenderer { for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) { Slot slot = drawOrder[i]; if (slot.bone.active) { - SlotPose pose = slot.applied; + SlotPose pose = slot.appliedPose; Attachment attachment = pose.attachment; if (attachment != null) { Texture texture = null; diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRendererDebug.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRendererDebug.java index 8950daa7b..acc069f84 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRendererDebug.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRendererDebug.java @@ -96,7 +96,7 @@ public class SkeletonRendererDebug { shapes.setColor(boneOriginColor); } else shapes.setColor(boneLineColor); - BonePose applied = bone.applied; + BonePose applied = bone.appliedPose; float x = length * applied.a + applied.worldX; float y = length * applied.c + applied.worldY; shapes.rectLine(applied.worldX, applied.worldY, x, y, width * scale); @@ -109,9 +109,9 @@ public class SkeletonRendererDebug { for (int i = 0; i < slotCount; i++) { Slot slot = slots[i]; if (!slot.bone.active) continue; - if (!(slot.applied.attachment instanceof PointAttachment point)) continue; - point.computeWorldPosition(slot.bone.applied, temp1); - temp2.set(8, 0).rotate(point.computeWorldRotation(slot.bone.applied)); + if (!(slot.appliedPose.attachment instanceof PointAttachment point)) continue; + point.computeWorldPosition(slot.bone.appliedPose, temp1); + temp2.set(8, 0).rotate(point.computeWorldRotation(slot.bone.appliedPose)); shapes.rectLine(temp1, temp2, boneWidth / 2 * scale); } } @@ -126,7 +126,7 @@ public class SkeletonRendererDebug { if (!slot.bone.active) continue; if (slot.pose.attachment instanceof RegionAttachment region) { float[] vertices = this.vertices.items; - float[] offsets = region.getOffsets(slot.applied); + float[] offsets = region.getOffsets(slot.appliedPose); region.computeWorldVertices(slot, offsets, vertices, 0, 2); shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); @@ -241,7 +241,7 @@ public class SkeletonRendererDebug { for (int i = 0; i < boneCount; i++) { Bone bone = bones[i]; if (!bone.active) continue; - shapes.circle(bone.applied.worldX, bone.applied.worldY, 3 * scale, 8); + shapes.circle(bone.appliedPose.worldX, bone.appliedPose.worldY, 3 * scale, 8); } } @@ -251,7 +251,7 @@ public class SkeletonRendererDebug { Slot slot = slots[i]; if (!slot.bone.active) continue; if (!(slot.pose.attachment instanceof PointAttachment point)) continue; - point.computeWorldPosition(slot.bone.applied, temp1); + point.computeWorldPosition(slot.bone.appliedPose, temp1); shapes.circle(temp1.x, temp1.y, 3 * scale, 8); } } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java index 44c5d1ec3..63accf5db 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java @@ -56,15 +56,15 @@ public class Slider extends Constraint { } public void update (Skeleton skeleton, Physics physics) { - SliderPose p = applied; + SliderPose p = appliedPose; if (p.mix == 0) return; Animation animation = data.animation; if (bone != null) { if (!bone.active) return; - if (data.local) bone.applied.validateLocalTransform(skeleton); + if (data.local) bone.appliedPose.validateLocalTransform(skeleton); p.time = data.offset - + (data.property.value(skeleton, bone.applied, data.local, offsets) - data.property.offset) * data.scale; + + (data.property.value(skeleton, bone.appliedPose, data.local, offsets) - data.property.offset) * data.scale; if (data.loop) p.time = animation.duration + (p.time % animation.duration); else @@ -74,7 +74,7 @@ public class Slider extends Constraint { Bone[] bones = skeleton.bones.items; int[] indices = animation.bones.items; for (int i = 0, n = animation.bones.size; i < n; i++) - bones[indices[i]].applied.modifyLocal(skeleton); + bones[indices[i]].appliedPose.modifyLocal(skeleton); animation.apply(skeleton, p.time, p.time, data.loop, null, p.mix, false, data.additive, false, true); } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java index 9617bc278..86d70db7d 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java @@ -45,9 +45,9 @@ public class Slot extends Posed { if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); this.skeleton = skeleton; bone = skeleton.bones.items[data.boneData.index]; - if (data.setup.darkColor != null) { + if (data.setupPose.darkColor != null) { pose.darkColor = new Color(); - constrained.darkColor = new Color(); + constrainedPose.darkColor = new Color(); } setupPose(); } @@ -59,9 +59,9 @@ public class Slot extends Posed { if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); this.bone = bone; this.skeleton = skeleton; - if (data.setup.darkColor != null) { + if (data.setupPose.darkColor != null) { pose.darkColor = new Color(); - constrained.darkColor = new Color(); + constrainedPose.darkColor = new Color(); } pose.set(slot.pose); } @@ -72,9 +72,9 @@ public class Slot extends Posed { } public void setupPose () { - pose.color.set(data.setup.color); - if (pose.darkColor != null) pose.darkColor.set(data.setup.darkColor); - pose.sequenceIndex = data.setup.sequenceIndex; + pose.color.set(data.setupPose.color); + if (pose.darkColor != null) pose.darkColor.set(data.setupPose.darkColor); + pose.sequenceIndex = data.setupPose.sequenceIndex; if (data.attachmentName == null) pose.setAttachment(null); else { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java index f21aea9e8..a809001b8 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java @@ -49,7 +49,7 @@ public class TransformConstraint extends Constraint