diff --git a/spine-ts/spine-core/src/SkeletonBinary.ts b/spine-ts/spine-core/src/SkeletonBinary.ts index cda72a3c8..f1eef3c43 100644 --- a/spine-ts/spine-core/src/SkeletonBinary.ts +++ b/spine-ts/spine-core/src/SkeletonBinary.ts @@ -239,8 +239,8 @@ export class SkeletonBinary { data.strength = input.readFloat(); data.damping = input.readFloat(); data.massInverse = input.readFloat(); - data.wind = input.readFloat(); - data.gravity = input.readFloat(); + data.wind = input.readFloat() * scale; + data.gravity = input.readFloat() * scale; data.mix = input.readFloat(); flags = input.readByte(); if ((flags & 1) != 0) data.inertiaGlobal = true; @@ -953,10 +953,10 @@ export class SkeletonBinary { timelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1)); break; case PHYSICS_WIND: - timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1)); + timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), scale)); break; case PHYSICS_GRAVITY: - timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1)); + timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), scale)); break; case PHYSICS_MIX: timelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1)); diff --git a/spine-ts/spine-core/src/SkeletonJson.ts b/spine-ts/spine-core/src/SkeletonJson.ts index a82818e18..03811191f 100644 --- a/spine-ts/spine-core/src/SkeletonJson.ts +++ b/spine-ts/spine-core/src/SkeletonJson.ts @@ -258,8 +258,8 @@ export class SkeletonJson { data.strength = getValue(constraintMap, "strength", 100); data.damping = getValue(constraintMap, "damping", 1); data.massInverse = 1 / getValue(constraintMap, "mass", 1); - data.wind = getValue(constraintMap, "wind", 0); - data.gravity = getValue(constraintMap, "gravity", 0); + data.wind = getValue(constraintMap, "wind", 0) * scale; + data.gravity = getValue(constraintMap, "gravity", 0) * scale; data.mix = getValue(constraintMap, "mix", 1); data.inertiaGlobal = getValue(constraintMap, "inertiaGlobal", false); data.strengthGlobal = getValue(constraintMap, "strengthGlobal", false); @@ -911,6 +911,7 @@ export class SkeletonJson { } let timeline; + let timelineScale = 1; if (timelineName == "inertia") timeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex); else if (timelineName == "strength") @@ -919,15 +920,19 @@ export class SkeletonJson { timeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex); else if (timelineName == "mass") timeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex); - else if (timelineName == "wind") + else if (timelineName == "wind") { timeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex); - else if (timelineName == "gravity") + timelineScale = scale; + } + else if (timelineName == "gravity") { timeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex); + timelineScale = scale; + } else if (timelineName == "mix") // timeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex); else continue; - timelines.push(readTimeline1(timelineMap, timeline, 0, 1)); + timelines.push(readTimeline1(timelineMap, timeline, 0, timelineScale)); } } }