PDA

View Full Version : ScheduledOrbitViewStateIterator.createAl titudeIterator jitter question


Achaiah
04-30-2008, 09:05 PM
Apologies if this has been asked before (yes I did browse through the forum but I'm a WWJ newbie :) )

I'm having some trouble using the state iterators in my code. I'm trying to provide functionality that will zoom in and out over the same point based on user input (just like you would be able to do in WWJ with a mouse wheel, except that my input comes from another device).

My approach is that every time I get a new value as input, I create a new AltitudeIterator and apply it to the view via view.applyStateIterator(...). Unfortunately, that approach refuses to work like the mouse wheel would. It seems that every call to applyStateIterator(...) stops any currently running iterator even if it is in the middle of iterating and then reapplies the new iterator. The end result is that the animation is really jittery, jumpy and unworkable unless the inputs are spaced far enough apart for the current StateIterator to finish. Sadly, in my case the updates happen very frequently.

Compare this with the mouse, where even if you scroll the wheel multiple times in quick succession, the iterators seem to get buffered or merged or something along those lines and the entire motion is smooth from start to finish.

Has anyone else run into the same problem? I would greatly appreciate a solution or a couple of pointers.

Thanks!

patmurris
05-01-2008, 03:26 AM
Have a look at the AWTInputHandler and it's helper classes. You should find there how the mouse wheel is handled and mimic the logic.

However, a fresh 0.5 release is about to come out with a much revised view handling.

Achaiah
05-01-2008, 09:43 PM
Ah thanks, for anyone else who's curious, you want to look at the OrbitViewInputBroker code. There is a method there that uses a non-documented class (!!): OrbitViewInputStateIterator. That's what you want. Let's hope the new version has improved handling and documentation as well!