WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-27-2016, 01:42 PM
Vaquero Vaquero is offline
Member
 
Join Date: Nov 2015
Posts: 62
Exclamation 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?
Reply With Quote
  #2  
Old 01-03-2017, 11:22 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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)
Reply With Quote
  #3  
Old 01-04-2017, 11:10 AM
Vaquero Vaquero is offline
Member
 
Join Date: Nov 2015
Posts: 62
Thanks, Jeff! Your help is very appreciated.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:01 AM.


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