how to calculate a negative acceleration?

后端 未结 15 1768
既然无缘
既然无缘 2021-02-08 12:11

I\'m implementing the scrolling behaviour of a touch screen UI but I\'m too tired in the moment to wrap my mind around some supposedly trivial piece of math:

y (         


        
15条回答
  •  生来不讨喜
    2021-02-08 12:44

    acceleration = (force / mass) 
    velocity = (acceleration * time)
    (force from user's finger) = acceleration / mass = velocity / time
    
    1. give the view a mass (tweak it until things seem reasonable, and let the user tweak it)
    2. identify some new force (drag)
    3. give the new force (drag) a magnitude (tweak until reasonable, let the user tweak it)
    4. apply the new force to the object and watch it slow down

提交回复
热议问题