diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/ActorTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/ActorTest.java index bd8139e4b..5d910f597 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/ActorTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/ActorTest.java @@ -37,7 +37,6 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.utils.viewport.ScreenViewport; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.SkeletonActor; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AttachmentTimelineTests.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AttachmentTimelineTests.java index 0ab7dbf5e..f57bbc54d 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AttachmentTimelineTests.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/AttachmentTimelineTests.java @@ -92,8 +92,8 @@ public class AttachmentTimelineTests { private void test (float delta, Attachment attachment) { state.update(delta); state.apply(skeleton); - if (slot.getAttachment() != attachment) - throw new FailException("Wrong attachment: " + slot.getAttachment() + " != " + attachment); + if (slot.getPose().getAttachment() != attachment) + throw new FailException("Wrong attachment: " + slot.getPose().getAttachment() + " != " + attachment); } diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/BonePlotting.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/BonePlotting.java index f642a6a93..d4ab28113 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/BonePlotting.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/BonePlotting.java @@ -34,7 +34,6 @@ import com.badlogic.gdx.utils.Null; import com.esotericsoftware.spine.Animation.MixBlend; import com.esotericsoftware.spine.Animation.MixDirection; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.attachments.AttachmentLoader; import com.esotericsoftware.spine.attachments.BoundingBoxAttachment; import com.esotericsoftware.spine.attachments.ClippingAttachment; @@ -76,7 +75,7 @@ public class BonePlotting { SkeletonData skeletonData = json.readSkeletonData(new FileHandle("assets/spineboy/spineboy-ess.json")); Skeleton skeleton = new Skeleton(skeletonData); - BoneApplied bone = skeleton.findBone("gun-tip").getApplied(); + BoneApplied bone = skeleton.findBone("gun-tip").getAppliedPose(); // Pose the skeleton at regular intervals throughout each animation. float fps = 1 / 15f; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/Box2DExample.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/Box2DExample.java index c1f174745..07f603ad0 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/Box2DExample.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/Box2DExample.java @@ -54,7 +54,6 @@ import com.badlogic.gdx.utils.ScreenUtils; import com.esotericsoftware.spine.Animation.MixBlend; import com.esotericsoftware.spine.Animation.MixDirection; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.attachments.AtlasAttachmentLoader; import com.esotericsoftware.spine.attachments.RegionAttachment; import com.esotericsoftware.spine.attachments.Sequence; @@ -116,8 +115,8 @@ public class Box2DExample extends ApplicationAdapter { // Create a body for each attachment. Note it is probably better to create just a few bodies rather than one for each // region attachment, but this is just an example. for (Slot slot : skeleton.getSlots()) { - if (!(slot.getAttachment() instanceof Box2dAttachment)) continue; - Box2dAttachment attachment = (Box2dAttachment)slot.getAttachment(); + if (!(slot.getPose().getAttachment() instanceof Box2dAttachment)) continue; + Box2dAttachment attachment = (Box2dAttachment)slot.getPose().getAttachment(); PolygonShape boxPoly = new PolygonShape(); boxPoly.setAsBox(attachment.getWidth() / 2 * attachment.getScaleX(), attachment.getHeight() / 2 * attachment.getScaleY(), @@ -159,10 +158,10 @@ public class Box2DExample extends ApplicationAdapter { // Position the physics body for each attachment. for (Slot slot : skeleton.getSlots()) { - if (!(slot.getAttachment() instanceof Box2dAttachment)) continue; - Box2dAttachment attachment = (Box2dAttachment)slot.getAttachment(); + if (!(slot.getAppliedPose().getAttachment() instanceof Box2dAttachment)) continue; + Box2dAttachment attachment = (Box2dAttachment)slot.getAppliedPose().getAttachment(); if (attachment.body == null) continue; - BoneApplied bone = slot.getBone().getApplied(); + BoneApplied bone = slot.getBone().getAppliedPose(); float x = bone.getWorldX(); float y = bone.getWorldY(); float rotation = bone.getWorldRotationX(); diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/FboTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/FboTest.java index 23afdc9c2..3e91f629f 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/FboTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/FboTest.java @@ -42,7 +42,6 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.glutils.FrameBuffer; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates rendering an animation to a frame buffer (FBO) and then rendering the FBO to the screen. */ diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/IKTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/IKTest.java index 2c7a04ff3..0eb5037dd 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/IKTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/IKTest.java @@ -38,7 +38,6 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates how to let the target bone of an IK constraint follow the mouse or touch position, which in turn repositions part @@ -107,8 +106,8 @@ public class IKTest extends ApplicationAdapter { Bone crosshair = skeleton.findBone("crosshair"); // Should be cached. boneCoords.set(cameraCoords.x, cameraCoords.y); - crosshair.getParent().getApplied().worldToLocal(boneCoords); // camera space to local bone space - crosshair.setPosition(boneCoords.x, boneCoords.y); // override the crosshair position + crosshair.getParent().getAppliedPose().worldToLocal(boneCoords); // camera space to local bone space + crosshair.getPose().setPosition(boneCoords.x, boneCoords.y); // override the crosshair position // Calculate final world transform with the crosshair bone set to the mouse cursor position. Update physics this time. skeleton.updateWorldTransform(Physics.update); diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/MixAndMatchTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/MixAndMatchTest.java index c015ed395..68127135a 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/MixAndMatchTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/MixAndMatchTest.java @@ -37,8 +37,6 @@ import com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; - /** Demonstrates creating and configuring a new skin at runtime. */ public class MixAndMatchTest extends ApplicationAdapter { OrthographicCamera camera; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/NormalMapTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/NormalMapTest.java index 031269d75..00375bb2c 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/NormalMapTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/NormalMapTest.java @@ -58,7 +58,6 @@ import com.badlogic.gdx.utils.ScreenUtils; import com.esotericsoftware.spine.Animation.MixBlend; import com.esotericsoftware.spine.Animation.MixDirection; -import com.esotericsoftware.spine.Skeleton.Physics; /** Demonstrates simplistic usage of lighting with normal maps. *
@@ -107,7 +106,7 @@ public class NormalMapTest extends ApplicationAdapter { if (animation == null) animation = skeletonData.getAnimations().first(); skeleton = new Skeleton(skeletonData); - skeleton.setToSetupPose(); + skeleton.setupPose(); skeleton = new Skeleton(skeleton); skeleton.setX(ui.prefs.getFloat("x", Gdx.graphics.getWidth() / 2)); skeleton.setY(ui.prefs.getFloat("y", Gdx.graphics.getHeight() / 4)); diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest.java index 578bd910f..164a14133 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest.java @@ -35,7 +35,7 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.esotericsoftware.spine.Skeleton.Physics; + import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates loading, animating, and rendering a skeleton. diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest2.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest2.java index aeb9673c3..d81cbcf21 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest2.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest2.java @@ -37,7 +37,6 @@ import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates loading, animating, and rendering a skeleton. diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest3.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest3.java index a2a6aa488..ee4a6ee46 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest3.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest3.java @@ -35,7 +35,7 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.esotericsoftware.spine.Skeleton.Physics; + import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates loading, animating, and rendering a skeleton. diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest4.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest4.java index 5264277a5..2f75efbc2 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest4.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PhysicsTest4.java @@ -35,7 +35,7 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.esotericsoftware.spine.Skeleton.Physics; + import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates loading, animating, and rendering a skeleton. diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PngExportTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PngExportTest.java index 72f9276f8..f88d061ca 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PngExportTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/PngExportTest.java @@ -48,7 +48,6 @@ import com.badlogic.gdx.utils.ScreenUtils; import com.esotericsoftware.spine.Animation.MixBlend; import com.esotericsoftware.spine.Animation.MixDirection; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates rendering an animation to a frame buffer (FBO) and then writing each frame as a PNG. */ diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest1.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest1.java index 123f4d4e0..a775cbc41 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest1.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest1.java @@ -36,7 +36,6 @@ import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.TextureAtlas; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; /** Demonstrates loading, animating, and rendering a skeleton. diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest2.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest2.java index a3562d8bb..cf4a667e2 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest2.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest2.java @@ -41,7 +41,6 @@ import com.badlogic.gdx.math.Vector3; import com.esotericsoftware.spine.AnimationState.AnimationStateListener; import com.esotericsoftware.spine.AnimationState.TrackEntry; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.attachments.BoundingBoxAttachment; import com.esotericsoftware.spine.utils.TwoColorPolygonBatch; @@ -123,14 +122,14 @@ public class SimpleTest2 extends ApplicationAdapter { BoundingBoxAttachment hit = bounds.containsPoint(point.x, point.y); // Check if inside a bounding box. if (hit != null) { System.out.println("hit: " + hit); - skeleton.findSlot("head").getColor().set(Color.RED); // Turn head red until touchUp. + skeleton.findSlot("head").getPose().getColor().set(Color.RED); // Turn head red until touchUp. } } return true; } public boolean touchUp (int screenX, int screenY, int pointer, int button) { - skeleton.findSlot("head").getColor().set(Color.WHITE); + skeleton.findSlot("head").getPose().getColor().set(Color.WHITE); return true; } diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest3.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest3.java index 9a20f98dc..d32362cbf 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest3.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SimpleTest3.java @@ -37,8 +37,6 @@ import com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; - /** Demonstrates applying multiple animations at once using {@link AnimationState} tracks. */ public class SimpleTest3 extends ApplicationAdapter { OrthographicCamera camera; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAssetManagerTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAssetManagerTest.java index 5a227e0c0..4a9fe4411 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAssetManagerTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAssetManagerTest.java @@ -38,7 +38,6 @@ import com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.utils.SkeletonDataLoader; import com.esotericsoftware.spine.utils.SkeletonDataLoader.SkeletonDataParameter; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAttachmentTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAttachmentTest.java index 0ed28cce7..07756192d 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAttachmentTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAttachmentTest.java @@ -37,7 +37,6 @@ import com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; import com.esotericsoftware.spine.attachments.SkeletonAttachment; /** Demonstrates using {@link SkeletonAttachment} to use an entire skeleton as an attachment. */ @@ -77,7 +76,7 @@ public class SkeletonAttachmentTest extends ApplicationAdapter { SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("goblins/goblins-pro.json")); goblin = new Skeleton(skeletonData); goblin.setSkin("goblin"); - goblin.setSlotsToSetupPose(); + goblin.setupPoseSlots(); goblinState = new AnimationState(new AnimationStateData(skeletonData)); goblinState.setAnimation(0, "walk", true); @@ -86,8 +85,8 @@ public class SkeletonAttachmentTest extends ApplicationAdapter { SkeletonAttachment skeletonAttachment = new SkeletonAttachment("goblin"); skeletonAttachment.setSkeleton(goblin); Slot slot = spineboy.findSlot("front-upper-arm"); - slot.setAttachment(skeletonAttachment); - attachmentBone = slot.getBone().getApplied(); + slot.getPose().setAttachment(skeletonAttachment); + attachmentBone = slot.getBone().getAppliedPose(); } } diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TestHarness.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TestHarness.java index 4741f80ba..a5b92125c 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TestHarness.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TestHarness.java @@ -39,8 +39,6 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.utils.ScreenUtils; -import com.esotericsoftware.spine.Skeleton.Physics; - /** Boilerplate for basic skeleton rendering, used for various testing. */ public class TestHarness extends ApplicationAdapter { static String JSON = "raptor/raptor-pro.json"; diff --git a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TimelineApiTest.java b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TimelineApiTest.java index 4681c65f3..581530e52 100644 --- a/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TimelineApiTest.java +++ b/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/TimelineApiTest.java @@ -39,7 +39,6 @@ import com.badlogic.gdx.utils.ScreenUtils; import com.esotericsoftware.spine.Animation.MixBlend; import com.esotericsoftware.spine.Animation.MixDirection; -import com.esotericsoftware.spine.Skeleton.Physics; /** Demonstrates using the timeline API. See {@link SimpleTest1} for a higher level API using {@link AnimationState}. *
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 647d63e7c..15418d4ce 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java
@@ -560,10 +560,10 @@ public class Animation {
public void apply (Skeleton skeleton, float lastTime, float time, @Null Array
* A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
* local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
* constraint or application code modifies the world transform after it was computed from the local transform. */
-public class Bone extends BonePose {
+public class Bone {
final BoneData data;
final Skeleton skeleton;
@Null final Bone parent;
- final Array
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 0f1a70230..8d5b1e8fd 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BonePose.java
@@ -31,11 +31,7 @@ package com.esotericsoftware.spine;
import com.esotericsoftware.spine.BoneData.Inherit;
-/** Stores a bone's current pose.
- *
- * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
- * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
- * constraint or application code modifies the world transform after it was computed from the local transform. */
+/** Stores a bone's local pose. */
public class BonePose {
float x, y, rotation, scaleX, scaleY, shearX, shearY;
Inherit inherit;
@@ -43,8 +39,8 @@ public class BonePose {
BonePose () {
}
- /** Copy constructor. */
- public BonePose (BonePose bone) {
+ public void set (BonePose bone) {
+ if (bone == null) throw new IllegalArgumentException("bone cannot be null.");
x = bone.x;
y = bone.y;
rotation = bone.rotation;
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java
index fd9a293aa..a0d99caa3 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java
@@ -29,8 +29,6 @@
package com.esotericsoftware.spine;
-import com.esotericsoftware.spine.Skeleton.Physics;
-
/** The base class for all constraint datas. */
abstract public class ConstraintData {
final String name;
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 33ecfa55a..a53c35c6e 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java
@@ -34,7 +34,6 @@ import static com.esotericsoftware.spine.utils.SpineUtils.*;
import com.badlogic.gdx.utils.Array;
import com.esotericsoftware.spine.BoneData.Inherit;
-import com.esotericsoftware.spine.Skeleton.Physics;
/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of
* the last bone is as close to the target bone as possible.
@@ -70,16 +69,16 @@ public class IkConstraint implements Updatable {
applied = new IkConstraint(data, bones, target);
- setToSetupPose();
+ setupPose();
}
/** Copy constructor. */
public IkConstraint (IkConstraint constraint, Skeleton skeleton) {
this(constraint.data, skeleton);
- setToSetupPose();
+ setupPose();
}
- public void setToSetupPose () {
+ public void setupPose () {
IkConstraintData data = this.data;
mix = data.mix;
softness = data.softness;
@@ -168,7 +167,7 @@ public class IkConstraint implements Updatable {
}
/** Returns false when this constraint won't be updated by
- * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Skeleton.Physics)} because a skin is required and the
+ * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Physics)} because a skin is required and the
* {@link Skeleton#getSkin() active skin} does not contain this item.
* @see Skin#getBones()
* @see Skin#getConstraints()
@@ -196,12 +195,12 @@ public class IkConstraint implements Updatable {
float rotationIK = -bone.shearX - bone.rotation, tx, ty;
switch (bone.inherit) {
case onlyTranslation:
- tx = (targetX - bone.worldX) * Math.signum(bone.pose.skeleton.scaleX);
- ty = (targetY - bone.worldY) * Math.signum(bone.pose.skeleton.scaleY);
+ tx = (targetX - bone.worldX) * Math.signum(bone.bone.skeleton.scaleX);
+ ty = (targetY - bone.worldY) * Math.signum(bone.bone.skeleton.scaleY);
break;
case noRotationOrReflection:
float s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001f, pa * pa + pc * pc);
- Skeleton skeleton = bone.pose.skeleton;
+ Skeleton skeleton = bone.bone.skeleton;
float sa = pa / skeleton.scaleX;
float sc = pc / skeleton.scaleY;
pb = -sc * s * skeleton.scaleX;
@@ -233,7 +232,7 @@ public class IkConstraint implements Updatable {
ty = targetY - bone.worldY;
}
}
- float b = bone.pose.data.length * bone.scaleX;
+ float b = bone.bone.data.length * bone.scaleX;
if (b > 0.0001f) {
float dd = tx * tx + ty * ty;
if ((compress && dd < b * b) || (stretch && dd > b * b)) {
@@ -290,7 +289,7 @@ public class IkConstraint implements Updatable {
float id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY;
id = Math.abs(id) <= 0.0001f ? 0 : 1 / id;
float dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;
- float l1 = (float)Math.sqrt(dx * dx + dy * dy), l2 = child.pose.data.length * csx, a1, a2;
+ float l1 = (float)Math.sqrt(dx * dx + dy * dy), l2 = child.bone.data.length * csx, a1, a2;
if (l1 < 0.0001f) {
apply(parent, targetX, targetY, false, stretch, false, alpha);
child.rotation = 0;
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 2a3f399e1..cd6dc4239 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java
@@ -35,12 +35,10 @@ import java.util.Arrays;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.FloatArray;
-import com.badlogic.gdx.utils.Null;
import com.esotericsoftware.spine.PathConstraintData.PositionMode;
import com.esotericsoftware.spine.PathConstraintData.RotateMode;
import com.esotericsoftware.spine.PathConstraintData.SpacingMode;
-import com.esotericsoftware.spine.Skeleton.Physics;
import com.esotericsoftware.spine.attachments.PathAttachment;
/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the
@@ -82,16 +80,16 @@ public class PathConstraint implements Updatable {
applied = new PathConstraint(data, bones, slot);
- setToSetupPose();
+ setupPose();
}
/** Copy constructor. */
public PathConstraint (PathConstraint constraint, Skeleton skeleton) {
this(constraint.data, skeleton);
- setToSetupPose();
+ setupPose();
}
- public void setToSetupPose () {
+ public void setupPose () {
PathConstraintData data = this.data;
position = data.position;
spacing = data.spacing;
@@ -102,7 +100,7 @@ public class PathConstraint implements Updatable {
/** Applies the constraint to the constrained bones. */
public void update (Physics physics) {
- if (!(slot.attachment instanceof PathAttachment pathAttachment)) return;
+ if (!(slot.applied.attachment instanceof PathAttachment pathAttachment)) return;
float mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;
if (mixRotate == 0 && mixX == 0 && mixY == 0) return;
@@ -119,7 +117,7 @@ public class PathConstraint implements Updatable {
if (scale) {
for (int i = 0, n = spacesCount - 1; i < n; i++) {
var bone = (BoneApplied)bones[i];
- float setupLength = bone.pose.data.length;
+ float setupLength = bone.bone.data.length;
float x = setupLength * bone.a, y = setupLength * bone.c;
lengths[i] = (float)Math.sqrt(x * x + y * y);
}
@@ -130,7 +128,7 @@ public class PathConstraint implements Updatable {
float sum = 0;
for (int i = 0, n = spacesCount - 1; i < n;) {
var bone = (BoneApplied)bones[i];
- float setupLength = bone.pose.data.length;
+ float setupLength = bone.bone.data.length;
if (setupLength < epsilon) {
if (scale) lengths[i] = 0;
spaces[++i] = spacing;
@@ -152,7 +150,7 @@ public class PathConstraint implements Updatable {
boolean lengthSpacing = data.spacingMode == SpacingMode.length;
for (int i = 0, n = spacesCount - 1; i < n;) {
var bone = (BoneApplied)bones[i];
- float setupLength = bone.pose.data.length;
+ float setupLength = bone.bone.data.length;
if (setupLength < epsilon) {
if (scale) lengths[i] = 0;
spaces[++i] = spacing;
@@ -203,7 +201,7 @@ public class PathConstraint implements Updatable {
if (tip) {
cos = cos(r);
sin = sin(r);
- float length = bone.pose.data.length;
+ float length = bone.bone.data.length;
boneX += (length * (cos * a - sin * c) - dx) * mixRotate;
boneY += (length * (sin * a + cos * c) - dy) * mixRotate;
} else
@@ -543,7 +541,7 @@ public class PathConstraint implements Updatable {
}
/** Returns false when this constraint won't be updated by
- * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Skeleton.Physics)} because a skin is required and the
+ * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Physics)} because a skin is required and the
* {@link Skeleton#getSkin() active skin} does not contain this item.
* @see Skin#getBones()
* @see Skin#getConstraints()
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Physics.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Physics.java
new file mode 100644
index 000000000..7759e888d
--- /dev/null
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Physics.java
@@ -0,0 +1,17 @@
+
+package com.esotericsoftware.spine;
+
+/** Determines how physics and other non-deterministic updates are applied. */
+public enum Physics {
+ /** Physics are not updated or applied. */
+ none,
+
+ /** Physics are reset to the current pose. */
+ reset,
+
+ /** Physics are updated and the pose from physics is applied. */
+ update,
+
+ /** Physics are not updated but the pose from physics is applied. */
+ pose
+}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java
index 6eef08afd..09a0ebcd5 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java
@@ -31,8 +31,6 @@ package com.esotericsoftware.spine;
import static com.esotericsoftware.spine.utils.SpineUtils.*;
-import com.esotericsoftware.spine.Skeleton.Physics;
-
/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones.
*
* See Physics constraints in the Spine User Guide. */
@@ -69,13 +67,13 @@ public class PhysicsConstraint implements Updatable {
applied = new PhysicsConstraint(data, skeleton, bone);
- setToSetupPose();
+ setupPose();
}
/** Copy constructor. */
public PhysicsConstraint (PhysicsConstraint constraint, Skeleton skeleton) {
this(constraint.data, skeleton);
- setToSetupPose();
+ setupPose();
}
public void reset () {
@@ -92,7 +90,7 @@ public class PhysicsConstraint implements Updatable {
scaleVelocity = 0;
}
- public void setToSetupPose () {
+ public void setupPose () {
PhysicsConstraintData data = this.data;
inertia = data.inertia;
strength = data.strength;
@@ -127,7 +125,7 @@ public class PhysicsConstraint implements Updatable {
boolean x = data.x > 0, y = data.y > 0, rotateOrShearX = data.rotate > 0 || data.shearX > 0, scaleX = data.scaleX > 0;
BoneApplied bone = this.bone;
- float l = bone.pose.data.length;
+ float l = bone.bone.data.length;
switch (physics) {
case none:
@@ -352,7 +350,7 @@ public class PhysicsConstraint implements Updatable {
}
/** Returns false when this constraint won't be updated by
- * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Skeleton.Physics)} because a skin is required and the
+ * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Physics)} because a skin is required and the
* {@link Skeleton#getSkin() active skin} does not contain this item.
* @see Skin#getBones()
* @see Skin#getConstraints()
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 462f78649..13d7e39cb 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java
@@ -273,20 +273,20 @@ public class Skeleton {
}
private void sortIkConstraint (IkConstraint constraint) {
- constraint.active = constraint.target.pose.active
+ constraint.active = constraint.target.bone.active
&& (!constraint.data.skinRequired || (skin != null && skin.constraints.contains(constraint.data, true)));
if (!constraint.active) return;
- sortBone(constraint.target.pose);
+ sortBone(constraint.target.bone);
Array
* After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
- * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply(Skeleton)} is called before the next time the
- * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new
- * skin. */
+ * {@link #setupPoseSlots()}. Also, often {@link AnimationState#apply(Skeleton)} is called before the next time the skeleton is
+ * rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. */
public void setSkin (@Null Skin newSkin) {
if (newSkin == skin) return;
if (newSkin != null) {
@@ -629,7 +605,7 @@ public class Skeleton {
String name = slot.data.attachmentName;
if (name != null) {
Attachment attachment = newSkin.getAttachment(i, name);
- if (attachment != null) slot.setAttachment(attachment);
+ if (attachment != null) slot.pose.setAttachment(attachment);
}
}
}
@@ -663,7 +639,7 @@ public class Skeleton {
}
/** A convenience method to set an attachment by finding the slot with {@link #findSlot(String)}, finding the attachment with
- * {@link #getAttachment(int, String)}, then setting the slot's {@link Slot#attachment}.
+ * {@link #getAttachment(int, String)}, then setting the slot's {@link SlotPose#attachment}.
* @param attachmentName May be null to clear the slot's attachment. */
public void setAttachment (String slotName, @Null String attachmentName) {
if (slotName == null) throw new IllegalArgumentException("slotName cannot be null.");
@@ -675,7 +651,7 @@ public class Skeleton {
if (attachment == null)
throw new IllegalArgumentException("Attachment not found: " + attachmentName + ", for slot: " + slotName);
}
- slot.setAttachment(attachment);
+ slot.pose.setAttachment(attachment);
}
/** The skeleton's sliders. */
@@ -789,7 +765,7 @@ public class Skeleton {
int verticesLength = 0;
float[] vertices = null;
short[] triangles = null;
- Attachment attachment = slot.attachment;
+ Attachment attachment = slot.pose.attachment;
if (attachment instanceof RegionAttachment region) {
verticesLength = 8;
vertices = temp.setSize(8);
@@ -933,19 +909,4 @@ public class Skeleton {
public String toString () {
return data.name != null ? data.name : super.toString();
}
-
- /** Determines how physics and other non-deterministic updates are applied. */
- static public enum Physics {
- /** Physics are not updated or applied. */
- none,
-
- /** Physics are reset to the current pose. */
- reset,
-
- /** Physics are updated and the pose from physics is applied. */
- update,
-
- /** Physics are not updated but the pose from physics is applied. */
- pose
- }
}
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 5a6bf6794..c382b3cb0 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++) {
var slot = (Slot)slots[i];
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
+ Attachment attachment = slot.applied.attachment;
if (attachment instanceof BoundingBoxAttachment boundingBox) {
boundingBoxes.add(boundingBox);
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 c0bab40fd..8dd6eacd8 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java
@@ -80,10 +80,11 @@ public class SkeletonRenderer {
for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) {
var slot = (Slot)drawOrder[i];
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
+ SlotPose pose = slot.getAppliedPose();
+ Attachment attachment = pose.attachment;
if (attachment instanceof RegionAttachment region) {
region.computeWorldVertices(slot, vertices, 0, 5);
- Color color = region.getColor(), slotColor = slot.getColor();
+ Color color = region.getColor(), slotColor = pose.getColor();
float alpha = a * slotColor.a * color.a * 255;
float multiplier = pmaColors ? alpha : 255;
@@ -148,8 +149,9 @@ public class SkeletonRenderer {
clipper.clipEnd(slot);
continue;
}
+ SlotPose pose = slot.getAppliedPose();
Texture texture = null;
- Attachment attachment = slot.attachment;
+ Attachment attachment = pose.attachment;
if (attachment instanceof RegionAttachment region) {
verticesLength = 20;
vertices = this.vertices.items;
@@ -179,7 +181,7 @@ public class SkeletonRenderer {
}
if (texture != null) {
- Color slotColor = slot.getColor();
+ Color slotColor = pose.getColor();
float alpha = a * slotColor.a * color.a * 255;
float multiplier = pmaColors ? alpha : 255;
@@ -242,8 +244,9 @@ public class SkeletonRenderer {
clipper.clipEnd(slot);
continue;
}
+ SlotPose pose = slot.getAppliedPose();
Texture texture = null;
- Attachment attachment = slot.attachment;
+ Attachment attachment = pose.attachment;
if (attachment instanceof RegionAttachment region) {
verticesLength = 24;
vertices = this.vertices.items;
@@ -273,7 +276,7 @@ public class SkeletonRenderer {
}
if (texture != null) {
- Color lightColor = slot.getColor();
+ Color lightColor = pose.getColor();
float alpha = a * lightColor.a * color.a * 255;
float multiplier = pmaColors ? alpha : 255;
@@ -294,7 +297,7 @@ public class SkeletonRenderer {
| (int)(blue * lightColor.b) << 16 //
| (int)(green * lightColor.g) << 8 //
| (int)(red * lightColor.r));
- Color darkColor = slot.getDarkColor();
+ Color darkColor = pose.getDarkColor();
float dark = darkColor == null ? 0
: NumberUtils.intToFloatColor((int)(blue * darkColor.b) << 16 //
| (int)(green * darkColor.g) << 8 //
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 28c6380d8..5b345a9e2 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRendererDebug.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRendererDebug.java
@@ -38,7 +38,6 @@ import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.FloatArray;
-import com.esotericsoftware.spine.attachments.Attachment;
import com.esotericsoftware.spine.attachments.BoundingBoxAttachment;
import com.esotericsoftware.spine.attachments.ClippingAttachment;
import com.esotericsoftware.spine.attachments.MeshAttachment;
@@ -109,8 +108,7 @@ public class SkeletonRendererDebug {
for (int i = 0, n = slots.size; i < n; i++) {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
- if (!(attachment instanceof PointAttachment point)) 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));
shapes.rectLine(temp1, temp2, boneWidth / 2 * scale);
@@ -125,8 +123,7 @@ public class SkeletonRendererDebug {
for (int i = 0, n = slots.size; i < n; i++) {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
- if (attachment instanceof RegionAttachment region) {
+ if (slot.pose.attachment instanceof RegionAttachment region) {
float[] vertices = this.vertices.items;
region.computeWorldVertices(slot, vertices, 0, 2);
shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);
@@ -141,8 +138,7 @@ public class SkeletonRendererDebug {
for (int i = 0, n = slots.size; i < n; i++) {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
- if (!(attachment instanceof MeshAttachment mesh)) continue;
+ if (!(slot.pose.attachment instanceof MeshAttachment mesh)) continue;
float[] vertices = this.vertices.setSize(mesh.getWorldVerticesLength());
mesh.computeWorldVertices(slot, 0, mesh.getWorldVerticesLength(), vertices, 0, 2);
short[] triangles = mesh.getTriangles();
@@ -188,8 +184,7 @@ public class SkeletonRendererDebug {
for (int i = 0, n = slots.size; i < n; i++) {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
- if (!(attachment instanceof ClippingAttachment clip)) continue;
+ if (!(slot.pose.attachment instanceof ClippingAttachment clip)) continue;
int nn = clip.getWorldVerticesLength();
float[] vertices = this.vertices.setSize(nn);
clip.computeWorldVertices(slot, 0, nn, vertices, 0, 2);
@@ -204,8 +199,7 @@ public class SkeletonRendererDebug {
for (int i = 0, n = slots.size; i < n; i++) {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
- if (!(attachment instanceof PathAttachment path)) continue;
+ if (!(slot.pose.attachment instanceof PathAttachment path)) continue;
int nn = path.getWorldVerticesLength();
float[] vertices = this.vertices.setSize(nn);
path.computeWorldVertices(slot, 0, nn, vertices, 0, 2);
@@ -254,15 +248,13 @@ public class SkeletonRendererDebug {
for (int i = 0, n = slots.size; i < n; i++) {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
- Attachment attachment = slot.attachment;
- if (!(attachment instanceof PointAttachment point)) continue;
+ if (!(slot.pose.attachment instanceof PointAttachment point)) continue;
point.computeWorldPosition(slot.bone.applied, temp1);
shapes.circle(temp1.x, temp1.y, 3 * scale, 8);
}
}
shapes.end();
-
}
public ShapeRenderer getShapeRenderer () {
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java
index 8a62a01ed..e49c80c95 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java
@@ -157,7 +157,7 @@ public class Skin {
Object[] slots = skeleton.slots.items;
for (SkinEntry entry : oldSkin.attachments.orderedItems()) {
int slotIndex = entry.slotIndex;
- var slot = (Slot)slots[slotIndex];
+ SlotPose slot = ((Slot)slots[slotIndex]).getPose();
if (slot.attachment == entry.attachment) {
Attachment attachment = getAttachment(slotIndex, entry.name);
if (attachment != null) slot.setAttachment(attachment);
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 be1eb3a58..f1912ab49 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slider.java
@@ -31,7 +31,6 @@ package com.esotericsoftware.spine;
import com.esotericsoftware.spine.Animation.MixBlend;
import com.esotericsoftware.spine.Animation.MixDirection;
-import com.esotericsoftware.spine.Skeleton.Physics;
/** Stores the setup pose for a {@link PhysicsConstraint}.
*
@@ -50,20 +49,20 @@ public class Slider implements Updatable {
this.data = data;
this.skeleton = skeleton;
- setToSetupPose();
+ setupPose();
}
/** Copy constructor. */
public Slider (Slider slider, Skeleton skeleton) {
this(slider.data, skeleton);
- setToSetupPose();
+ setupPose();
}
public void update (Physics physics) {
animation.apply(skeleton, time, time, false, null, mix, MixBlend.replace, MixDirection.in, true);
}
- public void setToSetupPose () {
+ public void setupPose () {
SliderData data = this.data;
animation = data.animation;
time = data.time;
@@ -71,7 +70,7 @@ public class Slider implements Updatable {
}
/** Returns false when this constraint won't be updated by
- * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Skeleton.Physics)} because a skin is required and the
+ * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Physics)} because a skin is required and the
* {@link Skeleton#getSkin() active skin} does not contain this item.
* @see Skin#getBones()
* @see Skin#getConstraints()
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 bc13a3065..46dbd4931 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java
@@ -30,13 +30,6 @@
package com.esotericsoftware.spine;
import com.badlogic.gdx.graphics.Color;
-import com.badlogic.gdx.utils.FloatArray;
-import com.badlogic.gdx.utils.Null;
-
-import com.esotericsoftware.spine.Animation.DeformTimeline;
-import com.esotericsoftware.spine.attachments.Attachment;
-import com.esotericsoftware.spine.attachments.Sequence;
-import com.esotericsoftware.spine.attachments.VertexAttachment;
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
@@ -44,35 +37,19 @@ import com.esotericsoftware.spine.attachments.VertexAttachment;
public class Slot {
final SlotData data;
final Bone bone;
- Slot applied;
-
- final Color color = new Color();
- @Null final Color darkColor;
- @Null Attachment attachment;
- int sequenceIndex;
- FloatArray deform;
-
+ final SlotPose pose = new SlotPose(), applied = new SlotPose();
int attachmentState;
- private Slot (SlotData data, Bone bone) {
- this.data = data;
- this.bone = bone;
-
- darkColor = data.darkColor == null ? null : new Color();
- }
-
public Slot (SlotData data, Skeleton skeleton) {
- if (data == null) throw new IllegalArgumentException("data cannot be null.");
+ if (data == null) throw new IllegalArgumentException("slot cannot be null.");
if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null.");
this.data = data;
- this.bone = skeleton.bones.get(data.boneData.index);
-
- darkColor = data.darkColor == null ? null : new Color();
- deform = new FloatArray();
-
- applied = new Slot(data, bone);
-
- setToSetupPose();
+ bone = skeleton.bones.get(data.boneData.index);
+ if (data.darkColor != null) {
+ pose.darkColor = new Color();
+ applied.darkColor = new Color();
+ }
+ setupPose();
}
/** Copy constructor. */
@@ -81,11 +58,17 @@ public class Slot {
if (bone == null) throw new IllegalArgumentException("bone cannot be null.");
data = slot.data;
this.bone = bone;
- color.set(slot.color);
- darkColor = slot.darkColor == null ? null : new Color(slot.darkColor);
- attachment = slot.attachment;
- sequenceIndex = slot.sequenceIndex;
- deform = new FloatArray(slot.deform);
+ if (data.darkColor != null) {
+ pose.darkColor = new Color();
+ applied.darkColor = new Color();
+ }
+ pose.set(slot.pose);
+ }
+
+ /** Sets this slot to the setup pose. */
+ public void setupPose () {
+ pose.set(data);
+ if (data.attachmentName != null) pose.setAttachment(bone.skeleton.getAttachment(data.index, data.attachmentName));
}
/** The slot's setup pose data. */
@@ -93,6 +76,16 @@ public class Slot {
return data;
}
+ /** Returns the slot's pose. */
+ public SlotPose getPose () {
+ return pose;
+ }
+
+ /** Returns the slot's applied pose. */
+ public SlotPose getAppliedPose () {
+ return applied;
+ }
+
/** The bone this slot belongs to. */
public Bone getBone () {
return bone;
@@ -103,76 +96,6 @@ public class Slot {
return bone.skeleton;
}
- /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
- * color tinting. */
- public Color getColor () {
- return color;
- }
-
- /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
- * color's alpha is not used. */
- public @Null Color getDarkColor () {
- return darkColor;
- }
-
- /** The current attachment for the slot, or null if the slot has no attachment. */
- public @Null Attachment getAttachment () {
- return attachment;
- }
-
- /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
- * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
- * specified attachment. */
- public void setAttachment (@Null Attachment attachment) {
- if (this.attachment == attachment) return;
- if (!(attachment instanceof VertexAttachment newAttachment) || !(this.attachment instanceof VertexAttachment oldAttachment)
- || newAttachment.getTimelineAttachment() != oldAttachment.getTimelineAttachment()) {
- deform.clear();
- }
- this.attachment = attachment;
- sequenceIndex = -1;
- }
-
- /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the
- * {@link Sequence#getSetupIndex()}. */
- public int getSequenceIndex () {
- return sequenceIndex;
- }
-
- public void setSequenceIndex (int sequenceIndex) {
- this.sequenceIndex = sequenceIndex;
- }
-
- /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
- * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
- *
- * See {@link VertexAttachment#computeWorldVertices(Slot, int, int, float[], int, int)} and {@link DeformTimeline}. */
- public FloatArray getDeform () {
- return deform;
- }
-
- public void setDeform (FloatArray deform) {
- if (deform == null) throw new IllegalArgumentException("deform cannot be null.");
- this.deform = deform;
- }
-
- /** Sets this slot to the setup pose. */
- public void setToSetupPose () {
- color.set(data.color);
- if (darkColor != null) darkColor.set(data.darkColor);
- if (data.attachmentName == null)
- setAttachment(null);
- else {
- attachment = null;
- setAttachment(bone.skeleton.getAttachment(data.index, data.attachmentName));
- }
- }
-
- /** Returns the bone for applied pose. */
- public Slot getApplied () {
- return applied;
- }
-
public String toString () {
return data.name;
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java
index e21752e0d..c7707e19a 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java
@@ -33,12 +33,10 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Null;
/** Stores the setup pose for a {@link Slot}. */
-public class SlotData {
+public class SlotData extends SlotPose {
final int index;
final String name;
final BoneData boneData;
- final Color color = new Color(1, 1, 1, 1);
- @Null Color darkColor;
@Null String attachmentName;
BlendMode blendMode;
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java
new file mode 100644
index 000000000..ab4264c82
--- /dev/null
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotPose.java
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * Spine Runtimes License Agreement
+ * Last updated April 5, 2025. Replaces all prior versions.
+ *
+ * Copyright (c) 2013-2025, Esoteric Software LLC
+ *
+ * Integration of the Spine Runtimes into software or otherwise creating
+ * derivative works of the Spine Runtimes is permitted under the terms and
+ * conditions of Section 2 of the Spine Editor License Agreement:
+ * http://esotericsoftware.com/spine-editor-license
+ *
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
+ * "Products"), provided that each user of the Products must obtain their own
+ * Spine Editor license and redistribution of the Products in any form must
+ * include this license and copyright notice.
+ *
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package com.esotericsoftware.spine;
+
+import com.badlogic.gdx.graphics.Color;
+import com.badlogic.gdx.utils.FloatArray;
+import com.badlogic.gdx.utils.Null;
+
+import com.esotericsoftware.spine.Animation.DeformTimeline;
+import com.esotericsoftware.spine.attachments.Attachment;
+import com.esotericsoftware.spine.attachments.Sequence;
+import com.esotericsoftware.spine.attachments.VertexAttachment;
+
+/** Stores a slot's pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store state
+ * for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared across
+ * multiple skeletons. */
+public class SlotPose {
+ final Color color = new Color();
+ @Null Color darkColor;
+ @Null Attachment attachment;
+ int sequenceIndex;
+ final FloatArray deform = new FloatArray(0);
+
+ SlotPose () {
+ }
+
+ public void set (SlotPose slot) {
+ if (slot == null) throw new IllegalArgumentException("slot cannot be null.");
+ color.set(slot.color);
+ if (slot.darkColor != null) darkColor.set(slot.darkColor);
+ attachment = slot.attachment;
+ sequenceIndex = slot.sequenceIndex;
+ deform.size = 0;
+ deform.addAll(slot.deform);
+ }
+
+ /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
+ * color tinting. */
+ public Color getColor () {
+ return color;
+ }
+
+ /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
+ * color's alpha is not used. */
+ public @Null Color getDarkColor () {
+ return darkColor;
+ }
+
+ /** The current attachment for the slot, or null if the slot has no attachment. */
+ public @Null Attachment getAttachment () {
+ return attachment;
+ }
+
+ /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.
+ * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the
+ * specified attachment. */
+ public void setAttachment (@Null Attachment attachment) {
+ if (this.attachment == attachment) return;
+ if (!(attachment instanceof VertexAttachment newAttachment) || !(this.attachment instanceof VertexAttachment oldAttachment)
+ || newAttachment.getTimelineAttachment() != oldAttachment.getTimelineAttachment()) {
+ deform.clear();
+ }
+ this.attachment = attachment;
+ sequenceIndex = -1;
+ }
+
+ /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the
+ * {@link Sequence#getSetupIndex()}. */
+ public int getSequenceIndex () {
+ return sequenceIndex;
+ }
+
+ public void setSequenceIndex (int sequenceIndex) {
+ this.sequenceIndex = sequenceIndex;
+ }
+
+ /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
+ * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
+ *
+ * See {@link VertexAttachment#computeWorldVertices(Slot, int, int, float[], int, int)} and {@link DeformTimeline}. */
+ public FloatArray getDeform () {
+ return deform;
+ }
+}
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 daf1e921f..813eb1688 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java
@@ -32,9 +32,7 @@ package com.esotericsoftware.spine;
import static com.badlogic.gdx.math.MathUtils.*;
import com.badlogic.gdx.utils.Array;
-import com.badlogic.gdx.utils.Null;
-import com.esotericsoftware.spine.Skeleton.Physics;
import com.esotericsoftware.spine.TransformConstraintData.FromProperty;
import com.esotericsoftware.spine.TransformConstraintData.ToProperty;
@@ -70,16 +68,16 @@ public class TransformConstraint implements Updatable {
applied = new TransformConstraint(data, bones, source);
- setToSetupPose();
+ setupPose();
}
/** Copy constructor. */
public TransformConstraint (TransformConstraint constraint, Skeleton skeleton) {
this(constraint.data, skeleton);
- setToSetupPose();
+ setupPose();
}
- public void setToSetupPose () {
+ public void setupPose () {
TransformConstraintData data = this.data;
mixRotate = data.mixRotate;
mixX = data.mixX;
@@ -196,7 +194,7 @@ public class TransformConstraint implements Updatable {
}
/** Returns false when this constraint won't be updated by
- * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Skeleton.Physics)} because a skin is required and the
+ * {@link Skeleton#updateWorldTransform(com.esotericsoftware.spine.Physics)} because a skin is required and the
* {@link Skeleton#getSkin() active skin} does not contain this item.
* @see Skin#getBones()
* @see Skin#getConstraints()
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Updatable.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Updatable.java
index a1e9a584a..0864002f2 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Updatable.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Updatable.java
@@ -29,8 +29,6 @@
package com.esotericsoftware.spine;
-import com.esotericsoftware.spine.Skeleton.Physics;
-
/** The interface for items updated by {@link Skeleton#updateWorldTransform(Physics)}. */
public interface Updatable {
/** @param physics Determines how physics and other non-deterministic updates are applied. */
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 49ebc5b16..dda206ff0 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
@@ -165,7 +165,7 @@ public class MeshAttachment extends VertexAttachment implements HasTextureRegion
/** If the attachment has a {@link #sequence}, the region may be changed. */
public void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride) {
- if (sequence != null) sequence.apply(slot, this);
+ if (sequence != null) sequence.apply(slot.getAppliedPose(), this);
super.computeWorldVertices(slot, start, count, worldVertices, offset, stride);
}
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 bb0636fc6..6bf813813 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
@@ -36,7 +36,6 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.utils.Null;
-import com.esotericsoftware.spine.BonePose;
import com.esotericsoftware.spine.BoneApplied;
import com.esotericsoftware.spine.Slot;
@@ -177,10 +176,10 @@ public class RegionAttachment extends Attachment implements HasTextureRegion {
* @param offset The
* See World transforms in the Spine
* Runtimes Guide.
@@ -88,12 +88,12 @@ abstract public class VertexAttachment extends Attachment {
* @param stride The number of worldVertices index to begin writing values.
* @param stride The number of worldVertices entries between the value pairs written. */
public void computeWorldVertices (Slot slot, float[] worldVertices, int offset, int stride) {
- if (sequence != null) sequence.apply(slot, this);
+ if (sequence != null) sequence.apply(slot.getAppliedPose(), this);
float[] vertexOffset = this.offset;
- BoneApplied bone = slot.getBone().getApplied();
+ BoneApplied bone = slot.getBone().getAppliedPose();
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/Sequence.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java
index e82f9429f..ba9db38b5 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Sequence.java
@@ -33,7 +33,7 @@ import static com.esotericsoftware.spine.utils.SpineUtils.*;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
-import com.esotericsoftware.spine.Slot;
+import com.esotericsoftware.spine.SlotPose;
public class Sequence {
static private int nextID;
@@ -56,7 +56,7 @@ public class Sequence {
setupIndex = other.setupIndex;
}
- public void apply (Slot slot, HasTextureRegion attachment) {
+ public void apply (SlotPose slot, HasTextureRegion attachment) {
int index = slot.getSequenceIndex();
if (index == -1) index = setupIndex;
if (index >= regions.length) index = regions.length - 1;
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 1560b9b9e..1789cf1ca 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
@@ -34,14 +34,14 @@ import static com.esotericsoftware.spine.utils.SpineUtils.*;
import com.badlogic.gdx.utils.FloatArray;
import com.badlogic.gdx.utils.Null;
-import com.esotericsoftware.spine.BonePose;
-import com.esotericsoftware.spine.BoneApplied;
import com.esotericsoftware.spine.Bone;
+import com.esotericsoftware.spine.BoneApplied;
import com.esotericsoftware.spine.Skeleton;
import com.esotericsoftware.spine.Slot;
+import com.esotericsoftware.spine.SlotPose;
/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
- * {@link Slot#getDeform()}. */
+ * {@link SlotPose#getDeform()}. */
abstract public class VertexAttachment extends Attachment {
static private int nextID;
@@ -75,8 +75,8 @@ abstract public class VertexAttachment extends Attachment {
worldVerticesLength = other.worldVerticesLength;
}
- /** Transforms the attachment's local {@link #getVertices()} to world coordinates. If the slot's {@link Slot#getDeform()} is
- * not empty, it is used to deform the vertices.
+ /** Transforms the attachment's local {@link #getVertices()} to world coordinates. If the slot's {@link SlotPose#getDeform()}
+ * is not empty, it is used to deform the vertices.
* worldVertices entries between the value pairs written. */
public void computeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride) {
count = offset + (count >> 1) * stride;
- FloatArray deformArray = slot.getDeform();
+ FloatArray deformArray = slot.getAppliedPose().getDeform();
float[] vertices = this.vertices;
int[] bones = this.bones;
if (bones == null) {
if (deformArray.size > 0) vertices = deformArray.items;
- BoneApplied bone = slot.getBone().getApplied();
+ BoneApplied bone = slot.getBone().getAppliedPose();
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 += stride) {
@@ -116,7 +116,7 @@ abstract public class VertexAttachment extends Attachment {
int n = bones[v++];
n += v;
for (; v < n; v++, b += 3) {
- BoneApplied bone = ((Bone)skeletonBones[bones[v]]).getApplied();
+ BoneApplied bone = ((Bone)skeletonBones[bones[v]]).getAppliedPose();
float vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];
wx += (vx * bone.getA() + vy * bone.getB() + bone.getWorldX()) * weight;
wy += (vx * bone.getC() + vy * bone.getD() + bone.getWorldY()) * weight;
@@ -131,7 +131,7 @@ abstract public class VertexAttachment extends Attachment {
int n = bones[v++];
n += v;
for (; v < n; v++, b += 3, f += 2) {
- BoneApplied bone = ((Bone)skeletonBones[bones[v]]).getApplied();
+ BoneApplied bone = ((Bone)skeletonBones[bones[v]]).getAppliedPose();
float vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];
wx += (vx * bone.getA() + vy * bone.getB() + bone.getWorldX()) * weight;
wy += (vx * bone.getC() + vy * bone.getD() + bone.getWorldY()) * weight;
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActor.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActor.java
index 5842c4ac2..21006907b 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActor.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActor.java
@@ -34,8 +34,8 @@ import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.esotericsoftware.spine.AnimationState;
+import com.esotericsoftware.spine.Physics;
import com.esotericsoftware.spine.Skeleton;
-import com.esotericsoftware.spine.Skeleton.Physics;
import com.esotericsoftware.spine.SkeletonRenderer;
/** A scene2d actor that draws a skeleton. */
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActorPool.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActorPool.java
index b250f7570..8c98d0ba2 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActorPool.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActorPool.java
@@ -73,7 +73,7 @@ public class SkeletonActorPool extends Pool