|
@@ -80,8 +80,8 @@ module spine {
|
|
next = next.mixingFrom;
|
|
next = next.mixingFrom;
|
|
}
|
|
}
|
|
continue;
|
|
continue;
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
|
// Clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom.
|
|
if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {
|
|
if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {
|
|
tracks[i] = null;
|
|
tracks[i] = null;
|
|
@@ -111,9 +111,9 @@ module spine {
|
|
}
|
|
}
|
|
|
|
|
|
from.animationLast = from.nextAnimationLast;
|
|
from.animationLast = from.nextAnimationLast;
|
|
- from.trackLast = from.nextTrackLast;
|
|
|
|
|
|
+ from.trackLast = from.nextTrackLast;
|
|
from.trackTime += delta * from.timeScale;
|
|
from.trackTime += delta * from.timeScale;
|
|
- entry.mixTime += delta * from.timeScale;
|
|
|
|
|
|
+ entry.mixTime += delta * from.timeScale;
|
|
}
|
|
}
|
|
|
|
|
|
apply (skeleton: Skeleton) {
|
|
apply (skeleton: Skeleton) {
|
|
@@ -129,7 +129,7 @@ module spine {
|
|
|
|
|
|
// Apply mixing from entries first.
|
|
// Apply mixing from entries first.
|
|
let mix = current.alpha;
|
|
let mix = current.alpha;
|
|
- if (current.mixingFrom != null)
|
|
|
|
|
|
+ if (current.mixingFrom != null)
|
|
mix *= this.applyMixingFrom(current, skeleton);
|
|
mix *= this.applyMixingFrom(current, skeleton);
|
|
else if (current.trackTime >= current.trackEnd)
|
|
else if (current.trackTime >= current.trackEnd)
|
|
mix = 0;
|
|
mix = 0;
|
|
@@ -211,6 +211,9 @@ module spine {
|
|
|
|
|
|
applyRotateTimeline (timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean,
|
|
applyRotateTimeline (timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, setupPose: boolean,
|
|
timelinesRotation: Array<number>, i: number, firstFrame: boolean) {
|
|
timelinesRotation: Array<number>, i: number, firstFrame: boolean) {
|
|
|
|
+
|
|
|
|
+ if (firstFrame) timelinesRotation[i] = 0;
|
|
|
|
+
|
|
if (alpha == 1) {
|
|
if (alpha == 1) {
|
|
timeline.apply(skeleton, 0, time, null, 1, setupPose, false);
|
|
timeline.apply(skeleton, 0, time, null, 1, setupPose, false);
|
|
return;
|
|
return;
|
|
@@ -245,11 +248,7 @@ module spine {
|
|
let r1 = setupPose ? bone.data.rotation : bone.rotation;
|
|
let r1 = setupPose ? bone.data.rotation : bone.rotation;
|
|
let total = 0, diff = r2 - r1;
|
|
let total = 0, diff = r2 - r1;
|
|
if (diff == 0) {
|
|
if (diff == 0) {
|
|
- if (firstFrame) {
|
|
|
|
- timelinesRotation[i] = 0;
|
|
|
|
- total = 0;
|
|
|
|
- } else
|
|
|
|
- total = timelinesRotation[i];
|
|
|
|
|
|
+ total = timelinesRotation[i];
|
|
} else {
|
|
} else {
|
|
diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;
|
|
diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;
|
|
let lastTotal = 0, lastDiff = 0;
|
|
let lastTotal = 0, lastDiff = 0;
|
|
@@ -347,6 +346,8 @@ module spine {
|
|
current.mixingFrom = from;
|
|
current.mixingFrom = from;
|
|
current.mixTime = 0;
|
|
current.mixTime = 0;
|
|
|
|
|
|
|
|
+ from.timelinesRotation.length = 0;
|
|
|
|
+
|
|
// If not completely mixed in, set mixAlpha so mixing out happens from current mix to zero.
|
|
// If not completely mixed in, set mixAlpha so mixing out happens from current mix to zero.
|
|
if (from.mixingFrom != null) current.mixAlpha *= Math.min(from.mixTime / from.mixDuration, 1);
|
|
if (from.mixingFrom != null) current.mixAlpha *= Math.min(from.mixTime / from.mixDuration, 1);
|
|
}
|
|
}
|