WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 12-06-2016, 11:52 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
One way to do this is create a custom event that's triggered when 3 targets are inside a sensor. Write a function that's called every frame, checks to see how many targets are in the sensor, and sends the event. In the viztask function, use the viztask.waitAny command to wait for either the custom event or 5 seconds:

Code:
waitTargets = viztask.waitEvent(THREE_TARGETS_EVENT)
waitTime = viztask.waitTime(5)

for trial in xrange(numTrials):
	d = yield viztask.waitAny( [ waitTargets, waitTime ] )
	
	if d.condition is waitTargets:
		print 'targets entered'
	else:
		print '5 seconds passed'
Reply With Quote
 

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
delaying proximity reaction makes sensor unresponsive for the time of delay jelly Vizard 4 11-23-2016 05:20 AM
sensor radius bug? lalechuza Vizard 7 08-25-2015 06:57 AM
Orientation selective (Viewing Vector) Proximity Sensor lmGehrke Vizard 2 03-17-2015 01:31 PM
Proximity Sensor Problem kmkm Vizard 3 03-04-2014 12:54 PM
CompositeShape proximity sensor mhtong Vizard 1 09-24-2012 12:18 PM


All times are GMT -7. The time now is 05:09 AM.


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