Repository navigation
fix the animation with two positions too close - #8097
TranThuong wants to merge 1 commit into
Conversation
|
@TranThuong, thanks for your PR! By analyzing this pull request, we identified @1ec5, @jfirebaugh and @incanus to be potential reviewers. |
|
this would close #7295 on Android |
I don’t think that’s the case. It merely loosens the threshold for turning a |
|
@mourner, do you recall where this threshold came from? I can’t find anything similar in the original paper describing flight animation. |
|
@1ec5 it came originally from @ansis's implementation here cutting-room-floor/easey-DEAD#20. |
|
@TranThuong been looking into the same issue myself in light of #8300. It seems that the value of u1=0.5 is not sufficient. In #8302 I'm trying to catch the root cause that could avoid this behaviour for all use-cases. Thank you for reaching out and contributing. Closing this in favor of #8302. |
Hello,
We have an issue in animating with the method MapboxMap.animateCamera(...), the zoom is from 16 to 7, the center isn't changed. That make the mapbox in the unstable state, the center and the bounding box are NaN. We must restart the application.
After further investigation, we identify the root cause of the problem :
In the class transform.cpp, the method Transform::flyTo cause the issue. If endPoint and startPoint are too close (<1) the following piece of code return "inf" due to "std::sqrt(b * b + 1) - b" equals absolute 0 then "std::log(std::sqrt(b * b + 1) - b);" becomes std::log(0) = -inf
auto r = [=](double i) { /// bᵢ double b = (w1 * w1 - w0 * w0 + (i ? -1 : 1) * rho2 * rho2 * u1 * u1) / (2 * (i ? w1 : w0) * rho2 * u1); return std::log(std::sqrt(b * b + 1) - b); };My proposition to fix it is to make a protection if the delta of the endPoint and startPoint is smaller than 0.5 we set the delta is 0.5. That fix our issue.