X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fbouncing-effect-actor.cpp;h=5ea57534cd053e87cad855bf3509cb0eadfe3ae8;hp=a4f1ffbcd2d30dcf06500ad6e765b23b997e368b;hb=402784aceba9171e57ffca8769ca46ef8aebcd2f;hpb=6d762b4acd946b3d02e76c1805e7af9a1a5b1809 diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index a4f1ffb..5ea5753 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include @@ -58,10 +57,9 @@ struct VertexPositionConstraint { } - Vector3 operator()( const Vector3& current, const PropertyInput& bounceCoef ) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - float positionY = mInitialY + mRange * fabsf(bounceCoef.GetFloat()); - return Vector3( current.x, positionY, current.z ); + current.y = mInitialY + mRange * fabsf( inputs[0]->GetFloat() ); } float mInitialY; @@ -96,7 +94,6 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) } meshActor = Dali::MeshActor::New(mesh); - meshActor.SetAffectedByLighting(false); Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( "", MESH_FRAGMENT_SHADER, GEOMETRY_TYPE_UNTEXTURED_MESH, @@ -108,12 +105,13 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) for( size_t i=0;i( mesh.GetPropertyIndex(j+2, AnimatableVertex::POSITION ), - Source(meshActor, bouncePropertyIndex), - VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) ); - mesh.ApplyConstraint( Constraint::New( mesh.GetPropertyIndex(j+3, AnimatableVertex::POSITION), - Source(meshActor, bouncePropertyIndex), - VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) ); + Constraint constraint = Constraint::New( mesh, mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::POSITION ), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ); + constraint.AddSource( Source(meshActor, bouncePropertyIndex) ); + constraint.Apply(); + + constraint = Constraint::New( mesh, mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ); + constraint.AddSource( Source(meshActor, bouncePropertyIndex) ); + constraint.Apply(); } return meshActor;