X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fbouncing-effect-actor.cpp;h=7f38bd4620e751739e3868a8d96db5049dc69f33;hb=074b05f53f89491982b2d5380cab7f05b1932a76;hp=4e3bb677adb3a062bac7e2510984981d541a56b0;hpb=1c3cb32385174b852b8d57b531625f733238f664;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 4e3bb67..7f38bd4 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -19,14 +19,13 @@ #include // EXTERNAL INCLUDES -#include -#include +#include +#include #include +#include #include #include -#include - namespace Dali { @@ -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;