mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5635 from andyque/fix_ease_action
fix wrong display of ease elastic action test.
This commit is contained in:
commit
4b4b706066
|
@ -524,7 +524,7 @@ EaseElasticIn* EaseElasticIn::clone() const
|
|||
|
||||
void EaseElasticIn::update(float time)
|
||||
{
|
||||
_inner->update(tweenfunc::elasticEaseIn(time, NULL));
|
||||
_inner->update(tweenfunc::elasticEaseIn(time, _period));
|
||||
}
|
||||
|
||||
EaseElastic* EaseElasticIn::reverse() const
|
||||
|
@ -570,7 +570,7 @@ EaseElasticOut* EaseElasticOut::clone() const
|
|||
|
||||
void EaseElasticOut::update(float time)
|
||||
{
|
||||
_inner->update(tweenfunc::elasticEaseOut(time, NULL));
|
||||
_inner->update(tweenfunc::elasticEaseOut(time, _period));
|
||||
}
|
||||
|
||||
EaseElastic* EaseElasticOut::reverse() const
|
||||
|
@ -616,7 +616,7 @@ EaseElasticInOut* EaseElasticInOut::clone() const
|
|||
|
||||
void EaseElasticInOut::update(float time)
|
||||
{
|
||||
_inner->update(tweenfunc::elasticEaseInOut(time, NULL));
|
||||
_inner->update(tweenfunc::elasticEaseInOut(time, _period));
|
||||
}
|
||||
|
||||
EaseElasticInOut* EaseElasticInOut::reverse() const
|
||||
|
|
|
@ -121,13 +121,13 @@ float tweenTo(float time, TweenType type, float *easingParam)
|
|||
break;
|
||||
|
||||
case Elastic_EaseIn:
|
||||
delta = elasticEaseIn(time, easingParam);
|
||||
delta = elasticEaseIn(time, easingParam[0]);
|
||||
break;
|
||||
case Elastic_EaseOut:
|
||||
delta = elasticEaseOut(time, easingParam);
|
||||
delta = elasticEaseOut(time, easingParam[0]);
|
||||
break;
|
||||
case Elastic_EaseInOut:
|
||||
delta = elasticEaseInOut(time, easingParam);
|
||||
delta = elasticEaseInOut(time, easingParam[0]);
|
||||
break;
|
||||
|
||||
|
||||
|
@ -315,14 +315,8 @@ float circEaseInOut(float time)
|
|||
|
||||
|
||||
// Elastic Ease
|
||||
float elasticEaseIn(float time, float *easingParam)
|
||||
float elasticEaseIn(float time, float period)
|
||||
{
|
||||
float period = 0.3f;
|
||||
|
||||
if (easingParam != NULL)
|
||||
{
|
||||
period = easingParam[0];
|
||||
}
|
||||
|
||||
float newT = 0;
|
||||
if (time == 0 || time == 1)
|
||||
|
@ -338,14 +332,8 @@ float elasticEaseIn(float time, float *easingParam)
|
|||
|
||||
return newT;
|
||||
}
|
||||
float elasticEaseOut(float time, float *easingParam)
|
||||
float elasticEaseOut(float time, float period)
|
||||
{
|
||||
float period = 0.3f;
|
||||
|
||||
if (easingParam != NULL)
|
||||
{
|
||||
period = easingParam[0];
|
||||
}
|
||||
|
||||
float newT = 0;
|
||||
if (time == 0 || time == 1)
|
||||
|
@ -360,14 +348,8 @@ float elasticEaseOut(float time, float *easingParam)
|
|||
|
||||
return newT;
|
||||
}
|
||||
float elasticEaseInOut(float time, float *easingParam)
|
||||
float elasticEaseInOut(float time, float period)
|
||||
{
|
||||
float period = 0.3f;
|
||||
|
||||
if (easingParam != NULL)
|
||||
{
|
||||
period = easingParam[0];
|
||||
}
|
||||
|
||||
float newT = 0;
|
||||
if (time == 0 || time == 1)
|
||||
|
|
|
@ -128,9 +128,9 @@ namespace tweenfunc {
|
|||
float circEaseOut(float time);
|
||||
float circEaseInOut(float time);
|
||||
|
||||
float elasticEaseIn(float time, float *easingParam);
|
||||
float elasticEaseOut(float time, float *easingParam);
|
||||
float elasticEaseInOut(float time, float *easingParam);
|
||||
float elasticEaseIn(float time, float period);
|
||||
float elasticEaseOut(float time, float period);
|
||||
float elasticEaseInOut(float time, float period);
|
||||
|
||||
float backEaseIn(float time);
|
||||
float backEaseOut(float time);
|
||||
|
|
Loading…
Reference in New Issue