本文整理汇总了Python中vizact.ontimer2函数的典型用法代码示例。如果您正苦于以下问题:Python ontimer2函数的具体用法?Python ontimer2怎么用?Python ontimer2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ontimer2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: objectBasketed
def objectBasketed(e):
global rhandtar, lhandtar, rSelectedNode, lSelectedNode, rhGrabber, lhGrabber, ALL_GRABBED_EVENT
global yMove, basketBounding
selectedNode = e.__dict__['released']
# if e.target == rhandtar:
# selectedNode = rSelectedNode
# elif e.target == lhandtar:
# selectedNode = lSelectedNode
if selectedNode != None:
globals_oa.AUDIO_SUCCESS.play()
yMove = 0.02
basketBounding = globals_oa.basket.getBoundingBox()
vizact.ontimer2(0.001, 400, dropObject, selectedNode)
rhGrabber.removeItems([selectedNode])
lhGrabber.removeItems([selectedNode])
# if e.target == rhandtar:
# rhGrabber.release()
# elif e.target == lhandtar:
# lhGrabber.release()
currentListOfGrabables = rhGrabber.getItems()
print "currentListOfGrabables = " + str(currentListOfGrabables)
if currentListOfGrabables == []:
viz.sendEvent(ALL_GRABBED_EVENT)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:26,代码来源:TheCrystalReef.py
示例2: onEnter
def onEnter(e):
global rightHandTarget, leftHandTarget
print 'working'
if e.target == rightHandTarget:
vizact.ontimer2(.004, 100, vibrateRightHand)
if e.target == leftHandTarget:
vizact.ontimer2(.004, 100, vibrateLeftHand)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:7,代码来源:TCR2_Main.py
示例3: step
def step():
global prevStep
prevStep = "UP"
print prevStep
walk = vizact.walkTo([male.getPosition()[0] + 1, 0,male.getPosition()[2]], walkSpeed = 1)
male.runAction(walk)
# viz.MainView.velocity(0,0,1)
vizact.ontimer2(.9,0,setDown)
开发者ID:zhengyeve,项目名称:Summer-Research,代码行数:8,代码来源:firstwalk.py
示例4: main
def main():
global initialStep
# if initialStep:
time.sleep(3)
text1.setPosition(0,1.6,4)
print "START"
vizact.ontimer2(0.33, 2, getInitial)
vizact.ontimer(1/60, checkStep)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:8,代码来源:TwoKinects.py
示例5: step
def step():
global prevStep
prevStep = "UP"
x,y,z = unitVector(math.cos(math.radians(aveYaw+90)), 0, math.sin(math.radians(aveYaw+90)))
viz.MainView.velocity(x, y, z)
vizact.ontimer2(.9,0,setDown)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:8,代码来源:Experiment1.py
示例6: h2co3FormationTriggerEvent
def h2co3FormationTriggerEvent(e):
global rightHandTarget, leftHandTarget, bubble
print "Forming H2CO3 now!!!"
bubble.disable(viz.RENDERING)
if e.target == rightHandTarget:
vizact.ontimer2(0.004, 25, vibrateHandController, 2)
elif e.target == leftHandTarget:
vizact.ontimer2(0.004, 25, vibrateHandController, 1)
viztask.schedule(H2CO3formation())
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:9,代码来源:boat_scene.py
示例7: step
def step():
global prevStep, stepCount, finalYaw
prevStep = "UP"
x,y,z = unitVector(math.cos(math.radians(finalYaw+90)), 0, math.sin(math.radians(finalYaw+90)))
viz.MainView.velocity(x, y, z)
stepCount += 1
print stepCount
vizact.ontimer2(.9,0,setDown)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:9,代码来源:2kinectsHMD0706.py
示例8: step
def step():
global prevStep, stepCounter
prevStep = "UP"
x,y,z = unitVector(math.cos(math.radians(aveYaw+90)), 0, math.sin(math.radians(aveYaw+90)))
view.velocity(x, y, z)
stepCounter += 1
print stepCounter
vizact.ontimer2(.9,0,setDown)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:10,代码来源:CameraMove_KneeThreshold.py
示例9: training_display
def training_display(rt,acc):
print "acc",acc
if acc:
msg = "RIGHT"
correct_sound.play()
else:
msg = "WRONG"
incorrect_sound.play()
block_text.message(msg + " %.2fs"%rt)
vizact.ontimer2(rate=MESSAGE_TIME, repeats=0,func=clear_text)
开发者ID:marloverket,项目名称:crosstask,代码行数:10,代码来源:crosstrial.py
示例10: step
def step():
global prevStep, lastX, lastZ
prevStep = "UP"
x, z = calcUnitVector()
viz.MainView.velocity(lastX, 0, lastZ)
lastX = x
lastZ = z
walk = vizact.walkTo([x + male.getPosition()[0], 0, z + male.getPosition()[2]], walkSpeed=1)
viz.MainView.lookAt([male.getPosition()[0], 2, male.getPosition()[2]])
male.runAction(walk)
vizact.ontimer2(0.9, 0, setDown)
开发者ID:cstrachan88,项目名称:Summer-Research,代码行数:11,代码来源:firstwalk.py
示例11: grabObject
def grabObject(e):
global rSelectedNode, lSelectedNode, rhGrabber, lhGrabber
if e.grabber == rhGrabber:
rSelectedNode = e.grabbed
globals_oa.rhViveTracker.setVibration(0.004)
vizact.ontimer2(0.004, 25, vibrateHandController, 2)
elif e.grabber == lhGrabber:
lSelectedNode = e.grabbed
globals_oa.lhViveTracker.setVibration(0.004)
vizact.ontimer2(0.004, 25, vibrateHandController, 1)
globals_oa.AUDIO_PICKUP.play()
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:12,代码来源:TheCrystalReef.py
示例12: explode
def explode():
print('apply spin')
# fire.setPosition(0,0,0)
# fire.applyForce( dir=[0,0,-0.01],duration=0.001)
# fire.addAction(vizact.spin(1,1,0,500,viz.FOREVER))
# fire.setScale([2,2,2])
# fire.setScale([4,4,4])
# fire.setAnimationSpeed(20)
box1.visible(1)
box1.setAnimationTime(0)
box1.setAnimationState(0)
fire.visible(1)
vizact.ontimer2(0.6,0,hide,0)
开发者ID:willpower2727,项目名称:VR_scripts,代码行数:13,代码来源:Vizard46.py
示例13: testex
def testex(nothing):
global rxplode
global lxplode
fire1.visible(1)
fire2.visible(1)
rxplode.visible(1)
rxplode.setAnimationTime(0.1)
rxplode.setAnimationState(0)
vizact.ontimer2(0.6,0,hide1,0)
lxplode.visible(1)
lxplode.setAnimationTime(0.1)
lxplode.setAnimationState(0)
vizact.ontimer2(0.6,0,hide2,0)
开发者ID:willpower2727,项目名称:VR_scripts,代码行数:13,代码来源:BFback_GradualAdaptation_statictargets_rev9_twotargets_x.py
示例14: playNarrationFile
def playNarrationFile( obj=None ):
#global selector
#selector.disable()
selector.removeOnDeselectCallback(RADIO)
selector.removeOnSelectCallback(RADIO)
selector.disable()
print 'narrating'
audio = obj.narrationFile[0]
sound = viz.addAudio(audio)
duration = sound.getDuration()
sound.play()
print "playing " + str(audio)
vizact.ontimer2(duration+DELAY_UNTIL_NARRATION, 0, checkForNextEvent, obj)
del obj.narrationFile[0]
开发者ID:vhilab,项目名称:homelessness-study,代码行数:14,代码来源:ApartmentNarration.py
示例15: grabObject
def grabObject(e):
global rSelectedNode, lSelectedNode, rhtool, lhtool, objectName
print "e.grabbed.id = " + str(e.grabbed.id)
if e.grabber == rhtool:
rSelectedNode = e.grabbed
globals_oa.rhViveTracker.setVibration(0.004)
vizact.ontimer2(0.004, 25, vibrateHandController, 2)
elif e.grabber == lhtool:
lSelectedNode = e.grabbed
globals_oa.lhViveTracker.setVibration(0.004)
vizact.ontimer2(0.004, 25, vibrateHandController, 1)
#globals_oa.lhModel.disable(viz.RENDERING)
#globals_oa.lhClosedModel.visible(True)
globals_oa.AUDIO_PICKUP.play()
objectName = getObjectName(e.grabbed)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:15,代码来源:scavengerhunt.py
示例16: EnablePlayer1ForMultiInput
def EnablePlayer1ForMultiInput (self, secInput):
if self._player == 1 and len(self.PLAYERS) == 1 and self._collabAction == '':
self._collabAction = ', '+secInput #add second action for 1P conditions
self._collabIcon.texture(self._collabTextures[0])
self._collabIcon.addAction(vizact.fadeTo(0, begin=1, time=5, interpolate=vizact.easeInCircular))
self._collabTimer = vizact.ontimer2(5, 1, self.DisablePlayer1ForMultiInput)
print "PLAYER1: Preparing to execute multi-input action!"
开发者ID:tokola,项目名称:GitHub_OLiVE,代码行数:7,代码来源:Window.py
示例17: ShowFlagAtSnail
def ShowFlagAtSnail(e):
global rhandtar, lhandtar
rightFlagVisible = globals_oa.rhModelFlag.getVisible()
leftFlagVisible = globals_oa.lhModelFlag.getVisible()
if (e.target == rhandtar) and rightFlagVisible:
print "A snail is touched!"
sourceNode = e.sensor.getSource()._node
print "sourceNode = " + str(sourceNode)
for snailAndFlagItem in globals_oa.snailAndFlagItemsInZone1:
if snailAndFlagItem.snailItemFromZoneModel == sourceNode:
snailVisible = snailAndFlagItem.flagItemFromZoneModel.getVisible()
if not snailVisible:
# print "snailAndFlagItem.flagItemFromZoneModel.getVisible() before = " + str(snailAndFlagItem.flagItemFromZoneModel.getVisible())
snailAndFlagItem.flagItemFromZoneModel.visible(viz.ON)
# globals_oa.AUDIO_PICKUP.play()
touchedSnail()
vibrateHandController(2)
globals_oa.rhViveTracker.setVibration(0.004)
vizact.ontimer2(0.004, 25, vibrateHandController, 2)
globals_oa.rhFlagCheck = False
globals_oa.rhModelFlag.visible(False)
# print "snailAndFlagItem.flagItemFromZoneModel.getVisible() after = " + str(snailAndFlagItem.flagItemFromZoneModel.getVisible())
# testForZone1SpeciesCountCompletion()
break
if (e.target == lhandtar) and leftFlagVisible:
print "A snail is touched!"
sourceNode = e.sensor.getSource()._node
print "sourceNode = " + str(sourceNode)
for snailAndFlagItem in globals_oa.snailAndFlagItemsInZone1:
if snailAndFlagItem.snailItemFromZoneModel == sourceNode:
snailVisible = snailAndFlagItem.flagItemFromZoneModel.getVisible()
if not snailVisible:
# print "snailAndFlagItem.flagItemFromZoneModel.getVisible() before = " + str(snailAndFlagItem.flagItemFromZoneModel.getVisible())
snailAndFlagItem.flagItemFromZoneModel.visible(viz.ON)
# globals_oa.AUDIO_PICKUP.play()
touchedSnail()
vibrateHandController(1)
globals_oa.lhViveTracker.setVibration(0.004)
vizact.ontimer2(0.004, 25, vibrateHandController, 1)
globals_oa.lhFlagCheck = False
globals_oa.lhModelFlag.visible(False)
# print "snailAndFlagItem.flagItemFromZoneModel.getVisible() after = " + str(snailAndFlagItem.flagItemFromZoneModel.getVisible())
# testForZone1SpeciesCountCompletion()
break
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:46,代码来源:SnailHunt.py
示例18: cross_block
def cross_block(list_of_trials,training=False):
# keep track of trial results
results = []
successes = 0
block_text.message("DEADLINE: %.2f"%list_of_trials[0][2])
vizact.ontimer2(rate=MESSAGE_TIME, repeats=0,func=clear_text)
# Loop over the rest of the trials
for trial in list_of_trials[1:]:
res = yield cross_trial(*trial,training=training)
results.append(res)
successes += results[-1]["success"]
# Display successes at the end
yield end_block(successes,len(list_of_trials))
yield viztask.waitTime(4)
# Clear the message
block_text.message("")
viztask.returnValue( results )
开发者ID:marloverket,项目名称:crosstask,代码行数:17,代码来源:crosstrial.py
示例19: InitFire
def InitFire():
global fireActivated
reportFireTime()
viztask.waitTime(1)
fire = viz.add('fire_small2.osg')
fire.setPosition([-1.35, 1.5, -2.75])
fire.hasparticles()
fire.setScale(1, .5, .5)
fire.addAction(vizact.spin(0,1,0,360))
ignition = fire.playsound('ignite.wav')
ignition.volume(.25)
explosion = fire.playsound('explosion.wav')
explosion.volume(.25)
firecracking = fire.playsound ('longfire.wav')
firecracking.volume(.25)
vizact.ontimer2(5, 1, KillFire, fire, ignition, explosion, firecracking)
fireActivated = True
开发者ID:vhilab,项目名称:thirdArm,代码行数:17,代码来源:touchcube.py
示例20: failedToDetect
def failedToDetect(self):
print 'Failed to detect'
viz.clearcolor(viz.RED)
# Temporarily stop presenting numbers
self.stopPresentingNumbers()
vizact.ontimer2(self.updateRateSecs,0,viz.clearcolor,viz.BLACK)
vizact.ontimer2(self.updateRateSecs,0,self.startPresentingNumbers)
import winsound
Freq = 200 # Set Frequency To 2500 Hertz
Dur = 150 # Set Duration To 1000 ms == 1 second
winsound.Beep(Freq,Dur)
if( networkingOn ):
netClient.send(message='numberTaskError')
开发者ID:performlabrit,项目名称:NumberDetectionTask,代码行数:18,代码来源:numberTask.py
注:本文中的vizact.ontimer2函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论