mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +08:00
[libgdx] Apply loader scale to IK constraint softness.
This commit is contained in:
parent
6850a019ec
commit
64695a2c80
@ -212,7 +212,7 @@ public class SkeletonBinary {
|
||||
bones[ii] = skeletonData.bones.get(input.readInt(true));
|
||||
data.target = skeletonData.bones.get(input.readInt(true));
|
||||
data.mix = input.readFloat();
|
||||
data.softness = input.readFloat();
|
||||
data.softness = input.readFloat() * scale;
|
||||
data.bendDirection = input.readByte();
|
||||
data.compress = input.readBoolean();
|
||||
data.stretch = input.readBoolean();
|
||||
@ -669,7 +669,7 @@ public class SkeletonBinary {
|
||||
IkConstraintTimeline timeline = new IkConstraintTimeline(frameCount);
|
||||
timeline.ikConstraintIndex = index;
|
||||
for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) {
|
||||
timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readByte(),
|
||||
timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat() * scale, input.readByte(),
|
||||
input.readBoolean(), input.readBoolean());
|
||||
if (frameIndex < frameCount - 1) readCurve(input, frameIndex, timeline);
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ public class SkeletonJson {
|
||||
if (data.target == null) throw new SerializationException("IK target bone not found: " + targetName);
|
||||
|
||||
data.mix = constraintMap.getFloat("mix", 1);
|
||||
data.softness = constraintMap.getFloat("softness", 0);
|
||||
data.softness = constraintMap.getFloat("softness", 0) * scale;
|
||||
data.bendDirection = constraintMap.getBoolean("bendPositive", true) ? 1 : -1;
|
||||
data.compress = constraintMap.getBoolean("compress", false);
|
||||
data.stretch = constraintMap.getBoolean("stretch", false);
|
||||
@ -609,7 +609,7 @@ public class SkeletonJson {
|
||||
int frameIndex = 0;
|
||||
for (JsonValue valueMap = constraintMap.child; valueMap != null; valueMap = valueMap.next) {
|
||||
timeline.setFrame(frameIndex, valueMap.getFloat("time", 0), valueMap.getFloat("mix", 1),
|
||||
valueMap.getFloat("softness", 0), valueMap.getBoolean("bendPositive", true) ? 1 : -1,
|
||||
valueMap.getFloat("softness", 0) * scale, valueMap.getBoolean("bendPositive", true) ? 1 : -1,
|
||||
valueMap.getBoolean("compress", false), valueMap.getBoolean("stretch", false));
|
||||
readCurve(valueMap, timeline, frameIndex);
|
||||
frameIndex++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user