mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[lua] Fixed dipping fix
This commit is contained in:
parent
5f5d4cc38e
commit
76f8d683fa
@ -371,7 +371,7 @@ function AnimationState:applyMixingFrom (entry, skeleton)
|
|||||||
for i,timeline in ipairs(timelines) do
|
for i,timeline in ipairs(timelines) do
|
||||||
local setupPose = timelinesFirst[i]
|
local setupPose = timelinesFirst[i]
|
||||||
local alpha = 1;
|
local alpha = 1;
|
||||||
if (timelinesLast ~= nil and setupPose and not timlinesLast[i]) then
|
if (timelinesLast ~= nil and setupPose and not timelinesLast[i]) then
|
||||||
alpha = alphaBase
|
alpha = alphaBase
|
||||||
else
|
else
|
||||||
alpha = alphaMix
|
alpha = alphaMix
|
||||||
@ -396,7 +396,10 @@ function AnimationState:applyMixingFrom (entry, skeleton)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function AnimationState:applyRotateTimeline (timeline, skeleton, time, alpha, setupPose, timelinesRotation, i, firstFrame)
|
function AnimationState:applyRotateTimeline (timeline, skeleton, time, alpha, setupPose, timelinesRotation, i, firstFrame)
|
||||||
if firstFrame then timelinesRotation[i] = 0 end
|
if firstFrame then
|
||||||
|
timelinesRotation[i] = 0
|
||||||
|
timelinesRotation[i+1] = 0
|
||||||
|
end
|
||||||
|
|
||||||
if alpha == 1 then
|
if alpha == 1 then
|
||||||
timeline:apply(skeleton, 0, time, nil, 1, setupPose, false)
|
timeline:apply(skeleton, 0, time, nil, 1, setupPose, false)
|
||||||
@ -554,7 +557,10 @@ function AnimationState:setCurrent (index, current, interrupt)
|
|||||||
|
|
||||||
local mixingFrom = from.mixingFrom
|
local mixingFrom = from.mixingFrom
|
||||||
if (mixingFrom ~= nil and from.mixDuration > 0) then
|
if (mixingFrom ~= nil and from.mixDuration > 0) then
|
||||||
if (not self.multipleMixing and from.mixTime / from.mixDuration < 0.5 and mixingFrom.animation ~= EMPTY_ANIMATION) then
|
if (self.multipleMixing) then
|
||||||
|
current.mixAlpha = current.mixAlpha * math_min(from.mixTime / from.mixDuration, 1)
|
||||||
|
else
|
||||||
|
if (from.mixTime / from.mixDuration < 0.5 and mixingFrom.animation ~= EMPTY_ANIMATION) then
|
||||||
current.mixingFrom = mixingFrom
|
current.mixingFrom = mixingFrom
|
||||||
mixingFrom.mixingFrom = from
|
mixingFrom.mixingFrom = from
|
||||||
mixingFrom.mixTime = from.mixDuration - from.mixTime
|
mixingFrom.mixTime = from.mixDuration - from.mixTime
|
||||||
@ -563,9 +569,6 @@ function AnimationState:setCurrent (index, current, interrupt)
|
|||||||
from = mixingFrom
|
from = mixingFrom
|
||||||
end
|
end
|
||||||
|
|
||||||
current.mixAlpha = current.mixAlpha * math_min(from.mixTime / from.mixDuration, 1)
|
|
||||||
|
|
||||||
if (not self.multipleMixing) then
|
|
||||||
from.mixAlpha = 0;
|
from.mixAlpha = 0;
|
||||||
from.mixTime = 0;
|
from.mixTime = 0;
|
||||||
from.mixDuration = 0;
|
from.mixDuration = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user