krimble
06-04-2008, 05:12 AM
Hi,
What I'm trying to do is, using the buttons on the joystick to scale my virtual world. I'm using a task know, but it seems that the event doesn't get triggered when using "viz.SENSOR_UP_EVENT". If I use "viztask.waitSensorDown" then I don't know what to put in it as a button. I've tried the state things from the manual "joystickSensor.get()[7]" but it doesn't give me the actual pressed button wich I have to put in, right?
def scaleOnSensorEvent() :
dataObject = viz.Data
sensorData = joystickSensor.get()
while True :
yield viztask.waitEvent(viz.SENSOR_UP_EVENT, dataObject)
# yield viztask.waitSensorDown(joystickSensor, button??, dataObject)
print "something"
if viz.get(viz.TRACKER):
headSensor = viz.add('intersense.dls')
viz.tracker()
headSensor.reset()
joystickSensor = viz.add('intersense.dls')
viz.tracker()
joystickSensor.reset()
viztask.schedule(scaleOnSensorEvent)
thanks for your help
What I'm trying to do is, using the buttons on the joystick to scale my virtual world. I'm using a task know, but it seems that the event doesn't get triggered when using "viz.SENSOR_UP_EVENT". If I use "viztask.waitSensorDown" then I don't know what to put in it as a button. I've tried the state things from the manual "joystickSensor.get()[7]" but it doesn't give me the actual pressed button wich I have to put in, right?
def scaleOnSensorEvent() :
dataObject = viz.Data
sensorData = joystickSensor.get()
while True :
yield viztask.waitEvent(viz.SENSOR_UP_EVENT, dataObject)
# yield viztask.waitSensorDown(joystickSensor, button??, dataObject)
print "something"
if viz.get(viz.TRACKER):
headSensor = viz.add('intersense.dls')
viz.tracker()
headSensor.reset()
joystickSensor = viz.add('intersense.dls')
viz.tracker()
joystickSensor.reset()
viztask.schedule(scaleOnSensorEvent)
thanks for your help