move/lookat - need to pause renderer

I move my object, and then I set the view to look at it, and then I do it all over again.

move-lookat-move-lookat-move-…

My problem is that the render thread manages to render the scene between move and lookat

move-render-lookat-render-move-render-lookat-…

This gives the effect of that the object is shaking.

How do I solve this? Is there any pause/unpause on the render thread??

– Edit –
View.setMinimumFrameCycleTime() seem to have done the trick, is there any more sofisticated way?

You need to use behaviours. If you just want a single hook you can simple put a behaviour that wakes up every frame at the top of your scenegraph.

Then each render what’ll happen is:

Render:

Do what ever the behaviour tells you to do
Render scene

In that behaviour you can just put a call out into your main logic handling classes.

Kev

knew I had to learn behaivours sometime. I’m afraid of them! =) Are they hard to learn?

Na, very easy. Just another scenegraph node that wakes up when you tell it to. The only gotcha I ever noticed was that you need to reschedule waking up once you’ve completed your action. Can’t remember the method names but its something like this:

clazz LogicBehaviour extends Behaviour {
init() {
schedule wake up next frame
}

wakeUp() {
do your logic here
schedule wake up next frame
}
}

I kept forgetting to put the second schedule in.

Kev