mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
cc9c78f0d0
Binary file not shown.
@ -307,7 +307,7 @@ public class Bone implements Updatable {
|
||||
* the applied transform after the world transform has been modified directly (eg, by a constraint).
|
||||
* <p>
|
||||
* Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */
|
||||
public function updateAppliedTransform () : void {
|
||||
function updateAppliedTransform () : void {
|
||||
appliedValid = true;
|
||||
var parent:Bone = this.parent;
|
||||
if (parent == null) {
|
||||
|
||||
@ -68,7 +68,14 @@ public class SkeletonBounds {
|
||||
boundingBox.computeWorldVertices(slot, polygon.vertices);
|
||||
}
|
||||
|
||||
if (updateAabb) aabbCompute();
|
||||
if (updateAabb)
|
||||
aabbCompute();
|
||||
else {
|
||||
minX = Number.MIN_VALUE;
|
||||
minY = Number.MIN_VALUE;
|
||||
maxX = Number.MAX_VALUE;
|
||||
maxY = Number.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
private function aabbCompute () : void {
|
||||
|
||||
@ -253,7 +253,7 @@ public class SkeletonJson {
|
||||
var eventData:EventData = new EventData(eventName);
|
||||
eventData.intValue = eventMap["int"] || 0;
|
||||
eventData.floatValue = eventMap["float"] || 0;
|
||||
eventData.stringValue = eventMap["string"] || null;
|
||||
eventData.stringValue = eventMap["string"] || "";
|
||||
skeletonData.events.push(eventData);
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ public class AnimationState {
|
||||
|
||||
// Apply mixing from entries first.
|
||||
var mix:Number = current.alpha;
|
||||
if (current.mixingFrom != null) mix = applyMixingFrom(current, skeleton, mix);
|
||||
if (current.mixingFrom != null) mix *= applyMixingFrom(current, skeleton);
|
||||
|
||||
// Apply current entry.
|
||||
var animationLast:Number = current.animationLast, animationTime:Number = current.getAnimationTime();
|
||||
@ -182,26 +182,25 @@ public class AnimationState {
|
||||
queue.drain();
|
||||
}
|
||||
|
||||
private function applyMixingFrom (entry:TrackEntry, skeleton:Skeleton, alpha:Number):Number {
|
||||
private function applyMixingFrom (entry:TrackEntry, skeleton:Skeleton):Number {
|
||||
var from:TrackEntry = entry.mixingFrom;
|
||||
if (from.mixingFrom != null) applyMixingFrom(from, skeleton, alpha);
|
||||
if (from.mixingFrom != null) applyMixingFrom(from, skeleton);
|
||||
|
||||
var mix:Number = 0;
|
||||
if (entry.mixDuration == 0) // Single frame mix to undo mixingFrom changes.
|
||||
mix = 1;
|
||||
else {
|
||||
mix = entry.mixTime / entry.mixDuration;
|
||||
if (mix > 1) mix = 1;
|
||||
mix *= alpha;
|
||||
if (mix > 1) mix = 1;
|
||||
}
|
||||
|
||||
var events:Vector.<Event> = mix < from.eventThreshold ? this.events : null;
|
||||
var attachments:Boolean = mix < from.attachmentThreshold, drawOrder:Boolean = mix < from.drawOrderThreshold;
|
||||
var animationLast:Number = from.animationLast, animationTime:Number = from.getAnimationTime();
|
||||
alpha = from.alpha * (1 - mix);
|
||||
var timelineCount:int = from.animation.timelines.length;
|
||||
var timelines:Vector.<Timeline> = from.animation.timelines;
|
||||
var timelinesFirst:Vector.<Boolean> = from.timelinesFirst;
|
||||
var alpha:Number = from.alpha * entry.mixAlpha * (1 - mix);
|
||||
|
||||
var firstFrame:Boolean = from.timelinesRotation.length == 0;
|
||||
if (firstFrame) from.timelinesRotation.length = timelineCount << 1;
|
||||
@ -368,8 +367,8 @@ public class AnimationState {
|
||||
|
||||
from.timelinesRotation.length = 0;
|
||||
|
||||
// If not completely mixed in, set alpha so mixing out happens from current mix to zero.
|
||||
if (from.mixingFrom != null) from.alpha *= Math.min(from.mixTime / from.mixDuration, 1);
|
||||
// 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);
|
||||
}
|
||||
|
||||
queue.start(current);
|
||||
@ -490,6 +489,7 @@ public class AnimationState {
|
||||
entry.timeScale = 1;
|
||||
|
||||
entry.alpha = 1;
|
||||
entry.mixAlpha = 1;
|
||||
entry.mixTime = 0;
|
||||
entry.mixDuration = last == null ? 0 : data.getMix(last.animation, animation);
|
||||
return entry;
|
||||
|
||||
@ -71,5 +71,9 @@ public class TrackEntry implements Poolable {
|
||||
timelinesFirst.length = 0;
|
||||
timelinesRotation.length = 0;
|
||||
}
|
||||
|
||||
public function resetRotationDirection ():void {
|
||||
timelinesRotation.length = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user