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 ArrayfromSetup).
* @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{ 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