WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How do I remove/disable a proximity manager's onEnter/onExit callbacks? (https://forum.worldviz.com/showthread.php?t=5924)

Vaquero 12-27-2016 01:42 PM

How do I remove/disable a proximity manager's onEnter/onExit callbacks?
 
When I registered a callback function for a proximity event [manager.onEnter(sensor,EnterProximity)], how can I later remove that callback, and how to disable/enable it?

Or is there another way to accomplish this using different registration of a proximity event?

Jeff 01-03-2017 11:22 AM

You can get a handle to the event and then enable, disable, or toggle its state:

Code:

enterEvent = manager.onEnter(sensor, EnterProximity)
exitEvent = manager.onExit(sensor, ExitProximity)

vizact.onkeydown('1',enterEvent.setEnabled,viz.TOGGLE)
vizact.onkeydown('2',exitEvent.setEnabled,viz.TOGGLE)


Vaquero 01-04-2017 11:10 AM

Thanks, Jeff! Your help is very appreciated.


All times are GMT -7. The time now is 07:25 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC