コード例 #1
0
float CCTweenFunction::bounceEaseInOut(float time)
{
    float newT = 0;
    if (time < 0.5f)
    {
        time = time * 2;
        newT = (1 - bounceTime(1 - time)) * 0.5f;
    }
    else
    {
        newT = bounceTime(time * 2 - 1) * 0.5f + 0.5f;
    }

    return newT;
}
コード例 #2
0
void EaseBounceInOut::update(float time)
{
    float newT = 0;
    if (time < 0.5f)
    {
        time = time * 2;
        newT = (1 - bounceTime(1 - time)) * 0.5f;
    }
    else
    {
        newT = bounceTime(time * 2 - 1) * 0.5f + 0.5f;
    }

    m_pInner->update(newT);
}
コード例 #3
0
	void CCEaseBounceInOut::update(cocos2d::ccTime time)
	{
		ccTime newT = 0;
		if (time < 0.5f)
		{
			time = time * 2;
			newT = (1 - bounceTime(1 - time)) * 0.5f;
		}
		else
		{
			newT = bounceTime(time * 2 - 1) * 0.5f + 0.5f;
		}

		m_pOther->update(newT);
	}
コード例 #4
0
KDvoid CCEaseBounceInOut::update ( KDfloat fTime )
{
	KDfloat  fNewTime = 0;

	if ( fTime < 0.5f )
	{
		fTime = fTime * 2;
		fNewTime = (1 - bounceTime ( 1 - fTime ) ) * 0.5f;
	}
	else
	{
		fNewTime = bounceTime ( fTime * 2 - 1 ) * 0.5f + 0.5f;
	}

	m_pInner->update ( fNewTime );
}
コード例 #5
0
ファイル: wyEaseBounceOut.cpp プロジェクト: Adoni/WiEngine
void wyEaseBounceOut::update(float t) {
	// if t is 1, manually set elapsed time so isDone can return true
	if(t >= 1.0f)
		m_wrapped->setElapsed(m_wrapped->getDuration());

    float newT = bounceTime(t);
    m_wrapped->update(newT);

	// super only call callback
	wyEaseBounce::update(t);
}
コード例 #6
0
float CCTweenFunction::bounceEaseIn(float time)
{
    return 1 - bounceTime(1 - time);
}
コード例 #7
0
	void CCEaseBounceIn::update(cocos2d::ccTime time)
	{
		ccTime newT = 1 - bounceTime(1 - time);
		m_pOther->update(newT);
	}
コード例 #8
0
	void CCEaseBounceOut::update(cocos2d::ccTime time)
	{
		ccTime newT = bounceTime(time);
		m_pOther->update(newT);
	}
コード例 #9
0
void EaseBounceOut::update(float time)
{
    float newT = bounceTime(time);
    m_pInner->update(newT);
}
コード例 #10
0
KDvoid CCEaseBounceIn::update ( KDfloat fTime )
{
	KDfloat  fNewTime = 1 - bounceTime ( 1 - fTime );

	m_pInner->update ( fNewTime );
}
コード例 #11
0
KDvoid CCEaseBounceOut::update ( KDfloat fTime )
{
	KDfloat  fNewTime = bounceTime ( fTime );
	m_pInner->update ( fNewTime );
}
コード例 #12
0
void EaseBounceIn::update(float time)
{
    float newT = 1 - bounceTime(1 - time);
    m_pInner->update(newT);
}
コード例 #13
0
float CCTweenFunction::bounceEaseOut(float time)
{
    return bounceTime(time);
}
コード例 #14
0
float ActionFrameEasing::easeValue(float t)
{
	if (_type == FrameEasingType::kframeEasingInstant)
	{
		if (t < 1) return 0;
		else return 1;
	}
	else if (_type == FrameEasingType::kframeEasingLinear)
	{
		return t;
	}
	else if (_type == FrameEasingType::kframeEasingCubicIn)
	{
		float rate = _fValue;
		return powf(t,rate);
	}
	else if (_type == FrameEasingType::kframeEasingCubicOut)
	{
		float rate = _fValue;
		return powf(t,1/rate);
	}
	else if (_type == FrameEasingType::kframeEasingCubicInOut)
	{
		float rate = _fValue;
		t *= 2;
		if (t < 1)
		{
			return 0.5f * powf (t, rate);
		}
		else
		{
			return 1.0f - 0.5f * powf(2-t, rate);
		}
	}
	else if (_type == FrameEasingType::kframeEasingElasticIn)
	{
		float period = _fValue;
		float newT = 0;
		if (t == 0 || t == 1)
			newT = t;

		else {
			float s = period / 4;
			t = t - 1;
			newT = -powf(2, 10 * t) * sinf( (t-s) * M_PI_X_2 / period);
		}
		return newT;
	}
	else if (_type == FrameEasingType::kframeEasingElasticOut)
	{
		float period = _fValue;
		float newT = 0;
		if (t == 0 || t == 1) {
			newT = t;

		} else {
			float s = period / 4;
			newT = powf(2, -10 * t) * sinf( (t-s) *M_PI_X_2 / period) + 1;
		}
		return newT;
	}
	else if (_type == FrameEasingType::kframeEasingElasticInOut)
	{
		float period = _fValue;
		float newT = 0;
		if( t == 0 || t == 1 )
			newT = t;
		else {
			t = t * 2;
			if(! period )
				period = 0.3f * 1.5f;
			float s = period / 4;

			t = t -1;
			if( t < 0 )
				newT = -0.5f * powf(2, 10 * t) * sinf((t - s) * M_PI_X_2 / period);
			else
				newT = powf(2, -10 * t) * sinf((t - s) * M_PI_X_2 / period) * 0.5f + 1;
		}
		return newT;
	}
	else if (_type == FrameEasingType::kframeEasingBounceIn)
	{
		float newT = 1 - bounceTime(1-t);
		return newT;
	}
	else if (_type == FrameEasingType::kframeEasingBounceOut)
	{
		float newT = bounceTime(t);
		return newT;
	}
	else if (_type == FrameEasingType::kframeEasingBounceInOut)
	{
		float newT = 0;
		if (t < 0.5) {
			t = t * 2;
			newT = (1 - bounceTime(1-t) ) * 0.5f;
		} else
			newT = bounceTime(t * 2 - 1) * 0.5f + 0.5f;
		return newT;
	}
	else if (_type == FrameEasingType::kframeEasingBackIn)
	{
		float overshoot = 1.70158f;
		return t * t * ((overshoot + 1) * t - overshoot);
	}
	else if (_type == FrameEasingType::kframeEasingBackOut)
	{
		float overshoot = 1.70158f;
		t = t - 1;
		return t * t * ((overshoot + 1) * t + overshoot) + 1;
	}
	else if (_type == FrameEasingType::kframeEasingBackInOut)
	{
		float overshoot = 1.70158f * 1.525f;

		t = t * 2;
		if (t < 1)
			return (t * t * ((overshoot + 1) * t - overshoot)) / 2;
		else {
			t = t - 2;
			return (t * t * ((overshoot + 1) * t + overshoot)) / 2 + 1;
		}
	}

	return 0;
}
コード例 #15
0
ファイル: CCActionEase.cpp プロジェクト: csdnnet/hiygame
void CCEaseBounceOut::update(float time)
{
    float newT = bounceTime(time);
    m_pOther->update(newT);
}
コード例 #16
0
float bounceEaseOut(float time)
{
    return bounceTime(time);
}
コード例 #17
0
float bounceEaseIn(float time)
{
    return 1 - bounceTime(1 - time);
}