[libgdx] Physics timeline skeleton scale fixes.

This commit is contained in:
Nathan Sweet 2024-03-04 12:03:22 -04:00
parent 8e56a6c920
commit a70fb6c521
2 changed files with 6 additions and 9 deletions

View File

@ -1004,10 +1004,10 @@ public class SkeletonBinary extends SkeletonLoader {
readTimeline(input, timelines, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1); readTimeline(input, timelines, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1);
break; break;
case PHYSICS_WIND: case PHYSICS_WIND:
readTimeline(input, timelines, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), scale); readTimeline(input, timelines, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1);
break; break;
case PHYSICS_GRAVITY: case PHYSICS_GRAVITY:
readTimeline(input, timelines, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), scale); readTimeline(input, timelines, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1);
break; break;
case PHYSICS_MIX: case PHYSICS_MIX:
readTimeline(input, timelines, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1); readTimeline(input, timelines, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1);

View File

@ -966,7 +966,6 @@ public class SkeletonJson extends SkeletonLoader {
} }
CurveTimeline1 timeline; CurveTimeline1 timeline;
float timelineScale = 1.0f;
if (timelineName.equals("inertia")) if (timelineName.equals("inertia"))
timeline = new PhysicsConstraintInertiaTimeline(frames, frames, index); timeline = new PhysicsConstraintInertiaTimeline(frames, frames, index);
else if (timelineName.equals("strength")) else if (timelineName.equals("strength"))
@ -975,17 +974,15 @@ public class SkeletonJson extends SkeletonLoader {
timeline = new PhysicsConstraintDampingTimeline(frames, frames, index); timeline = new PhysicsConstraintDampingTimeline(frames, frames, index);
else if (timelineName.equals("mass")) else if (timelineName.equals("mass"))
timeline = new PhysicsConstraintMassTimeline(frames, frames, index); timeline = new PhysicsConstraintMassTimeline(frames, frames, index);
else if (timelineName.equals("wind")) { else if (timelineName.equals("wind"))
timeline = new PhysicsConstraintWindTimeline(frames, frames, index); timeline = new PhysicsConstraintWindTimeline(frames, frames, index);
timelineScale = scale; else if (timelineName.equals("gravity"))
} else if (timelineName.equals("gravity")) {
timeline = new PhysicsConstraintGravityTimeline(frames, frames, index); timeline = new PhysicsConstraintGravityTimeline(frames, frames, index);
timelineScale = scale; else if (timelineName.equals("mix"))
} else if (timelineName.equals("mix")) //
timeline = new PhysicsConstraintMixTimeline(frames, frames, index); timeline = new PhysicsConstraintMixTimeline(frames, frames, index);
else else
continue; continue;
timelines.add(readTimeline(keyMap, timeline, 0, timelineScale)); timelines.add(readTimeline(keyMap, timeline, 0, 1));
} }
} }