X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fbouncing-effect-actor.cpp;h=7225beb866f10c9ddf5daef43c278e638bf4dd53;hb=refs%2Fchanges%2F28%2F38928%2F2;hp=7301a8b2acb60cbd75abadb1aeca42f47c002b43;hpb=306d2f61a1b64179e801fa8a0bb2bd7b4e9dd682;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 7301a8b..7225beb 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -18,16 +18,12 @@ // CLASS HEADER #include -// INTERNAL INCLUDES -#include -#include +// EXTERNAL INCLUDES +#include #include #include #include -// EXTERNAL INCLUDES -#include - namespace Dali { @@ -59,10 +55,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; @@ -97,7 +92,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, @@ -109,12 +103,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;