- Inline Degree, Radian and AngleAxis types to avoid unnecessary exports / export table lookups in using code
- Change AngleAxis to store a Radian angle for better accuracy
- Make Quaternion explicitly take a Radian as constructor
Change-Id: I81f5478572322c65f87045d1b58c621da8989d27
20 files changed:
template <>
inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
{
template <>
inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
{
- return CompareType<float>(float(q1), float(q2), epsilon);
+ return CompareType<float>(q1.radian, q2.radian, epsilon);
}
template <>
inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
{
}
template <>
inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
{
- return CompareType<float>(float(q1), float(q2), epsilon);
+ return CompareType<float>(q1.degree, q2.degree, epsilon);
}
bool operator==(TimePeriod a, TimePeriod b);
}
bool operator==(TimePeriod a, TimePeriod b);
DALI_TEST_CHECK( cluster.GetExpandedCount() == 0 );
// Transform and restore the child
DALI_TEST_CHECK( cluster.GetExpandedCount() == 0 );
// Transform and restore the child
- cluster.TransformChild(1, Vector3(10.0f, 10.0f, 1.0f), Vector3(1.0f, 1.0f, 1.0f), Quaternion(0.0f, Vector3::YAXIS), AlphaFunctions::EaseOut, 0.5f);
+ cluster.TransformChild(1, Vector3(10.0f, 10.0f, 1.0f), Vector3(1.0f, 1.0f, 1.0f), Quaternion( Radian(0.0f), Vector3::YAXIS), AlphaFunctions::EaseOut, 0.5f);
cluster.RestoreChild(1, AlphaFunctions::EaseOut, 0.25f, true);
END_TEST;
}
cluster.RestoreChild(1, AlphaFunctions::EaseOut, 0.25f, true);
END_TEST;
}
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(true);
Wait( application, TRANSITION_DURATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(true);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
Wait( application, TRANSITION_DURATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(false);
Wait( application, TRANSITION_DURATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(false);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
Wait( application, TRANSITION_DURATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.SetTargetImage( imageActor );
waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(true);
Wait( application, TRANSITION_DURATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(true);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
Wait( application, TRANSITION_DURATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(false);
Wait( application, TRANSITION_DURATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(false);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
Wait( application, TRANSITION_DURATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.SetTargetImage( imageActor );
crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(true);
Wait( application, TRANSITION_DURATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(true);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
Wait( application, TRANSITION_DURATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(false);
Wait( application, TRANSITION_DURATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(false);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(),fullBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
Wait( application, TRANSITION_DURATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(),fullBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.SetTargetImage( imageActor );
foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
Wait( application, TRANSITION_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
END_TEST;
depthLayout->SetTiltAngle(Degree(25.0f));
// Check whether we get the correct tilt angle
depthLayout->SetTiltAngle(Degree(25.0f));
// Check whether we get the correct tilt angle
- DALI_TEST_EQUALS(float(depthLayout->GetTiltAngle()), 25.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS(depthLayout->GetTiltAngle(), Degree(25.0f), 0.001f, TEST_LOCATION );
depthLayout->SetItemTiltAngle(Degree(5.0f));
// Check whether we get the correct item's tilt angle
depthLayout->SetItemTiltAngle(Degree(5.0f));
// Check whether we get the correct item's tilt angle
- DALI_TEST_EQUALS(float(depthLayout->GetItemTiltAngle()), 5.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS(depthLayout->GetItemTiltAngle(), Degree(5.0f), 0.001f, TEST_LOCATION );
application.Render();
Degree deg = layout->GetScrollDirection();
application.Render();
Degree deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 180.0f);
+ DALI_TEST_CHECK(deg.degree == 180.0f);
navigationLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
navigationLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK((deg == 0.0f));
+ DALI_TEST_CHECK((deg.degree == 0.0f));
layout->SetOrientation(ControlOrientation::Left);
view.ActivateLayout(0, vec, 0.0f);
layout->SetOrientation(ControlOrientation::Left);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 270.0f);
+ DALI_TEST_CHECK(deg.degree == 270.0f);
navigationLayout->SetOrientation(ControlOrientation::Right);
view.ActivateLayout(0, vec, 0.0f);
navigationLayout->SetOrientation(ControlOrientation::Right);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 90.0f);
+ DALI_TEST_CHECK(deg.degree == 90.0f);
Stage::GetCurrent().Remove(view);
END_TEST;
Stage::GetCurrent().Remove(view);
END_TEST;
application.Render();
Degree deg = layout->GetScrollDirection();
application.Render();
Degree deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 0.0f);
+ DALI_TEST_CHECK(deg.degree == 0.0f);
gridLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
gridLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK((deg == 180.0f));
+ DALI_TEST_CHECK((deg.degree == 180.0f));
layout->SetOrientation(ControlOrientation::Left);
view.ActivateLayout(0, vec, 0.0f);
layout->SetOrientation(ControlOrientation::Left);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 90.f);
+ DALI_TEST_CHECK(deg.degree == 90.f);
gridLayout->SetOrientation(ControlOrientation::Right);
view.ActivateLayout(0, vec, 0.0f);
gridLayout->SetOrientation(ControlOrientation::Right);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 270.0f);
+ DALI_TEST_CHECK(deg.degree == 270.0f);
Stage::GetCurrent().Remove(view);
END_TEST;
Stage::GetCurrent().Remove(view);
END_TEST;
spiralLayout->SetItemSpacing(Radian(0.6f));
// Check whether we get the correct item spacing
spiralLayout->SetItemSpacing(Radian(0.6f));
// Check whether we get the correct item spacing
- DALI_TEST_EQUALS(spiralLayout->GetItemSpacing(), 0.6f, TEST_LOCATION );
+ DALI_TEST_EQUALS(spiralLayout->GetItemSpacing(), Radian(0.6f), TEST_LOCATION );
application.Render();
Degree deg = layout->GetScrollDirection();
application.Render();
Degree deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == -45.0f);
+ DALI_TEST_CHECK(deg.degree == -45.0f);
navigationLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
navigationLayout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK((deg == 180.0f - 45.0f));
+ DALI_TEST_CHECK((deg.degree == 180.0f - 45.0f));
layout->SetOrientation(ControlOrientation::Left);
view.ActivateLayout(0, vec, 0.0f);
layout->SetOrientation(ControlOrientation::Left);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == 45.0f);
+ DALI_TEST_CHECK(deg.degree == 45.0f);
navigationLayout->SetOrientation(ControlOrientation::Right);
view.ActivateLayout(0, vec, 0.0f);
navigationLayout->SetOrientation(ControlOrientation::Right);
view.ActivateLayout(0, vec, 0.0f);
application.Render();
deg = layout->GetScrollDirection();
application.Render();
deg = layout->GetScrollDirection();
- DALI_TEST_CHECK(deg == (270.0f - 45.0f));
+ DALI_TEST_CHECK(deg.degree == (270.0f - 45.0f));
Stage::GetCurrent().Remove(view);
END_TEST;
Stage::GetCurrent().Remove(view);
END_TEST;
const float angle = (rand()%360) * Math::PI / 180.0f;
Vector3 position(sin(angle) * length, -cos(angle) * length, zOffset);
const float scale(1.2f);
const float angle = (rand()%360) * Math::PI / 180.0f;
Vector3 position(sin(angle) * length, -cos(angle) * length, zOffset);
const float scale(1.2f);
- const float rotate = ((rand()%30) - 15) * Math::PI / 180.0f;
+ const Radian rotate( Degree( (rand()%30) - 15 ) );
position += childInfo.mActor.GetCurrentPosition();
position += childInfo.mActor.GetCurrentPosition();
unsigned int index = attributes[0].Get<float>();
Vector3 position;
Vector3 scale(Vector3::ONE);
unsigned int index = attributes[0].Get<float>();
Vector3 position;
Vector3 scale(Vector3::ONE);
- Quaternion rotation(0.0f, Vector3::ZAXIS);
+ Quaternion rotation( Dali::ANGLE_0, Vector3::ZAXIS );
DALI_ASSERT_ALWAYS(attributes[1].GetType() == Property::VECTOR3);
attributes[1].Get(position);
DALI_ASSERT_ALWAYS(attributes[1].GetType() == Property::VECTOR3);
attributes[1].Get(position);
Apply( child,
FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ),
FirstOrderEquation( GetClusterSize(), Vector3::ONE * size),
Apply( child,
FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ),
FirstOrderEquation( GetClusterSize(), Vector3::ONE * size),
- Quaternion(rotation, Vector3::ZAXIS),
+ Quaternion( Radian( rotation ), Vector3::ZAXIS ),
Vector3::ONE,
alpha,
durationSeconds);
Vector3::ONE,
alpha,
durationSeconds);
mStep = 1.f / pageWidth;
mSign = isTurnBack ? -1.0f : 1.0f;
mConst = isTurnBack ? -1.0f : 0.f;
mStep = 1.f / pageWidth;
mSign = isTurnBack ? -1.0f : 1.0f;
mConst = isTurnBack ? -1.0f : 0.f;
- mRotation = isTurnBack ? Quaternion( -Math::PI, Vector3::YAXIS ) : Quaternion( 0.f, Vector3::YAXIS );
+ mRotation = isTurnBack ? Quaternion( Radian( -Math::PI ), Vector3::YAXIS ) : Quaternion( Radian(0.f), Vector3::YAXIS );
}
void operator()( Quaternion& current, const PropertyInputContainer& inputs )
}
void operator()( Quaternion& current, const PropertyInputContainer& inputs )
{
float coef = std::max(-1.0f, mStep*(mDistance-displacement));
float angle = Math::PI * ( mConst + mSign * coef );
{
float coef = std::max(-1.0f, mStep*(mDistance-displacement));
float angle = Math::PI * ( mConst + mSign * coef );
- current = Quaternion( angle, Vector3::YAXIS );
+ current = Quaternion( Radian( angle ), Vector3::YAXIS );
if( (mVertical && Toolkit::IsVertical(orientation)) || (!mVertical && Toolkit::IsHorizontal(orientation)) )
{
if( (mVertical && Toolkit::IsVertical(orientation)) || (!mVertical && Toolkit::IsHorizontal(orientation)) )
{
- current = Quaternion(0.0f, Vector3::ZAXIS);
+ current = Quaternion( Radian( 0.0f ), Vector3::ZAXIS );
- current = Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
+ current = Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS);
const Vector3 parentSize = self.GetCurrentSize();
if(IsVertical())
{
const Vector3 parentSize = self.GetCurrentSize();
if(IsVertical())
{
- mOvershootOverlay.SetOrientation(Quaternion(0.0f, Vector3::ZAXIS));
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) );
mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
}
else
{
mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
}
else
{
- mOvershootOverlay.SetOrientation(Quaternion(1.5f * Math::PI, Vector3::ZAXIS));
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
}
mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
}
const Vector3 parentSize = self.GetCurrentSize();
if(IsVertical())
{
const Vector3 parentSize = self.GetCurrentSize();
if(IsVertical())
{
- mOvershootOverlay.SetOrientation(Quaternion(Math::PI, Vector3::ZAXIS));
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( Math::PI ), Vector3::ZAXIS ) );
mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
}
else
{
mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
}
else
{
- mOvershootOverlay.SetOrientation(Quaternion(0.5f * Math::PI, Vector3::ZAXIS));
+ mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS ) );
mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
}
mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
}
- current = Quaternion(-angle.x, Vector3::YAXIS) *
- Quaternion(angle.y, Vector3::XAXIS) *
+ current = Quaternion( Radian( -angle.x ), Vector3::YAXIS ) *
+ Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
Vector2 angle( Clamp(position.x, -1.0f,1.0f),
Clamp(position.y, -1.0f,1.0f) );
Vector2 angle( Clamp(position.x, -1.0f,1.0f),
Clamp(position.y, -1.0f,1.0f) );
- current = Quaternion( angle.x * mAngleSwing.x, Vector3::YAXIS) *
- Quaternion(-angle.y * mAngleSwing.y, Vector3::XAXIS) *
- current;
+ current = Quaternion( Radian( angle.x * mAngleSwing.x ), Vector3::YAXIS ) *
+ Quaternion( Radian( -angle.y * mAngleSwing.y ), Vector3::XAXIS ) *
+ current;
// Rotate position (current) about point.
Vector3 position = current - mAnchor;
// Rotate position (current) about point.
Vector3 position = current - mAnchor;
- Quaternion rotatorY(angle.x, Vector3::YAXIS);
+ Quaternion rotatorY( Radian( angle.x ), Vector3::YAXIS);
position = rotatorY.Rotate(position);
position = rotatorY.Rotate(position);
- Quaternion rotatorX(-angle.y, Vector3::XAXIS);
+ Quaternion rotatorX( Radian( -angle.y ), Vector3::XAXIS);
position = rotatorX.Rotate(position);
position += mAnchor;
position += relativePosition * mPositionSwing;
position = rotatorX.Rotate(position);
position += mAnchor;
position += relativePosition * mPositionSwing;
// our page by calculating the amount we've moved as a fraction of the total size of the page.
Vector2 angle( position / pageSize * Dali::Math::PI_2 );
// our page by calculating the amount we've moved as a fraction of the total size of the page.
Vector2 angle( position / pageSize * Dali::Math::PI_2 );
- current = Quaternion( -angle.x * mAngleSwing.x, Vector3::YAXIS ) *
- Quaternion( angle.y * mAngleSwing.y, Vector3::XAXIS ) *
+ current = Quaternion( Radian( -angle.x * mAngleSwing.x ), Vector3::YAXIS ) *
+ Quaternion( Radian( angle.y * mAngleSwing.y ), Vector3::XAXIS ) *
}
ClampInPlace( angle.y, -angleMaxMin.y, angleMaxMin.y );
}
ClampInPlace( angle.y, -angleMaxMin.y, angleMaxMin.y );
- current = Quaternion( angle.x, Vector3::YAXIS ) *
- Quaternion( angle.y, Vector3::XAXIS ) *
+ current = Quaternion( Radian( angle.x ), Vector3::YAXIS ) *
+ Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse )
{
void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse )
{
- mOrientationFunction[View::PORTRAIT] = portrait;
- mOrientationFunction[View::LANDSCAPE] = landscale;
- mOrientationFunction[View::PORTRAIT_INVERSE] = portraitInverse;
- mOrientationFunction[View::LANDSCAPE_INVERSE] = landscapeInverse;
+ mOrientationFunction[View::PORTRAIT] = portrait.degree;
+ mOrientationFunction[View::LANDSCAPE] = landscale.degree;
+ mOrientationFunction[View::PORTRAIT_INVERSE] = portraitInverse.degree;
+ mOrientationFunction[View::LANDSCAPE_INVERSE] = landscapeInverse.degree;
}
void View::OrientationChanged( Dali::Orientation orientation )
}
void View::OrientationChanged( Dali::Orientation orientation )
// has parent so we expect it to be on stage
mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION );
// has parent so we expect it to be on stage
mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION );
- mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( -orientation.GetRadians(), Vector3::ZAXIS ), AlphaFunctions::EaseOut );
+ mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( -orientation.GetRadians() ), Vector3::ZAXIS ), AlphaFunctions::EaseOut );
// Resize the view
if( mFullScreen )
// Resize the view
if( mFullScreen )
{
View::Orientation orientation = PORTRAIT;
{
View::Orientation orientation = PORTRAIT;
- if( fabsf( mOrientationFunction[PORTRAIT] - degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT], degree ) )
+ if( fabsf( mOrientationFunction[PORTRAIT] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT], degree.degree ) )
{
orientation = PORTRAIT;
}
{
orientation = PORTRAIT;
}
- else if( fabsf( mOrientationFunction[LANDSCAPE] - degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE], degree ) )
+ else if( fabsf( mOrientationFunction[LANDSCAPE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE], degree.degree ) )
{
orientation = LANDSCAPE;
}
{
orientation = LANDSCAPE;
}
- else if( fabsf( mOrientationFunction[PORTRAIT_INVERSE] - degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT_INVERSE], degree ) )
+ else if( fabsf( mOrientationFunction[PORTRAIT_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT_INVERSE], degree.degree ) )
{
orientation = PORTRAIT_INVERSE;
}
{
orientation = PORTRAIT_INVERSE;
}
- else if( fabsf( mOrientationFunction[LANDSCAPE_INVERSE] - degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE_INVERSE], degree ) )
+ else if( fabsf( mOrientationFunction[LANDSCAPE_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE_INVERSE], degree.degree ) )
{
orientation = LANDSCAPE_INVERSE;
}
{
orientation = LANDSCAPE_INVERSE;
}
struct DepthRotationConstraint0
{
struct DepthRotationConstraint0
{
- DepthRotationConstraint0(float angleRadians)
+ DepthRotationConstraint0(Radian angleRadians)
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(0.0f, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+ return Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) * Quaternion( mTiltAngle, Vector3::XAXIS );
};
struct DepthRotationConstraint90
{
};
struct DepthRotationConstraint90
{
- DepthRotationConstraint90(float angleRadians)
+ DepthRotationConstraint90(Radian angleRadians)
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(1.5f * Math::PI, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+ return Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
};
struct DepthRotationConstraint180
{
};
struct DepthRotationConstraint180
{
- DepthRotationConstraint180(float angleRadians)
+ DepthRotationConstraint180(Radian angleRadians)
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(-Math::PI, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+ return Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
};
struct DepthRotationConstraint270
{
};
struct DepthRotationConstraint270
{
- DepthRotationConstraint270(float angleRadians)
+ DepthRotationConstraint270(Radian angleRadians)
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
: mTiltAngle(angleRadians)
{
}
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(0.5f * Math::PI, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+ return Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
};
struct DepthColorConstraint
};
struct DepthColorConstraint
void DepthLayout::SetTiltAngle(Degree angle)
{
void DepthLayout::SetTiltAngle(Degree angle)
{
- mImpl->mTiltAngle = Degree( Clamp<float>(angle, -45.0f, 45.0f) );
+ mImpl->mTiltAngle = Degree( Clamp( angle, -45.0f, 45.0f ) );
}
Degree DepthLayout::GetTiltAngle() const
{
}
Degree DepthLayout::GetTiltAngle() const
{
- return mImpl->mTiltAngle;
+ return Degree( mImpl->mTiltAngle );
}
void DepthLayout::SetItemSizeFunction(ItemSizeFunction function)
}
void DepthLayout::SetItemSizeFunction(ItemSizeFunction function)
Degree DepthLayout::GetItemTiltAngle() const
{
Degree DepthLayout::GetItemTiltAngle() const
{
- return mImpl->mItemTiltAngle;
+ return Degree( mImpl->mItemTiltAngle );
}
void DepthLayout::SetColumnPositionFunction(ColumnPositionFunction function)
}
void DepthLayout::SetColumnPositionFunction(ColumnPositionFunction function)
if (mOrientation == ControlOrientation::Up)
{
if (mOrientation == ControlOrientation::Up)
{
- scrollDirection = 180.0f;
+ scrollDirection = Degree( 180.0f );
}
else if (mOrientation == ControlOrientation::Left)
{
}
else if (mOrientation == ControlOrientation::Left)
{
- scrollDirection = 270.0f;
+ scrollDirection = Degree( 270.0f );
}
else if (mOrientation == ControlOrientation::Down)
{
}
else if (mOrientation == ControlOrientation::Down)
{
- scrollDirection = 0.0f;
+ scrollDirection = Degree( 0.0f );
}
else // mOrientation == ControlOrientation::Right
{
}
else // mOrientation == ControlOrientation::Right
{
- scrollDirection = 90.0f;
+ scrollDirection = Degree( 90.0f );
}
return scrollDirection;
}
return scrollDirection;
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(0.0f, Vector3::ZAXIS);
+ return Quaternion( Radian( 0.0f ), Vector3::ZAXIS);
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(1.5f * Math::PI, Vector3::ZAXIS);
+ return Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS);
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(Math::PI, Vector3::ZAXIS);
+ return Quaternion( Radian( Math::PI ), Vector3::ZAXIS);
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
{
Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- return Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
+ return Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS);
if (mOrientation == ControlOrientation::Up)
{
if (mOrientation == ControlOrientation::Up)
{
- scrollDirection = 0.0f;
+ scrollDirection = Degree( 0.0f );
}
else if (mOrientation == ControlOrientation::Left)
{
}
else if (mOrientation == ControlOrientation::Left)
{
- scrollDirection = 90.0f;
+ scrollDirection = Degree( 90.0f );
}
else if (mOrientation == ControlOrientation::Down)
{
}
else if (mOrientation == ControlOrientation::Down)
{
- scrollDirection = 180.0f;
+ scrollDirection = Degree( 180.0f );
}
else // mOrientation == ControlOrientation::Right
{
}
else // mOrientation == ControlOrientation::Right
{
- scrollDirection = 270.0f;
+ scrollDirection = Degree( 270.0f );
}
return scrollDirection;
}
return scrollDirection;
{
float angle = -mItemSpacingRadians * layoutPosition;
{
float angle = -mItemSpacingRadians * layoutPosition;
- return Quaternion(angle, Vector3::YAXIS);
+ return Quaternion( Radian( angle ), Vector3::YAXIS);
}
float mItemSpacingRadians;
}
float mItemSpacingRadians;
{
float angle = -mItemSpacingRadians * layoutPosition;
{
float angle = -mItemSpacingRadians * layoutPosition;
- return Quaternion(-Math::PI*0.5f, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
+ return Quaternion( Radian( -Math::PI * 0.5f ), Vector3::ZAXIS ) * Quaternion( Radian( angle ), Vector3::YAXIS );
}
float mItemSpacingRadians;
}
float mItemSpacingRadians;
{
float angle = -mItemSpacingRadians * layoutPosition;
{
float angle = -mItemSpacingRadians * layoutPosition;
- return Quaternion(-Math::PI, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
+ return Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
}
float mItemSpacingRadians;
}
float mItemSpacingRadians;
{
float angle = -mItemSpacingRadians * layoutPosition;
{
float angle = -mItemSpacingRadians * layoutPosition;
- return Quaternion(-Math::PI*1.5f, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
+ return Quaternion( Radian( -Math::PI * 1.5f ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
}
float mItemSpacingRadians;
}
float mItemSpacingRadians;
Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
{
- Degree angle = Radian(mItemSpacingRadians * fabsf(layoutPosition));
- angle = (float)((int)angle % 360);
+ Radian angle( mItemSpacingRadians * fabsf(layoutPosition) / Dali::ANGLE_360 );
- float progress = angle / 360.0f;
+ float progress = angle - floorf( angle ); // take fractional bit only to get between 0.0 - 1.0
progress = (progress > 0.5f) ? 2.0f*(1.0f - progress) : progress*2.0f;
float darkness(1.0f);
progress = (progress > 0.5f) ? 2.0f*(1.0f - progress) : progress*2.0f;
float darkness(1.0f);
if (mOrientation == ControlOrientation::Up)
{
if (mOrientation == ControlOrientation::Up)
{
- scrollDirection = 0.0f - 45.0f; // Allow swiping horizontally & vertically
+ scrollDirection = Degree( -45.0f ); // Allow swiping horizontally & vertically
}
else if (mOrientation == ControlOrientation::Left)
{
}
else if (mOrientation == ControlOrientation::Left)
{
- scrollDirection = 90.0f - 45.0f;
+ scrollDirection = Degree( 45.0f );
}
else if (mOrientation == ControlOrientation::Down)
{
}
else if (mOrientation == ControlOrientation::Down)
{
- scrollDirection = 180.0f - 45.0f;
+ scrollDirection = Degree( 180.0f - 45.0f );
}
else // mOrientation == ControlOrientation::Right
{
}
else // mOrientation == ControlOrientation::Right
{
- scrollDirection = 270.0f - 45.0f;
+ scrollDirection = Degree( 270.0f - 45.0f );
}
return scrollDirection;
}
return scrollDirection;
else if(field == "axis")
{
Dali::Vector3 axis;
else if(field == "axis")
{
Dali::Vector3 axis;
value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
ret = PropertyValueWrapper::WrapDaliProperty( isolate , Dali::Property::Value( axis ) );
}
else if(field == "angle")
{
Dali::Vector3 axis;
value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
ret = PropertyValueWrapper::WrapDaliProperty( isolate , Dali::Property::Value( axis ) );
}
else if(field == "angle")
{
Dali::Vector3 axis;
value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
ret = PropertyValueWrapper::WrapDaliProperty( isolate , Dali::Property::Value( angle ) );
}
value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
ret = PropertyValueWrapper::WrapDaliProperty( isolate , Dali::Property::Value( angle ) );
}
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
v4.z = asFloat;
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
v4.z = asFloat;
- value = Dali::Quaternion(v4.x, v4.y, v4.z);
+ value = Dali::Quaternion( Radian(Degree(v4.x)), Radian(Degree(v4.y)), Radian(Degree(v4.z)) );
}
else if(field == "pitch")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
v4.x = asFloat;
}
else if(field == "pitch")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
v4.x = asFloat;
- value = Dali::Quaternion(v4.x, v4.y, v4.z);
+ value = Dali::Quaternion( Radian(Degree(v4.x)), Radian(Degree(v4.y)), Radian(Degree(v4.z)) );
}
else if(field == "yaw")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
v4.y = asFloat;
}
else if(field == "yaw")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
v4.y = asFloat;
- value = Dali::Quaternion(v4.x, v4.y, v4.z);
+ value = Dali::Quaternion( Radian(Degree(v4.x)), Radian(Degree(v4.y)), Radian(Degree(v4.z)) );
}
else if(field == "axis")
{
Dali::Vector3 axis;
}
else if(field == "axis")
{
Dali::Vector3 axis;
value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
if( v8Value->IsObject() )
value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
if( v8Value->IsObject() )
else if(field == "angle")
{
Dali::Vector3 axis;
else if(field == "angle")
{
Dali::Vector3 axis;
- float angle;
- value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
- value = Dali::Quaternion(asFloat, axis);
+ Radian angle;
+ value.Get<Dali::Quaternion>().ToAxisAngle( axis, angle );
+ value = Dali::Quaternion( Radian( Degree( asFloat ) ), axis );
}
else if(array.GetType() == Dali::Property::VECTOR3)
{
}
else if(array.GetType() == Dali::Property::VECTOR3)
{
+ // v3 treated as euler in degrees
Dali::Vector3 v = array.Get<Dali::Vector3>();
Dali::Vector3 v = array.Get<Dali::Vector3>();
- daliPropertyValue = Dali::Quaternion(v[0], v[1], v[2]);
+ daliPropertyValue = Dali::Quaternion( Radian(Degree(v[0])), Radian(Degree(v[1])), Radian(Degree(v[2])) );
bool foundAllArguments(false);
V8Utils::ReadFloatArguments( foundAllArguments, v, 4, args, 0.f );
bool foundAllArguments(false);
V8Utils::ReadFloatArguments( foundAllArguments, v, 4, args, 0.f );
- int len = args.Length();
+ int length = args.Length();
// if length = 4 create AngleAxis, else create Quaternion
// if length = 4 create AngleAxis, else create Quaternion
- Dali::AngleAxis axis( Dali::Degree(v[0] ), Dali::Vector3(v[1], v[2], v[3]) );
- object = WrapDaliProperty( isolate , Dali::Property::Value( axis ) );
+ Dali::AngleAxis axis( Degree( v[0] ), Vector3(v[1], v[2], v[3]) );
+ object = WrapDaliProperty( isolate, Dali::Property::Value( axis ) );
- Dali::Quaternion quaternion( v[0], v[1], v[2] );
- object = WrapDaliProperty( isolate , Dali::Property::Value( quaternion ) );
+ object = WrapDaliProperty( isolate, Dali::Property::Value( Dali::Quaternion( Radian( Degree(v[0]) ), Radian( Degree(v[1]) ), Radian( Degree(v[2]) ) ) ) );
- Dali::Quaternion quaternion( Dali::Quaternion(0.f, Dali::Vector4::YAXIS));
- object = WrapDaliProperty( isolate , Dali::Property::Value( quaternion ) );
+ Dali::Quaternion quaternion( Dali::Quaternion( Dali::ANGLE_0, Dali::Vector3::YAXIS));
+ object = WrapDaliProperty( isolate, Dali::Property::Value( quaternion ) );
}
args.GetReturnValue().Set( object );
}
args.GetReturnValue().Set( object );