Pause and resume simulation without user input
Hi Jeff (or anyone else),
I'm trying to pause and resume the simulation automatically, based on time delay. However, since the timers stop working during pause(), I don't know how this can be accomplished. Neither viztask or any other timer-based solution works. How can I call play() at a predefined time after pause() has been called? What I want to do is resume the simulation a) after a video finishes playing and b) after vizhtml receives input from clients. In the latter case there is a workaround, to receive the trigger for play() from one of the clients, although by being network-dependent I run the risk of blocking playback in case there's a network glitch. Any help will be greatly appreciated!:confused: |
The viz.tick command will still update when the timers are paused. You can check the viz.tick value from a function that's registered with the vizact.onupdate command:
Code:
import viz |
Thanks Jeff, that could do the trick.
A side question is this: is there a way to pause timer events but still have actions running? |
Instead of pausing the simulation time, you could pause timers individually. This will not affect running actions:
Code:
timerHandle = vizact.ontimer(0,timerFunction) |
Yeap, I knew this.
However I've got schedulers and starttimer() events occurring randomly during playback, so it's really hard to address specific timers. Pause() takes care of all these, freezing their operation without cancelling them, but also deactivates animations (actions). I guess there's no other way around it, right? |
Quote:
Schedulers may be a bit more tricky, but you could use some while loops to wait when the game is paused. |
Thanks Eric.
I'll take the advice from both of you and make it work the way I want. |
All times are GMT -7. The time now is 04:23 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC