* @param[in,out] wobbleEffect Reference to wobbleEffect instance
*/
ScrollViewWobbleEffectConstraint(ScrollViewWobbleEffect& wobbleEffect)
- : mChase(Vector3::ZERO),
- mVelocity(Vector3::ZERO),
+ : mChase(Vector2::ZERO),
+ mVelocity(Vector2::ZERO),
mTime(0.0f),
mStabilityTimeCounter(0),
mStabilized(true),
else
{
// not stable (i.e. wobbling)
- Vector3 offset(inputs[2]->GetFloat(), inputs[3]->GetFloat(), 0.0f);
- const Vector3& position = inputs[1]->GetVector3() - offset;
+ Vector2 offset(inputs[2]->GetFloat(), inputs[3]->GetFloat());
+ const Vector2& position = inputs[1]->GetVector2() - offset;
const float time = inputs[0]->GetFloat();
const float timePassed = time - mTime;
if(timePassed>0)
{
- const Vector3 delta = position - mChase;
+ const Vector2 delta = position - mChase;
// Check to see if wobble has stabilized.
if( (fabsf(delta.x) < STABILITY_DELTA_THRESHOLD) &&
} // end else
}
- Vector3 mChase; ///< Chaser position
- Vector3 mVelocity; ///< Velocity of Chaser
+ Vector2 mChase; ///< Chaser position
+ Vector2 mVelocity; ///< Velocity of Chaser
float mTime; ///< Current time.
float mStabilityTimeCounter; ///< Time in seconds that stable for.
bool mStabilized; ///< Stabilized flag.
}
-void ScrollViewWobbleEffect::OnScrollStart( const Vector3& position )
+void ScrollViewWobbleEffect::OnScrollStart( const Vector2& position )
{
// When animation starts, all constraints all unstable,
// and we change the animation cycle id.
ContinueAnimation(WOBBLEEFFECT_ANIMATION_MAX_TIME);
}
-void ScrollViewWobbleEffect::OnScrollUpdate( const Vector3& position )
+void ScrollViewWobbleEffect::OnScrollUpdate( const Vector2& position )
{
// nothing to do
}
-void ScrollViewWobbleEffect::OnScrollComplete( const Vector3& position )
+void ScrollViewWobbleEffect::OnScrollComplete( const Vector2& position )
{
// nothing to do
}