how to calculate a negative acceleration?

后端 未结 15 2099
既然无缘
既然无缘 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条回答
  •  萌比男神i
    2021-02-08 12:24

    I would cut down velocity as something like v=v*0.9 Then i would have a velocity which is considered the stopped velocity. This way the object would come to rest eventually and not continue consuming resources as moving. so something like for(v=startingVelocity;v<1.0;v*=0.9) { x+=v; }

提交回复
热议问题