love icon indicating copy to clipboard operation
love copied to clipboard

BezierCurve:evaluate speed

Open slime73 opened this issue 5 years ago • 1 comments

Original report by Hugo Dictus (Bitbucket: hDictus, GitHub: hDictus).


I had hoped to be able to control the rate of traversal along the BezierCurve by tweaking the parameter provided. This would have been fairly easy if the speed were constant by default (s.t. the parameter provided is equal to the proportion of the curve traversed).

At the moment the traversal speed varies a lot on curvy paths, I guess trying to keep an upper limit on total acceleration? This makes implemeting custom behavior for the speed a little awkward, as I’d have to get the derivative, scale it to unit magnitude, and then apply the change by the desired transformed dt, probably resulting in additional discretization error.

I think constant speed is a more intuitive and customizable default behavior, so I thought I’d suggest that for future versions.

slime73 avatar Jun 01 '19 08:06 slime73

Original comment by Sasha Szpakowski (Bitbucket: slime73, GitHub: slime73).


At the moment the traversal speed varies a lot on curvy paths, I guess trying to keep an upper limit on total acceleration?

As far as I know LÖVE’s code doesn’t try to do anything, it’s just how bézier curves work. We could add APIs that do what you describe, but they’d have all the same precision issues that you mention.

slime73 avatar Jun 02 '19 14:06 slime73