mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-25 11:11:24 +08:00
Merge branch '4.1-beta' into 4.1-beta-physics
This commit is contained in:
commit
4bf5c690d0
@ -4,7 +4,7 @@ This folder contains formatter configuration files to be used with IDEs as well
|
|||||||
You will need the following on your `PATH`:
|
You will need the following on your `PATH`:
|
||||||
|
|
||||||
- JDK 10+
|
- JDK 10+
|
||||||
- clang-format 12 (i.e. `brew install clang-format`). Also set the environment variable `CLANGFORMAT` to the path of the `clang-format` executable.
|
- clang-format 12.0.1 (i.e. `brew install clang-format`). Also set the environment variable `CLANGFORMAT` to the path of the `clang-format` executable.
|
||||||
- dotnet format (i.e. `dotnet tool install -g dotnet-format`, comes with dotnet 6 out of the box)
|
- dotnet format (i.e. `dotnet tool install -g dotnet-format`, comes with dotnet 6 out of the box)
|
||||||
- tsfmt, (i.e. `npm install -g typescript-formatter`)
|
- tsfmt, (i.e. `npm install -g typescript-formatter`)
|
||||||
|
|
||||||
|
|||||||
@ -703,6 +703,9 @@ public class AnimationState {
|
|||||||
entry.loop = loop;
|
entry.loop = loop;
|
||||||
entry.holdPrevious = false;
|
entry.holdPrevious = false;
|
||||||
|
|
||||||
|
entry.reverse = false;
|
||||||
|
entry.shortestRotation = false;
|
||||||
|
|
||||||
entry.eventThreshold = 0;
|
entry.eventThreshold = 0;
|
||||||
entry.attachmentThreshold = 0;
|
entry.attachmentThreshold = 0;
|
||||||
entry.drawOrderThreshold = 0;
|
entry.drawOrderThreshold = 0;
|
||||||
@ -720,9 +723,10 @@ public class AnimationState {
|
|||||||
entry.timeScale = 1;
|
entry.timeScale = 1;
|
||||||
|
|
||||||
entry.alpha = 1;
|
entry.alpha = 1;
|
||||||
entry.interruptAlpha = 1;
|
|
||||||
entry.mixTime = 0;
|
entry.mixTime = 0;
|
||||||
entry.mixDuration = last == null ? 0 : data.getMix(last.animation, animation);
|
entry.mixDuration = last == null ? 0 : data.getMix(last.animation, animation);
|
||||||
|
entry.interruptAlpha = 1;
|
||||||
|
entry.totalAlpha = 0;
|
||||||
entry.mixBlend = MixBlend.replace;
|
entry.mixBlend = MixBlend.replace;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,13 +203,14 @@ export class AnimationState {
|
|||||||
} else {
|
} else {
|
||||||
let timelineMode = current.timelineMode;
|
let timelineMode = current.timelineMode;
|
||||||
|
|
||||||
let firstFrame = current.timelinesRotation.length != timelineCount << 1;
|
let shortestRotation = current.shortestRotation;
|
||||||
|
let firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;
|
||||||
if (firstFrame) current.timelinesRotation.length = timelineCount << 1;
|
if (firstFrame) current.timelinesRotation.length = timelineCount << 1;
|
||||||
|
|
||||||
for (let ii = 0; ii < timelineCount; ii++) {
|
for (let ii = 0; ii < timelineCount; ii++) {
|
||||||
let timeline = timelines[ii];
|
let timeline = timelines[ii];
|
||||||
let timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;
|
let timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;
|
||||||
if (timeline instanceof RotateTimeline) {
|
if (!shortestRotation && timeline instanceof RotateTimeline) {
|
||||||
this.applyRotateTimeline(timeline, skeleton, applyTime, mix, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);
|
this.applyRotateTimeline(timeline, skeleton, applyTime, mix, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);
|
||||||
} else if (timeline instanceof AttachmentTimeline) {
|
} else if (timeline instanceof AttachmentTimeline) {
|
||||||
this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, true);
|
this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, true);
|
||||||
@ -276,8 +277,8 @@ export class AnimationState {
|
|||||||
let timelineMode = from.timelineMode;
|
let timelineMode = from.timelineMode;
|
||||||
let timelineHoldMix = from.timelineHoldMix;
|
let timelineHoldMix = from.timelineHoldMix;
|
||||||
|
|
||||||
let firstFrame = from.timelinesRotation.length != timelineCount << 1;
|
let shortestRotation = from.shortestRotation;
|
||||||
if (firstFrame) from.timelinesRotation.length = timelineCount << 1;
|
let firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;
|
||||||
|
|
||||||
from.totalAlpha = 0;
|
from.totalAlpha = 0;
|
||||||
for (let i = 0; i < timelineCount; i++) {
|
for (let i = 0; i < timelineCount; i++) {
|
||||||
@ -311,7 +312,7 @@ export class AnimationState {
|
|||||||
}
|
}
|
||||||
from.totalAlpha += alpha;
|
from.totalAlpha += alpha;
|
||||||
|
|
||||||
if (timeline instanceof RotateTimeline)
|
if (shortestRotation && timeline instanceof RotateTimeline)
|
||||||
this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);
|
this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);
|
||||||
else if (timeline instanceof AttachmentTimeline)
|
else if (timeline instanceof AttachmentTimeline)
|
||||||
this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments);
|
this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments);
|
||||||
@ -651,6 +652,9 @@ export class AnimationState {
|
|||||||
entry.loop = loop;
|
entry.loop = loop;
|
||||||
entry.holdPrevious = false;
|
entry.holdPrevious = false;
|
||||||
|
|
||||||
|
entry.reverse = false;
|
||||||
|
entry.shortestRotation = false;
|
||||||
|
|
||||||
entry.eventThreshold = 0;
|
entry.eventThreshold = 0;
|
||||||
entry.attachmentThreshold = 0;
|
entry.attachmentThreshold = 0;
|
||||||
entry.drawOrderThreshold = 0;
|
entry.drawOrderThreshold = 0;
|
||||||
@ -668,9 +672,10 @@ export class AnimationState {
|
|||||||
entry.timeScale = 1;
|
entry.timeScale = 1;
|
||||||
|
|
||||||
entry.alpha = 1;
|
entry.alpha = 1;
|
||||||
entry.interruptAlpha = 1;
|
|
||||||
entry.mixTime = 0;
|
entry.mixTime = 0;
|
||||||
entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation);
|
entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation);
|
||||||
|
entry.interruptAlpha = 1;
|
||||||
|
entry.totalAlpha = 0;
|
||||||
entry.mixBlend = MixBlend.replace;
|
entry.mixBlend = MixBlend.replace;
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@ -823,6 +828,8 @@ export class TrackEntry {
|
|||||||
|
|
||||||
reverse: boolean = false;
|
reverse: boolean = false;
|
||||||
|
|
||||||
|
shortestRotation: boolean = false;
|
||||||
|
|
||||||
/** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the
|
/** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the
|
||||||
* `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event
|
* `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event
|
||||||
* timelines are not applied while this animation is being mixed out. */
|
* timelines are not applied while this animation is being mixed out. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user