mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 00:30:12 +08:00
[as3][c][cpp][csharp][libgdx][lua][ts] Don't treat scale sign as an instant transition when applying a timeline additively.
This commit is contained in:
parent
0e3722861f
commit
f4021177f9
@ -115,10 +115,8 @@ package spine.animation {
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = bone.scaleX;
|
||||
by = bone.scaleY;
|
||||
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -136,10 +134,8 @@ package spine.animation {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = MathUtils.signum(x);
|
||||
by = MathUtils.signum(y);
|
||||
bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,8 +82,7 @@ package spine.animation {
|
||||
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = bone.scaleX;
|
||||
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -97,8 +96,7 @@ package spine.animation {
|
||||
bone.scaleX = bx + (x - bx) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = MathUtils.signum(x);
|
||||
bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,8 +82,7 @@ package spine.animation {
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
by = bone.scaleY;
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -97,8 +96,7 @@ package spine.animation {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
by = MathUtils.signum(y);
|
||||
bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -655,10 +655,8 @@ void _spScaleTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float la
|
||||
bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
|
||||
break;
|
||||
case SP_MIX_BLEND_ADD:
|
||||
bx = bone->scaleX;
|
||||
by = bone->scaleY;
|
||||
bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bone->data->scaleX) * alpha;
|
||||
bone->scaleY = by + (ABS(y) * SIGNUM(by) - bone->data->scaleY) * alpha;
|
||||
bone->scaleX = (x - bone->data->scaleX) * alpha;
|
||||
bone->scaleY = (y - bone->data->scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -676,10 +674,8 @@ void _spScaleTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float la
|
||||
bone->scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case SP_MIX_BLEND_ADD:
|
||||
bx = SIGNUM(x);
|
||||
by = SIGNUM(y);
|
||||
bone->scaleX = ABS(bone->scaleX) * bx + (x - ABS(bone->data->scaleX) * bx) * alpha;
|
||||
bone->scaleY = ABS(bone->scaleY) * by + (y - ABS(bone->data->scaleY) * by) * alpha;
|
||||
bone->scaleX += (x - bone->data->scaleX) * alpha;
|
||||
bone->scaleY += (y - bone->data->scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -752,8 +748,7 @@ void _spScaleXTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float l
|
||||
bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha;
|
||||
break;
|
||||
case SP_MIX_BLEND_ADD:
|
||||
bx = bone->scaleX;
|
||||
bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bone->data->scaleX) * alpha;
|
||||
bone->scaleX = (x - bone->data->scaleX) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -767,8 +762,7 @@ void _spScaleXTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float l
|
||||
bone->scaleX = bx + (x - bx) * alpha;
|
||||
break;
|
||||
case SP_MIX_BLEND_ADD:
|
||||
bx = SIGNUM(x);
|
||||
bone->scaleX = ABS(bone->scaleX) * bx + (x - ABS(bone->data->scaleX) * bx) * alpha;
|
||||
bone->scaleX += (x - bone->data->scaleX) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -840,8 +834,7 @@ void _spScaleYTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float l
|
||||
bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
|
||||
break;
|
||||
case SP_MIX_BLEND_ADD:
|
||||
by = bone->scaleY;
|
||||
bone->scaleY = by + (ABS(y) * SIGNUM(by) - bone->data->scaleY) * alpha;
|
||||
bone->scaleY = (y - bone->data->scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -855,8 +848,7 @@ void _spScaleYTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float l
|
||||
bone->scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case SP_MIX_BLEND_ADD:
|
||||
by = SIGNUM(y);
|
||||
bone->scaleY = ABS(bone->scaleY) * by + (y - ABS(bone->data->scaleY) * by) * alpha;
|
||||
bone->scaleY += (y - bone->data->scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,10 +131,8 @@ void ScaleTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector
|
||||
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend_Add:
|
||||
bx = bone->_scaleX;
|
||||
by = bone->_scaleY;
|
||||
bone->_scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bone->_data._scaleX) * alpha;
|
||||
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - bone->_data._scaleY) * alpha;
|
||||
bone->_scaleX = (x - bone->_data._scaleX) * alpha;
|
||||
bone->_scaleY = (y - bone->_data._scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -152,12 +150,8 @@ void ScaleTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector
|
||||
bone->_scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend_Add:
|
||||
bx = MathUtil::sign(x);
|
||||
by = MathUtil::sign(y);
|
||||
bone->_scaleX =
|
||||
MathUtil::abs(bone->_scaleX) * bx + (x - MathUtil::abs(bone->_data._scaleX) * bx) * alpha;
|
||||
bone->_scaleY =
|
||||
MathUtil::abs(bone->_scaleY) * by + (y - MathUtil::abs(bone->_data._scaleY) * by) * alpha;
|
||||
bone->_scaleX += (x - bone->_data._scaleX) * alpha;
|
||||
bone->_scaleY += (y - bone->_data._scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -216,8 +210,7 @@ void ScaleXTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
|
||||
bone->_scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bx) * alpha;
|
||||
break;
|
||||
case MixBlend_Add:
|
||||
bx = bone->_scaleX;
|
||||
bone->_scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bone->_data._scaleX) * alpha;
|
||||
bone->_scaleX = (x - bone->_data._scaleX) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -231,9 +224,7 @@ void ScaleXTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
|
||||
bone->_scaleX = bx + (x - bx) * alpha;
|
||||
break;
|
||||
case MixBlend_Add:
|
||||
bx = MathUtil::sign(x);
|
||||
bone->_scaleX =
|
||||
MathUtil::abs(bone->_scaleX) * bx + (x - MathUtil::abs(bone->_data._scaleX) * bx) * alpha;
|
||||
bone->_scaleX += (x - bone->_data._scaleX) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -292,8 +283,7 @@ void ScaleYTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
|
||||
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend_Add:
|
||||
by = bone->_scaleY;
|
||||
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - bone->_data._scaleY) * alpha;
|
||||
bone->_scaleY = (y - bone->_data._scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -307,9 +297,7 @@ void ScaleYTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
|
||||
bone->_scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend_Add:
|
||||
by = MathUtil::sign(y);
|
||||
bone->_scaleY =
|
||||
MathUtil::abs(bone->_scaleY) * by + (y - MathUtil::abs(bone->_data._scaleY) * by) * alpha;
|
||||
bone->_scaleY += (y - bone->_data._scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -794,10 +794,8 @@ namespace Spine {
|
||||
bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend.Add:
|
||||
bx = bone.scaleX;
|
||||
by = bone.scaleY;
|
||||
bone.scaleX = bx + (Math.Abs(x) * Math.Sign(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -816,10 +814,8 @@ namespace Spine {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend.Add:
|
||||
bx = Math.Sign(x);
|
||||
by = Math.Sign(y);
|
||||
bone.scaleX = Math.Abs(bone.scaleX) * bx + (x - Math.Abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleY = Math.Abs(bone.scaleY) * by + (y - Math.Abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -881,8 +877,7 @@ namespace Spine {
|
||||
bone.scaleX = bx + (Math.Abs(x) * Math.Sign(bx) - bx) * alpha;
|
||||
break;
|
||||
case MixBlend.Add:
|
||||
bx = bone.scaleX;
|
||||
bone.scaleX = bx + (Math.Abs(x) * Math.Sign(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -897,8 +892,7 @@ namespace Spine {
|
||||
bone.scaleX = bx + (x - bx) * alpha;
|
||||
break;
|
||||
case MixBlend.Add:
|
||||
bx = Math.Sign(x);
|
||||
bone.scaleX = Math.Abs(bone.scaleX) * bx + (x - Math.Abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -960,8 +954,7 @@ namespace Spine {
|
||||
bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend.Add:
|
||||
by = bone.scaleY;
|
||||
bone.scaleY = by + (Math.Abs(y) * Math.Sign(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -976,8 +969,7 @@ namespace Spine {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend.Add:
|
||||
by = Math.Sign(y);
|
||||
bone.scaleY = Math.Abs(bone.scaleY) * by + (y - Math.Abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -739,10 +739,8 @@ public class Animation {
|
||||
bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha;
|
||||
break;
|
||||
case add:
|
||||
bx = bone.scaleX;
|
||||
by = bone.scaleY;
|
||||
bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = by + (Math.abs(y) * Math.signum(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -760,10 +758,8 @@ public class Animation {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case add:
|
||||
bx = Math.signum(x);
|
||||
by = Math.signum(y);
|
||||
bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -822,8 +818,7 @@ public class Animation {
|
||||
bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha;
|
||||
break;
|
||||
case add:
|
||||
bx = bone.scaleX;
|
||||
bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -837,8 +832,7 @@ public class Animation {
|
||||
bone.scaleX = bx + (x - bx) * alpha;
|
||||
break;
|
||||
case add:
|
||||
bx = Math.signum(x);
|
||||
bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -897,8 +891,7 @@ public class Animation {
|
||||
bone.scaleY = by + (Math.abs(y) * Math.signum(by) - by) * alpha;
|
||||
break;
|
||||
case add:
|
||||
by = bone.scaleY;
|
||||
bone.scaleY = by + (Math.abs(y) * Math.signum(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -912,8 +905,7 @@ public class Animation {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case add:
|
||||
by = Math.signum(y);
|
||||
bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -566,10 +566,8 @@ function Animation.ScaleTimeline.new (frameCount, bezierCount, boneIndex)
|
||||
bone.scaleX = bx + (math_abs(x) * math_signum(bx) - bx) * alpha
|
||||
bone.scaleY = by + (math_abs(y) * math_signum(by) - by) * alpha
|
||||
elseif blend == MixBlend.add then
|
||||
bx = bone.scaleX
|
||||
by = bone.scaleY
|
||||
bone.scaleX = bx + (math_abs(x) * math_signum(bx) - bone.data.scaleX) * alpha
|
||||
bone.scaleY = by + (math_abs(y) * math_signum(by) - bone.data.scaleY) * alpha
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha
|
||||
end
|
||||
else
|
||||
if blend == MixBlend.setup then
|
||||
@ -583,10 +581,8 @@ function Animation.ScaleTimeline.new (frameCount, bezierCount, boneIndex)
|
||||
bone.scaleX = bx + (x - bx) * alpha
|
||||
bone.scaleY = by + (y - by) * alpha
|
||||
elseif blend == MixBlend.add then
|
||||
bx = math_signum(x)
|
||||
by = math_signum(y)
|
||||
bone.scaleX = math_abs(bone.scaleX) * bx + (x - math_abs(bone.data.scaleX) * bx) * alpha
|
||||
bone.scaleY = math_abs(bone.scaleY) * by + (y - math_abs(bone.data.scaleY) * by) * alpha
|
||||
bone.scaleX = bone.scaleX + (x - bone.data.scaleX) * alpha
|
||||
bone.scaleY = bone.scaleY + (y - bone.data.scaleY) * alpha
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -631,8 +627,7 @@ function Animation.ScaleXTimeline.new (frameCount, bezierCount, boneIndex)
|
||||
bx = bone.scaleX
|
||||
bone.scaleX = bx + (math_abs(x) * math_signum(bx) - bx) * alpha
|
||||
elseif blend == MixBlend.add then
|
||||
bx = bone.scaleX
|
||||
bone.scaleX = bx + (math_abs(x) * math_signum(bx) - bone.data.scaleX) * alpha
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha
|
||||
end
|
||||
else
|
||||
if blend == MixBlend.setup then
|
||||
@ -642,8 +637,7 @@ function Animation.ScaleXTimeline.new (frameCount, bezierCount, boneIndex)
|
||||
bx = math_abs(bone.scaleX) * math_signum(x)
|
||||
bone.scaleX = bx + (x - bx) * alpha
|
||||
elseif blend == MixBlend.add then
|
||||
bx = math_signum(x)
|
||||
bone.scaleX = math_abs(bone.scaleX) * bx + (x - math_abs(bone.data.scaleX) * bx) * alpha
|
||||
bone.scaleX = bone.scaleX + (x - bone.data.scaleX) * alpha
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -688,8 +682,7 @@ function Animation.ScaleYTimeline.new (frameCount, bezierCount, boneIndex)
|
||||
by = bone.scaleY
|
||||
bone.scaleY = by + (math_abs(y) * math_signum(by) - by) * alpha
|
||||
elseif blend == MixBlend.add then
|
||||
by = bone.scaleY
|
||||
bone.scaleY = by + (math_abs(y) * math_signum(by) - bone.data.scaleY) * alpha
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha
|
||||
end
|
||||
else
|
||||
if blend == MixBlend.setup then
|
||||
@ -699,8 +692,7 @@ function Animation.ScaleYTimeline.new (frameCount, bezierCount, boneIndex)
|
||||
by = math_abs(bone.scaleY) * math_signum(y)
|
||||
bone.scaleY = by + (y - by) * alpha
|
||||
elseif blend == MixBlend.add then
|
||||
by = math_signum(y)
|
||||
bone.scaleY = math_abs(bone.scaleY) * by + (y - math_abs(bone.data.scaleY) * by) * alpha
|
||||
bone.scaleY = bone.scaleY + (y - bone.data.scaleY) * alpha
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -622,10 +622,8 @@ export class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = bone.scaleX;
|
||||
by = bone.scaleY;
|
||||
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -643,10 +641,8 @@ export class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = MathUtils.signum(x);
|
||||
by = MathUtils.signum(y);
|
||||
bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -699,8 +695,7 @@ export class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {
|
||||
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = bone.scaleX;
|
||||
bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;
|
||||
bone.scaleX = (x - bone.data.scaleX) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -714,8 +709,7 @@ export class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {
|
||||
bone.scaleX = bx + (x - bx) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
bx = MathUtils.signum(x);
|
||||
bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;
|
||||
bone.scaleX += (x - bone.data.scaleX) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -768,8 +762,7 @@ export class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
by = bone.scaleY;
|
||||
bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;
|
||||
bone.scaleY = (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
} else {
|
||||
switch (blend) {
|
||||
@ -783,8 +776,7 @@ export class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {
|
||||
bone.scaleY = by + (y - by) * alpha;
|
||||
break;
|
||||
case MixBlend.add:
|
||||
by = MathUtils.signum(y);
|
||||
bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;
|
||||
bone.scaleY += (y - bone.data.scaleY) * alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user