OZtree
OZtree copied to clipboard
Jumping to a place that's already very close by
When a jump is requested to a place that's really nearby it should not take place. This was mentioned in #55 and a fix was attempted in controller_loc.js but it doesn't seem to be working.
There already seems to be code for this in Controller.prototype.perform_flight_transition - or at least, it says "@return {boolean} returns false if the distance to codein_fly is too short so there is no animation performed.". So I wonder if we have redundantly coded up another version, which is not working?
The code pointed to by Yan was specifically for a flight animation, we want to do the same for jumping and ideally without reimplementing in two places a function that defines 'close by'
I think this has since been fixed with https://github.com/OneZoom/OZtree/commit/845382d065a37cecb10b190abcb4cf6c5b666a41
The "close enough" logic is in perform_actual_fly:
https://github.com/OneZoom/OZtree/blob/edcd6408065d5e2ba3bb25b1b735032c4844806b/OZprivate/rawJS/OZTreeModule/src/position_helper.js#L246-L251
The commit above re-implements leaps by flying as fast as feasibly possible to a location. By doing so the "close enough" behaviour is now shared.