// Start the animation
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
animation.Play();
bool signalReceived(false);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.SetLooping(true);
DALI_TEST_CHECK(animation.GetEndAction() == Animation::Bake);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BakeFinal);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
animation.SetDisconnectAction( Animation::Bake );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
animation.SetDisconnectAction( Animation::Discard );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*0.5f*1000.0f)/*Only half the animation*/);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
animation.SetDisconnectAction( Animation::Discard );
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
//PlayFrom with an argument outside the range [0..1] will be ignored
animation.PlayFrom(-1.0f);
application.SendNotification();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
//Trying to set the current cursor outside the range [0..1] is ignored
animation.SetCurrentProgress( -1.0f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
finishCheck.Reset();
actor.SetPosition(Vector3::ZERO);
Vector3 targetScale(3.0f, 3.0f, 3.0f);
- animation.ScaleTo(actor, targetScale, AlphaFunctions::Linear);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::Linear );
animation.Play();
application.SendNotification();
}
-int UtcDaliAnimationMoveByFloat3(void)
+int UtcDaliAnimationAnimateByPropertyPositionVector3(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.MoveBy(actor, relativePosition.x, relativePosition.y, relativePosition.z);
+ animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( relativePosition.x, relativePosition.y, relativePosition.z ) );
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
END_TEST;
}
-int UtcDaliAnimationMoveByVector3Alpha(void)
+int UtcDaliAnimationAnimateByPropertyPositionVector3Alpha(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.MoveBy(actor, relativePosition, AlphaFunctions::EaseOut);
+ animation.AnimateBy( Property( actor, Actor::Property::POSITION ), relativePosition, AlphaFunctions::EaseOut );
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
END_TEST;
}
-int UtcDaliAnimationMoveByVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateByPropertyPositionVector3AlphaTimePeriod(void)
{
TestApplication application;
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
float delay = 0.5f;
- animation.MoveBy(actor, relativePosition, AlphaFunctions::Linear, delay, durationSeconds - delay);
-
- Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationMoveToFloat3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.MoveTo(actor, targetPosition.x, targetPosition.y, targetPosition.z);
-
- Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*750.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationMoveToVector3Alpha(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::EaseIn);
-
- Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*750.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
-
- // The position should have moved less, than with a linear alpha function
- Vector3 current(actor.GetCurrentPosition());
- DALI_TEST_CHECK( current.x > Vector3::ZERO.x );
- DALI_TEST_CHECK( current.y > Vector3::ZERO.y );
- DALI_TEST_CHECK( current.z > Vector3::ZERO.z );
- DALI_TEST_CHECK( current.x < seventyFivePercentProgress.x );
- DALI_TEST_CHECK( current.y < seventyFivePercentProgress.y );
- DALI_TEST_CHECK( current.z < seventyFivePercentProgress.z );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationMoveToVector3AlphaFloat2(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- float delay = 0.5f;
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear, delay, durationSeconds - delay);
-
- Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.75)/* 7/8 animation progress, 3/4 animator progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.25) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByDegreeVector3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationDegrees/*Degree version*/, Vector3::YAXIS);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByRadianVector3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationRadians/*Radian version*/, Vector3::YAXIS);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByDegreeVector3Alpha(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByRadianVector3Alpha(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByDegreeVector3AlphaFloat2(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- float delay = 0.3f;
- animation.RotateBy(actor, relativeRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ animation.AnimateBy( Property( actor, Actor::Property::POSITION ), relativePosition, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, TEST_LOCATION );
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-
-int UtcDaliAnimationRotateByRadianVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyPositionVector3(void)
{
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- float delay = 0.3f;
- animation.RotateBy(actor, relativeRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateToDegreeVector3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ Vector3 targetPosition(200.0f, 200.0f, 200.0f);
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( targetPosition.x, targetPosition.y, targetPosition.z ) );
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationDegrees/*Degree version*/, Vector3::YAXIS);
+ Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
+ application.Render(static_cast<unsigned int>(durationSeconds*750.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToRadianVector3(void)
+int UtcDaliAnimationAnimateToPropertyPositionVector3Alpha(void)
{
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationRadians/*Radian version*/, Vector3::YAXIS);
+ Vector3 targetPosition(200.0f, 200.0f, 200.0f);
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunctions::EaseIn );
+
+ Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
+ application.Render(static_cast<unsigned int>(durationSeconds*750.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ // The position should have moved less, than with a linear alpha function
+ Vector3 current(actor.GetCurrentPosition());
+ DALI_TEST_CHECK( current.x > Vector3::ZERO.x );
+ DALI_TEST_CHECK( current.y > Vector3::ZERO.y );
+ DALI_TEST_CHECK( current.z > Vector3::ZERO.z );
+ DALI_TEST_CHECK( current.x < seventyFivePercentProgress.x );
+ DALI_TEST_CHECK( current.y < seventyFivePercentProgress.y );
+ DALI_TEST_CHECK( current.z < seventyFivePercentProgress.z );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToQuaternion(void)
+int UtcDaliAnimationAnimateToPropertyPositionVector3AlphaTimePeriod(void)
{
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.RotateTo(actor, targetRotation/*Quaternion version*/);
+ Vector3 targetPosition(200.0f, 200.0f, 200.0f);
+ float delay = 0.5f;
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
+
+ Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.75)/* 7/8 animation progress, 3/4 animator progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION );
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.25) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToDegreeVector3Alpha(void)
+int UtcDaliAnimationAnimateByPropertyOrientationQuaternion(void)
{
TestApplication application;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
+ Degree relativeRotationDegrees(360.0f);
+ Radian relativeRotationRadians(relativeRotationDegrees);
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ) );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToRadianVector3Alpha(void)
+int UtcDaliAnimationAnimateByPropertyOrientationQuaternionAlpha(void)
{
TestApplication application;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
+ Degree relativeRotationDegrees(360.0f);
+ Radian relativeRotationRadians(relativeRotationDegrees);
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ), AlphaFunctions::EaseIn );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToQuaternionAlpha(void)
+int UtcDaliAnimationAnimateByPropertyOrientationQuaternionAlphaTimePeriod(void)
{
TestApplication application;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.RotateTo(actor, targetRotation/*Quaternion version*/, AlphaFunctions::EaseIn);
+ Degree relativeRotationDegrees(360.0f);
+ Radian relativeRotationRadians(relativeRotationDegrees);
+ float delay = 0.3f;
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ),
+ AlphaFunctions::EaseIn, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToDegreeVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyOrientationQuaternion(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- float delay(0.1f);
- animation.RotateTo(actor, targetRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
+ animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), targetRotation );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
END_TEST;
}
-int UtcDaliAnimationRotateToRadianVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyOrientationQuaternionAlpha(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- float delay(0.1f);
- animation.RotateTo(actor, targetRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
+ animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), targetRotation, AlphaFunctions::EaseIn );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
END_TEST;
}
-int UtcDaliAnimationRotateToQuaternionAlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyOrientationQuaternionAlphaTimePeriod(void)
{
TestApplication application;
Radian targetRotationRadians(targetRotationDegrees);
float delay(0.1f);
Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.RotateTo(actor, targetRotation/*Quaternion version*/, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), targetRotation, AlphaFunctions::EaseIn, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
END_TEST;
}
-int UtcDaliAnimationScaleBy(void)
+int UtcDaliAnimationAnimateByPropertyScale(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetScale(2.0f, 2.0f, 2.0f);
Vector3 relativeScale(targetScale - Vector3::ONE);
- animation.ScaleBy(actor, relativeScale.x, relativeScale.y, relativeScale.z);
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), Vector3( relativeScale.x, relativeScale.y, relativeScale.z ) );
Vector3 ninetyNinePercentProgress(Vector3::ONE + relativeScale*0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.ScaleBy(actor, relativeScale, AlphaFunctions::EaseIn);
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.ScaleBy(actor, relativeScale, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationScaleTo(void)
+int UtcDaliAnimationAnimateToPropertyScale(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetScale(2.0f, 2.0f, 2.0f);
- animation.ScaleTo(actor, targetScale.x, targetScale.y, targetScale.z);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale );
Vector3 ninetyNinePercentProgress(Vector3::ONE + (targetScale - Vector3::ONE)*0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.ScaleTo(actor, targetScale, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.ScaleTo(actor, targetScale, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationOpacityTo(void)
+int UtcDaliAnimationAnimateToPropertyColorAlpha(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetOpacity(0.0f);
- animation.OpacityTo(actor, targetOpacity);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), targetOpacity );
float ninetyNinePercentProgress(0.01f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.OpacityTo(actor, targetOpacity, AlphaFunctions::EaseIn);
+ animation.AnimateTo(Property( actor, Actor::Property::COLOR_ALPHA ), targetOpacity, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.OpacityTo(actor, targetOpacity, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), targetOpacity, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationColorTo(void)
+int UtcDaliAnimationAnimateToPropertyColor(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector4 targetColor(Color::RED);
- animation.ColorTo(actor, targetColor);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR ), targetColor );
Vector4 tenPercentProgress(Vector4(1.0f, 0.9f, 0.9f, 1.0f));
Vector4 twentyPercentProgress(Vector4(1.0f, 0.8f, 0.8f, 1.0f));
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.ColorTo(actor, targetColor, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR ), targetColor, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a shorter animator duration
float animatorDuration = 0.5f;
animation = Animation::New(durationSeconds);
- animation.ColorTo(actor, targetColor, AlphaFunctions::Linear, 0, animatorDuration);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR ), targetColor, AlphaFunctions::Linear, TimePeriod( 0, animatorDuration ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationResize(void)
+int UtcDaliAnimationAnimateToPropertySize(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetSize(100.0f, 100.0f, 100.0f);
- animation.Resize(actor, targetSize);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize);
Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationResizeByXY(void)
+int UtcDaliAnimationAnimateToPropertySizeByXY(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetSize(100.0f, 100.0f, 100.0f);
- animation.Resize(actor, targetSize);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize );
Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize.x, targetSize.y, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetSize.x, AlphaFunctions::EaseIn );
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetSize.y, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
Vector3 current(actor.GetCurrentSize());
DALI_TEST_CHECK( current.x > 0.0f );
DALI_TEST_CHECK( current.y > 0.0f );
- DALI_TEST_CHECK( current.z > 0.0f );
DALI_TEST_CHECK( current.x < ninetyNinePercentProgress.x );
DALI_TEST_CHECK( current.y < ninetyNinePercentProgress.y );
- DALI_TEST_CHECK( current.z < ninetyNinePercentProgress.z );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().x, targetSize.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().y, targetSize.y, TEST_LOCATION );
// Reset everything
finishCheck.Reset();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize.x, targetSize.y, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetSize.x, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetSize.y, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().x, targetSize.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().y, targetSize.y, TEST_LOCATION );
END_TEST;
}
-
int UtcDaliAnimationAnimateBetweenActorColorTimePeriod(void)
{
TestApplication application;