const PropertyInput& scrollablePositionProperty,
const PropertyInput& scrollOvershootXProperty,
const PropertyInput& scrollOvershootYProperty,
- const PropertyInput& pageSizeProperty,
- const PropertyInput& activateProperty)
+ const PropertyInput& pageSizeProperty)
{
const Vector3& position = actorPositionProperty.GetVector3();
const Vector3& parentPosition = scrollablePositionProperty.GetVector3();
return current;
}
- const float& activate = activateProperty.GetFloat();
-
- if(activate < Math::MACHINE_EPSILON_0)
- {
- return current;
- }
-
// get distance from centre of scrollable container
Vector2 distance = position.GetVectorXY() - parentPosition.GetVectorXY();
*/
Quaternion operator()(const Quaternion& current,
const PropertyInput& scrollOvershootXProperty,
- const PropertyInput& scrollOvershootYProperty,
- const PropertyInput& activateProperty)
+ const PropertyInput& scrollOvershootYProperty)
{
const Vector2 overshoot(scrollOvershootXProperty.GetFloat(), scrollOvershootYProperty.GetFloat());
- if(fabsf(overshoot.x) < Math::MACHINE_EPSILON_0 && fabsf(overshoot.y) < Math::MACHINE_EPSILON_0)
- {
- return current;
- }
-
- const float& activate = activateProperty.GetFloat();
-
- if(activate < Math::MACHINE_EPSILON_0)
+ if( fabsf(overshoot.x) < Math::MACHINE_EPSILON_0 && fabsf(overshoot.y) < Math::MACHINE_EPSILON_0 )
{
return current;
}
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME ) ),
Source(scrollView, Actor::SIZE ),
- Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ),
ScrollDropoffTwistRotationConstraint(mMaxSwingAngle, mDropOff, mDropOffDistance, mDropOffFunction) );
}
else
constraint = Constraint::New<Quaternion>( Actor::ROTATION,
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME ) ),
Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME ) ),
- Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ),
ScrollTwistRotationConstraint(mMaxSwingAngle) );
}
constraint.SetRemoveAction( Constraint::Discard );
mPropertyTime = SafeRegisterProperty( scrollView, EFFECT_TIME, 0.0f );
mPropertyReference = SafeRegisterProperty( scrollView, EFFECT_REFERENCE, Vector3::ZERO );
mPropertyDepth = SafeRegisterProperty( scrollView, EFFECT_DEPTH, 0.0f);
- mPropertyActivate = SafeRegisterProperty(scrollView, EFFECT_ACTIVATE, 1.0f);
+ mPropertyActivate = SafeRegisterProperty(scrollView, EFFECT_ACTIVATE, 0.0f);
}
+ // currently cant change overshoot snap back duration, use the constant one from ScrollView
+ mActivationTime = Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION;
// Connect to the scroll view signals
scrollView.ScrollStartedSignal().Connect(this, &ScrollViewTwistEffect::OnScrollStart);
}
Actor scrollView = GetScrollView();
scrollView.SetProperty(mPropertyActivate, 1.0f);
- mActivateAnimation = Animation::New(DELAY);
+ mActivateAnimation = Animation::New(mActivationTime);
mActivateAnimation.AnimateTo( Property(scrollView, mPropertyActivate), 0.0f, AlphaFunctions::Linear);
mActivateAnimation.FinishedSignal().Connect(this, &ScrollViewTwistEffect::OnActivateAnimationFinished);
mActivateAnimation.Play();