Derived value of LibGDX CatmullRomSpline?

When calling the derivative method on CatmullRomSpline, what exactly does this value represent? It has been some time since calculus, but if my memory serves me correctly, taking the derivative of the position in time, you will get speed at that moment in time. But with CatmullRomSpline, the “time” value is a percentage value, so the resulting derivative in pixels / percent?

I printed the derived values ​​(the length of the vector) along my path and the values ​​reached the value “989.6049”, which really makes no sense to me, since the total path length is 2039 (calculated using “approxLength (1000).” Ive tried a few things to get derived values ​​in a range that makes sense (e.g. dividing by the total path length), but Im still don't understand this.

Essentially, I'm trying to figure out how to get a constant speed along the way. My plan is to use derivatives to get a bet at a given time and compare this with what the bet should be if it was constant (calculated by the length of the path), and then adjust the percentage value that is supplied to the value CatmullRomSplineAt ( ), so that the resulting speed will be constant throughout the path. Thanks.

0
source share

Source: https://habr.com/ru/post/1608108/


All Articles