You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@hippocalypse that works, but the raf invocation should be set under a conditional, otherwise the loop will go on forever unnecessarily and cause a memory leak. Like this:
@vasturiano Ah! I gotcha. What event (when rotating the y axis) should I listen for to get back in the loop? onZoom doesn't seem to reduce the amount of invocations.
I think I now understand better your request, you want it to be perpetually correcting the latitude pov towards the equator, not when the user hits some kind of button or similar, is that right?
In that case, it's ok to just leave the raf loop running throughout and it corrects whenever it leaves the latitude 0.
Otherwise, you can try to do it on camera motion events, by hooking into the controls "change" event, like this:
world.controls().addEventListener('change',()=>/* your code */);
But I'm not sure that'll give you exactly the granularity of events you're looking for.
I'd like to recommend floating the latitude back to the equator at the current autoRotate speed.
The text was updated successfully, but these errors were encountered: