|
|
Q: How do I get just one click (state toggle) from a digital device?
When mouse/wand clicks are setup to register as digital button presses it is hard to get just one click.
A: Use edge triggering on vjDigital or on gadget::Digital devices.
You will want to look at edge triggering on vjDigital or on gadget::Digital devices. An edge trigger gives you 4 states: on, off, just-on, or just-off. VR Juggler digital devices do edge triggering for you automatically. You will want to test for just-on so that your presses do not keep retriggering. For example, you can test it in the following way to see when the button is first pressed:
if ( vjDigital::TOGGLE_ON == digital_dev->getData() )
{
// Button just pressed
}
For VR Juggler 1.1 and beyond, test against gadget::Digital::TOGGLE_ON.
Back to: LiveFaq
|
|
|
Copyright © 1999-2008 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding VRJ Wiki? Send feedback
|
|
Revision r1.1 - 02 Jan 2004 - 16:27 - PatrickHartling
|
Copyright © 1999-2008 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding VRJ Wiki? Send feedback
|
| |
|