diff options
author | David Steele <david.steele@partner.samsung.com> | 2016-09-15 12:58:03 +0100 |
---|---|---|
committer | David Steele <david.steele@partner.samsung.com> | 2016-09-16 16:45:13 +0100 |
commit | 353791221593707c7b7a308a49a4236d05899166 (patch) | |
tree | 6a1fdb031f11ec4c43b4130546b3a0adea9cf49f | |
parent | 9cfb6b893585d671921fac5ab1130037e31ca3a4 (diff) | |
download | dali-demo-353791221593707c7b7a308a49a4236d05899166.tar.gz dali-demo-353791221593707c7b7a308a49a4236d05899166.tar.bz2 dali-demo-353791221593707c7b7a308a49a4236d05899166.zip |
Changed the shadow/lights example defaults
Updated the defaults on the shadow / light example to first
move the light, rather than panning the scene.
Updated the intial orientations to look better.
Change-Id: I8eceb5f536a75fef5e6881987452efb53af6e544
Signed-off-by: David Steele <david.steele@samsung.com>
-rw-r--r-- | com.samsung.dali-demo.xml | 2 | ||||
-rw-r--r-- | demo/dali-demo.cpp | 2 | ||||
-rw-r--r-- | examples/shadows-and-lights/shadows-and-lights-example.cpp (renamed from examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp) | 56 |
3 files changed, 30 insertions, 30 deletions
diff --git a/com.samsung.dali-demo.xml b/com.samsung.dali-demo.xml index 4a58819c..b7980dee 100644 --- a/com.samsung.dali-demo.xml +++ b/com.samsung.dali-demo.xml @@ -64,7 +64,7 @@ <ui-application appid="scroll-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/scroll-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> <label>Scroll View</label> </ui-application> - <ui-application appid="shadow-bone-lighting.example" exec="/usr/apps/com.samsung.dali-demo/bin/shadow-bone-lighting.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> + <ui-application appid="shadows-and-lights.example" exec="/usr/apps/com.samsung.dali-demo/bin/shadows-and-lights.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> <label>Shadows and Lights</label> </ui-application> <ui-application appid="dali-builder" exec="/usr/apps/com.samsung.dali-demo/bin/dali-builder" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> diff --git a/demo/dali-demo.cpp b/demo/dali-demo.cpp index f413590d..408eb587 100644 --- a/demo/dali-demo.cpp +++ b/demo/dali-demo.cpp @@ -48,7 +48,7 @@ int DALI_EXPORT_API main(int argc, char **argv) demo.AddExample(Example("page-turn-view.example", DALI_DEMO_STR_TITLE_PAGE_TURN_VIEW)); demo.AddExample(Example("refraction-effect.example", DALI_DEMO_STR_TITLE_REFRACTION)); demo.AddExample(Example("scroll-view.example", DALI_DEMO_STR_TITLE_SCROLL_VIEW)); - demo.AddExample(Example("shadow-bone-lighting.example", DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS)); + demo.AddExample(Example("shadows-and-lights.example", DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS)); demo.AddExample(Example("builder.example", DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI)); demo.AddExample(Example("image-scaling-and-filtering.example", DALI_DEMO_STR_TITLE_IMAGE_FITTING_SAMPLING)); demo.AddExample(Example("image-scaling-irregular-grid.example", DALI_DEMO_STR_TITLE_IMAGE_SCALING)); diff --git a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp b/examples/shadows-and-lights/shadows-and-lights-example.cpp index 72b6fa12..4ae58776 100644 --- a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp +++ b/examples/shadows-and-lights/shadows-and-lights-example.cpp @@ -35,7 +35,7 @@ const char* BACKGROUND_IMAGE( DEMO_IMAGE_DIR "background-default.png" ); const char* TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" ); const char* APPLICATION_TITLE_PAN_LIGHT( "Lighting: Pan Light" ); -const char* APPLICATION_TITLE_PAN_OBJECT( "Lighting: Rotate Object" ); +const char* APPLICATION_TITLE_ROTATE_OBJECT( "Lighting: Rotate Object" ); const char* APPLICATION_TITLE_PAN_SCENE( "Lighting: Pan Scene" ); const char* APPLICATION_TITLE_ROTATE_SCENE( "Lighting: Rotate Scene" ); const char* CHANGE_EFFECT_IMAGE( DEMO_IMAGE_DIR "icon-change.png" ); @@ -60,8 +60,8 @@ const Vector2 DEFAULT_STAGE_SIZE( 480.0f, 800.0f ); const float X_ROTATION_DISPLACEMENT_FACTOR = 60.f; const float Y_ROTATION_DISPLACEMENT_FACTOR = 60.f; -const float LIGHT_PAN_X_DISPLACEMENT_FACTOR = 180.f; -const float LIGHT_PAN_Y_DISPLACEMENT_FACTOR = 180.f; +const float LIGHT_PAN_X_DISPLACEMENT_FACTOR = 1/360.f; +const float LIGHT_PAN_Y_DISPLACEMENT_FACTOR = 1/360.f; } @@ -81,16 +81,16 @@ public: TestApp(Application &app) : mApp(app), mPaused(false), - mTranslation(Vector3::ZERO), - mSceneYRotation( Dali::ANGLE_30 * 0.5f ), - mSceneXRotation( Dali::ANGLE_30 ), - mLightYRotation(0.0f), - mLightXRotation(0.0f), - mObjectYRotation(0.0f), + mTranslation(22.0f, -1.0f, 0.0f), + mSceneXRotation( Degree(-6.0f) ), // Initial values give a reasonable off-straight view. + mSceneYRotation( Degree(20.0f) ), + mLightXRotation( Degree(-1.5f) ), + mLightYRotation( Degree(-9.5f) ), mObjectXRotation(0.0f), - mPinchScale(0.5f), - mScaleAtPinchStart(0.5f), - mPanState(PAN_SCENE) + mObjectYRotation(0.0f), + mPinchScale(0.6f), + mScaleAtPinchStart(0.6f), + mPanState(PAN_LIGHT) { app.InitSignal().Connect(this, &TestApp::Create); app.TerminateSignal().Connect(this, &TestApp::Terminate); @@ -157,7 +157,7 @@ public: toolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); // Set Title text - mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_SCENE) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_LIGHT) ); //Add a reset button Toolkit::PushButton resetButton = Toolkit::PushButton::New(); @@ -167,7 +167,7 @@ public: toolBar.AddControl( resetButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); // Setup - mView.SetPosition(Vector3(0.0f, 0.0f, -50)); + mView.SetPosition(Vector3(0.0f, 0.0f, 0.0f)); mContents.SetBehavior(Layer::LAYER_3D); mContents.SetPosition(mTranslation); @@ -324,9 +324,9 @@ public: { case PAN_LIGHT: { - mLightXRotation = mLightXRotation - gesture.displacement.y / LIGHT_PAN_X_DISPLACEMENT_FACTOR; // X displacement rotates around Y axis + mLightXRotation = mLightXRotation - gesture.displacement.y * LIGHT_PAN_X_DISPLACEMENT_FACTOR; // X displacement rotates around Y axis mLightXRotation = Clamp(mLightXRotation, -Dali::ANGLE_45, Dali::ANGLE_45 ); - mLightYRotation = mLightYRotation + gesture.displacement.x / LIGHT_PAN_Y_DISPLACEMENT_FACTOR; // Y displacement rotates around X axis + mLightYRotation = mLightYRotation + gesture.displacement.x * LIGHT_PAN_Y_DISPLACEMENT_FACTOR; // Y displacement rotates around X axis mLightYRotation = Clamp(mLightYRotation, -Dali::ANGLE_45, Dali::ANGLE_45 ); mLightAnchor.SetOrientation( CalculateWorldRotation( mLightXRotation, mLightYRotation ) ); break; @@ -407,22 +407,22 @@ public: { switch(mPanState) { - case PAN_SCENE: - mPanState = ROTATE_SCENE; - mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_ROTATE_SCENE) ); - break; - case ROTATE_SCENE: - mPanState = PAN_LIGHT; - mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_LIGHT) ); - break; case PAN_LIGHT: mPanState = ROTATE_OBJECT; - mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_OBJECT) ); + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_ROTATE_OBJECT) ); break; case ROTATE_OBJECT: + mPanState = ROTATE_SCENE; + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_ROTATE_SCENE) ); + break; + case ROTATE_SCENE: mPanState = PAN_SCENE; mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_SCENE) ); break; + case PAN_SCENE: + mPanState = PAN_LIGHT; + mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_LIGHT) ); + break; default: break; } @@ -464,12 +464,12 @@ private: PinchGestureDetector mPinchGestureDetector; TapGestureDetector mTapGestureDetector; Vector3 mTranslation; - Radian mSceneYRotation; Radian mSceneXRotation; - Radian mLightYRotation; + Radian mSceneYRotation; Radian mLightXRotation; - Radian mObjectYRotation; + Radian mLightYRotation; Radian mObjectXRotation; + Radian mObjectYRotation; float mPinchScale; float mScaleAtPinchStart; |