Replies: 1 comment
-
The event handling is geared around the events being polled each frame, which complicates things a little. What I'd try is a custom event handler that checks for the key press and if it's pressed is sets a bool value to true and when it's release sets it back to false. In the main loop you'd check the bool to see if to advance the frame or not, if it's time to advance you call the usual update and rendering traversals methods, if not then skip these steps and reset the FrameStamp time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been searching/experimenting for a few days now, and haven't been able to come up with ANYTHING reliable. So, I decided to ask here before I burn any more time on the issue.
What I'm looking for is some way to manually control and advance the behavior that is typically managed for me by
ViewerBase::run()
. To be clear, I essentially need a way to be able to bind a key—let's say Spacebar—as a trigger to advance an OSG application one frame at a time. It doesn't have to be perfect (for example, I can seeCameraManipulators
not behaving well under these conditions), but it's a good place for me to start.I've checked the examples, and haven't seen anything similar to what I'm trying to achieve. My current approach looks something like this:
The above pseudocode doesn't address the keybind integration, since at this point I'm not able to even simulate the "mainloop" typically facilitated by calling
ViewerBase::run()
. At any rate, I hope it somewhat demonstrates what I'm eventually trying to get to. :)Beta Was this translation helpful? Give feedback.
All reactions