mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.7-beta' into 3.7-beta-cpp
This commit is contained in:
commit
025e5874ae
@ -70,7 +70,7 @@ void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, V
|
|||||||
Slot &slot = *slotP;
|
Slot &slot = *slotP;
|
||||||
if (direction == MixDirection_Out && blend == MixBlend_Setup) {
|
if (direction == MixDirection_Out && blend == MixBlend_Setup) {
|
||||||
attachmentName = &slot._data._attachmentName;
|
attachmentName = &slot._data._attachmentName;
|
||||||
slot._attachment = attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName);
|
slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,8 +78,7 @@ void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, V
|
|||||||
// Time is before first frame.
|
// Time is before first frame.
|
||||||
if (blend == MixBlend_Setup || blend == MixBlend_First) {
|
if (blend == MixBlend_Setup || blend == MixBlend_First) {
|
||||||
attachmentName = &slot._data._attachmentName;
|
attachmentName = &slot._data._attachmentName;
|
||||||
slot._attachment =
|
slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName));
|
||||||
attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -93,7 +92,7 @@ void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, V
|
|||||||
}
|
}
|
||||||
|
|
||||||
attachmentName = &_attachmentNames[frameIndex];
|
attachmentName = &_attachmentNames[frameIndex];
|
||||||
slot._attachment = attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName);
|
slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName));
|
||||||
}
|
}
|
||||||
|
|
||||||
int AttachmentTimeline::getPropertyId() {
|
int AttachmentTimeline::getPropertyId() {
|
||||||
|
|||||||
@ -69,7 +69,7 @@ void DeformTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
|
|||||||
Slot *slotP = skeleton._slots[_slotIndex];
|
Slot *slotP = skeleton._slots[_slotIndex];
|
||||||
Slot &slot = *slotP;
|
Slot &slot = *slotP;
|
||||||
|
|
||||||
Attachment *slotAttachment = slot._attachment;
|
Attachment *slotAttachment = slot.getAttachment();
|
||||||
if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti)) {
|
if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -564,7 +564,7 @@ void Skeleton::sortPathConstraint(PathConstraint *constraint) {
|
|||||||
for (size_t ii = 0, nn = _data->_skins.size(); ii < nn; ii++)
|
for (size_t ii = 0, nn = _data->_skins.size(); ii < nn; ii++)
|
||||||
sortPathConstraintAttachment(_data->_skins[ii], slotIndex, slotBone);
|
sortPathConstraintAttachment(_data->_skins[ii], slotIndex, slotBone);
|
||||||
|
|
||||||
Attachment *attachment = slot->_attachment;
|
Attachment *attachment = slot->getAttachment();
|
||||||
if (attachment != NULL && attachment->getRTTI().instanceOf(PathAttachment::rtti))
|
if (attachment != NULL && attachment->getRTTI().instanceOf(PathAttachment::rtti))
|
||||||
sortPathConstraintAttachment(attachment, slotBone);
|
sortPathConstraintAttachment(attachment, slotBone);
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
|
|||||||
|
|
||||||
for (size_t i = 0; i < slotCount; i++) {
|
for (size_t i = 0; i < slotCount; i++) {
|
||||||
Slot *slot = slots[i];
|
Slot *slot = slots[i];
|
||||||
Attachment *attachment = slot->_attachment;
|
Attachment *attachment = slot->getAttachment();
|
||||||
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) {
|
if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,7 +171,7 @@ public class AnimationState {
|
|||||||
from.trackLast = from.nextTrackLast;
|
from.trackLast = from.nextTrackLast;
|
||||||
|
|
||||||
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
|
// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
|
||||||
if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
|
if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {
|
||||||
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
|
// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
|
||||||
if (from.totalAlpha == 0 || to.mixDuration == 0) {
|
if (from.totalAlpha == 0 || to.mixDuration == 0) {
|
||||||
to.mixingFrom = from.mixingFrom;
|
to.mixingFrom = from.mixingFrom;
|
||||||
@ -182,6 +182,13 @@ public class AnimationState {
|
|||||||
return finished;
|
return finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If to has 0 timeScale and is not the first entry, remove the mix and apply it one more time to return to the setup pose.
|
||||||
|
if (to.timeScale == 0 && to.mixingTo != null) {
|
||||||
|
to.timeScale = 1;
|
||||||
|
to.mixTime = 0;
|
||||||
|
to.mixDuration = 0;
|
||||||
|
}
|
||||||
|
|
||||||
from.trackTime += delta * from.timeScale;
|
from.trackTime += delta * from.timeScale;
|
||||||
to.mixTime += delta * to.timeScale;
|
to.mixTime += delta * to.timeScale;
|
||||||
return false;
|
return false;
|
||||||
@ -488,7 +495,8 @@ public class AnimationState {
|
|||||||
return setAnimation(trackIndex, animation, loop);
|
return setAnimation(trackIndex, animation, loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the current animation for a track, discarding any queued animations.
|
/** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never
|
||||||
|
* applied to a skeleton, it is replaced (not mixed from).
|
||||||
* @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
|
* @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
|
||||||
* duration. In either case {@link TrackEntry#getTrackEnd()} determines when the track is cleared.
|
* duration. In either case {@link TrackEntry#getTrackEnd()} determines when the track is cleared.
|
||||||
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
|
* @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
|
||||||
@ -809,6 +817,7 @@ public class AnimationState {
|
|||||||
float delay, trackTime, trackLast, nextTrackLast, trackEnd, timeScale;
|
float delay, trackTime, trackLast, nextTrackLast, trackEnd, timeScale;
|
||||||
float alpha, mixTime, mixDuration, interruptAlpha, totalAlpha;
|
float alpha, mixTime, mixDuration, interruptAlpha, totalAlpha;
|
||||||
MixBlend mixBlend = MixBlend.replace;
|
MixBlend mixBlend = MixBlend.replace;
|
||||||
|
|
||||||
final IntArray timelineMode = new IntArray();
|
final IntArray timelineMode = new IntArray();
|
||||||
final Array<TrackEntry> timelineHoldMix = new Array();
|
final Array<TrackEntry> timelineHoldMix = new Array();
|
||||||
final FloatArray timelinesRotation = new FloatArray();
|
final FloatArray timelinesRotation = new FloatArray();
|
||||||
@ -1066,6 +1075,12 @@ public class AnimationState {
|
|||||||
return mixingFrom;
|
return mixingFrom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is
|
||||||
|
* currently occuring. When mixing to multiple animations, <code>mixingTo</code> makes up a linked list. */
|
||||||
|
public TrackEntry getMixingTo () {
|
||||||
|
return mixingTo;
|
||||||
|
}
|
||||||
|
|
||||||
public void setHoldPrevious (boolean holdPrevious) {
|
public void setHoldPrevious (boolean holdPrevious) {
|
||||||
this.holdPrevious = holdPrevious;
|
this.holdPrevious = holdPrevious;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user