WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-10-2008, 10:20 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can create your own custom task conditions. For example, here are two conditions that wait for an IS900 button to be pressed or released:
Code:
class waitIS900Down( viztask.Condition ):
    def __init__( self, sensor, button ):
        self._sensor = sensor
        self._button = button
   
    def update( self ):
        return int(self._sensor.getData()[7]) & self._button

class waitIS900Up( viztask.Condition ):
    def __init__( self, sensor, button ):
        self._sensor = sensor
        self._button = button
   
    def update( self ):
        return (int(self._sensor.getData()[7]) & self._button) == 0
Here is code that shows how to use it:
Code:
.
.
.
yield waitIS900Down(isense,1)
print 'Button 1 pressed'
yield waitIS900Up(isense,1)
print 'Button 1 released'
.
.
.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joystick Navigation Vinicius Lima Vizard 7 10-23-2007 10:42 AM
Facetracking and Immersion Joystick Vygreif Vizard 1 01-25-2006 10:56 AM
problem with joystick data and input dialog box baf1 Vizard 4 03-03-2005 08:00 AM
Another Joystick Question Plasma Vizard 3 02-03-2004 11:16 AM
Basic Joystick Navigation Question Plasma Vizard 2 01-29-2004 07:08 PM


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


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