X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fbouncing-effect-actor.cpp;h=7f38bd4620e751739e3868a8d96db5049dc69f33;hb=a2fc5fd1c64132c393330dde2fac210f58ac5525;hp=a4f1ffbcd2d30dcf06500ad6e765b23b997e368b;hpb=843352ddfe65e9a2f6fa1fb73197b46960efb40c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index a4f1ffb..7f38bd4 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -20,10 +20,9 @@ // EXTERNAL INCLUDES #include -#include -#include +#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;