From: György Straub Date: Wed, 30 Dec 2020 16:40:53 +0000 (+0000) Subject: scene-loader.example fixes. X-Git-Tag: dali_2.0.8~7 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=15b2dcc5584bbd91668948108a4241f7ca3a742a scene-loader.example fixes. - main() is exported using DALI_EXPORT_API, so that Android may see it; - refined rotation code and made the scaling factor a more meaningful quantity; Change-Id: I1c61f27a2bd7ce402eac34df8b393269371ca61d Signed-off-by: György Straub --- diff --git a/examples/scene-loader/main.cpp b/examples/scene-loader/main.cpp index a0c8158..c87244a 100644 --- a/examples/scene-loader/main.cpp +++ b/examples/scene-loader/main.cpp @@ -20,7 +20,7 @@ using namespace Dali; -int main(int argc, char** argv) +int DALI_EXPORT_API main(int argc, char** argv) { auto app = Application::New(&argc, &argv, DEMO_THEME_PATH); SceneLoaderExample sceneLoader(app); diff --git a/examples/scene-loader/scene-loader-example.cpp b/examples/scene-loader/scene-loader-example.cpp index 64b31a5..90df3da 100644 --- a/examples/scene-loader/scene-loader-example.cpp +++ b/examples/scene-loader/scene-loader-example.cpp @@ -40,7 +40,7 @@ using namespace Dali::SceneLoader; namespace { -const float ROTATION_SCALE = 0.05f; +const float ROTATION_SCALE = 180.f; // the amount of rotation that a swipe whose length is the width of the screen, causes, in degrees. const float ITEM_HEIGHT = 50.f; @@ -411,11 +411,11 @@ void SceneLoaderExample::OnPan(Actor actor, const PanGesture& pan) Vector2 size{ float(windowSize.GetWidth()), float(windowSize.GetHeight()) }; float aspect = size.y / size.x; - size *= ROTATION_SCALE; + size /= ROTATION_SCALE; Vector2 rotation{ pan.GetDisplacement().x / size.x, pan.GetDisplacement().y / size.y * aspect }; - Quaternion q = Quaternion(Radian(rotation.y), Radian(rotation.x), Radian(0.f)); + Quaternion q = Quaternion(Radian(Degree(rotation.y)), Radian(Degree(rotation.x)), Radian(0.f)); Quaternion q0 = mScene.GetProperty(Actor::Property::ORIENTATION).Get(); mScene.SetProperty(Actor::Property::ORIENTATION, q * q0);