Browse Source

[libgdx] Constraint clean up.

Nathan Sweet 5 months ago
parent
commit
66435fea9e

+ 2 - 11
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java

@@ -61,22 +61,13 @@ public class IkConstraint implements Updatable {
 
 
 		target = skeleton.bones.get(data.target.index);
 		target = skeleton.bones.get(data.target.index);
 
 
-		mix = data.mix;
-		softness = data.softness;
-		bendDirection = data.bendDirection;
-		compress = data.compress;
-		stretch = data.stretch;
+		setToSetupPose();
 	}
 	}
 
 
 	/** Copy constructor. */
 	/** Copy constructor. */
 	public IkConstraint (IkConstraint constraint, Skeleton skeleton) {
 	public IkConstraint (IkConstraint constraint, Skeleton skeleton) {
 		this(constraint.data, skeleton);
 		this(constraint.data, skeleton);
-
-		mix = constraint.mix;
-		softness = constraint.softness;
-		bendDirection = constraint.bendDirection;
-		compress = constraint.compress;
-		stretch = constraint.stretch;
+		setToSetupPose();
 	}
 	}
 
 
 	public void setToSetupPose () {
 	public void setToSetupPose () {

+ 2 - 11
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java

@@ -72,22 +72,13 @@ public class PathConstraint implements Updatable {
 
 
 		slot = skeleton.slots.get(data.slot.index);
 		slot = skeleton.slots.get(data.slot.index);
 
 
-		position = data.position;
-		spacing = data.spacing;
-		mixRotate = data.mixRotate;
-		mixX = data.mixX;
-		mixY = data.mixY;
+		setToSetupPose();
 	}
 	}
 
 
 	/** Copy constructor. */
 	/** Copy constructor. */
 	public PathConstraint (PathConstraint constraint, Skeleton skeleton) {
 	public PathConstraint (PathConstraint constraint, Skeleton skeleton) {
 		this(constraint.data, skeleton);
 		this(constraint.data, skeleton);
-
-		position = constraint.position;
-		spacing = constraint.spacing;
-		mixRotate = constraint.mixRotate;
-		mixX = constraint.mixX;
-		mixY = constraint.mixY;
+		setToSetupPose();
 	}
 	}
 
 
 	public void setToSetupPose () {
 	public void setToSetupPose () {

+ 2 - 15
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PhysicsConstraint.java

@@ -61,26 +61,13 @@ public class PhysicsConstraint implements Updatable {
 
 
 		bone = skeleton.bones.get(data.bone.index);
 		bone = skeleton.bones.get(data.bone.index);
 
 
-		inertia = data.inertia;
-		strength = data.strength;
-		damping = data.damping;
-		massInverse = data.massInverse;
-		wind = data.wind;
-		gravity = data.gravity;
-		mix = data.mix;
+		setToSetupPose();
 	}
 	}
 
 
 	/** Copy constructor. */
 	/** Copy constructor. */
 	public PhysicsConstraint (PhysicsConstraint constraint, Skeleton skeleton) {
 	public PhysicsConstraint (PhysicsConstraint constraint, Skeleton skeleton) {
 		this(constraint.data, skeleton);
 		this(constraint.data, skeleton);
-
-		inertia = constraint.inertia;
-		strength = constraint.strength;
-		damping = constraint.damping;
-		massInverse = constraint.massInverse;
-		wind = constraint.wind;
-		gravity = constraint.gravity;
-		mix = constraint.mix;
+		setToSetupPose();
 	}
 	}
 
 
 	public void reset () {
 	public void reset () {

+ 2 - 13
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java

@@ -62,24 +62,13 @@ public class TransformConstraint implements Updatable {
 
 
 		source = skeleton.bones.get(data.source.index);
 		source = skeleton.bones.get(data.source.index);
 
 
-		mixRotate = data.mixRotate;
-		mixX = data.mixX;
-		mixY = data.mixY;
-		mixScaleX = data.mixScaleX;
-		mixScaleY = data.mixScaleY;
-		mixShearY = data.mixShearY;
+		setToSetupPose();
 	}
 	}
 
 
 	/** Copy constructor. */
 	/** Copy constructor. */
 	public TransformConstraint (TransformConstraint constraint, Skeleton skeleton) {
 	public TransformConstraint (TransformConstraint constraint, Skeleton skeleton) {
 		this(constraint.data, skeleton);
 		this(constraint.data, skeleton);
-
-		mixRotate = constraint.mixRotate;
-		mixX = constraint.mixX;
-		mixY = constraint.mixY;
-		mixScaleX = constraint.mixScaleX;
-		mixScaleY = constraint.mixScaleY;
-		mixShearY = constraint.mixShearY;
+		setToSetupPose();
 	}
 	}
 
 
 	public void setToSetupPose () {
 	public void setToSetupPose () {