[libgdx] Constraint clean up.

This commit is contained in:
Nathan Sweet 2025-04-06 00:30:39 -04:00
parent f08d58dc98
commit 66435fea9e
4 changed files with 8 additions and 50 deletions

View File

@ -61,22 +61,13 @@ public class IkConstraint implements Updatable {
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. */
public IkConstraint (IkConstraint constraint, Skeleton skeleton) {
this(constraint.data, skeleton);
mix = constraint.mix;
softness = constraint.softness;
bendDirection = constraint.bendDirection;
compress = constraint.compress;
stretch = constraint.stretch;
setToSetupPose();
}
public void setToSetupPose () {

View File

@ -72,22 +72,13 @@ public class PathConstraint implements Updatable {
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. */
public PathConstraint (PathConstraint constraint, Skeleton skeleton) {
this(constraint.data, skeleton);
position = constraint.position;
spacing = constraint.spacing;
mixRotate = constraint.mixRotate;
mixX = constraint.mixX;
mixY = constraint.mixY;
setToSetupPose();
}
public void setToSetupPose () {

View File

@ -61,26 +61,13 @@ public class PhysicsConstraint implements Updatable {
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. */
public PhysicsConstraint (PhysicsConstraint constraint, Skeleton 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 () {

View File

@ -62,24 +62,13 @@ public class TransformConstraint implements Updatable {
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. */
public TransformConstraint (TransformConstraint constraint, Skeleton 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 () {