本文整理汇总了Python中vizact.ontimer2函数的典型用法代码示例。如果您正苦于以下问题:Python ontimer2函数的具体用法?Python ontimer2怎么用?Python ontimer2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ontimer2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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)
示例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)
示例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())
示例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)
示例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)
示例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)
示例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)
示例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()
示例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)
示例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]
示例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)