本文整理汇总了Python中viztask.schedule函数的典型用法代码示例。如果您正苦于以下问题:Python schedule函数的具体用法?Python schedule怎么用?Python schedule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了schedule函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: custom_walk
def custom_walk(self, points):
self.points = points
self.place_points = 0
self.avatar.setPosition(points[0][0])
self.next_point = points[0][0]
self.next_speed = points[0][1]
viztask.schedule(self.start_custom_walk())
开发者ID:rajeshnarasimha,项目名称:arimmersion,代码行数:7,代码来源:person.py
示例2: collision
def collision( self ):
#self.next_point = [self.next_point[0] - .1, 0, self.next_point[2] - .1] #get_quadrant(self.avatar.getPosition()).get_random_walk()#[self.avatar.getPosition()[0], 0, self.avatar.getPosition()[2] - 0.05]
yield viztask.addAction(self.avatar, vizact.waittime(0.5))
#self.avatar.lookat(self.next_point)
#yield viztask.addAction(self.avatar, vizact.waittime(1))
self.coll = 0
viztask.schedule(self.walk_around())
开发者ID:rajeshnarasimha,项目名称:arimmersion,代码行数:7,代码来源:person.py
示例3: playStory
def playStory():
global selectedAvatar, playing, avs
if selectedAvatar.name == 'exit':
viztask.schedule(playBusCloseAudio)
else:
selectedAvatar.story.play()
playing = True
toOutput = 'Started listening to ' + selectedAvatar.name
dc.collect(toOutput)
yield viztask.waitMediaEnd(selectedAvatar.story)
playing = False
selectedAvatar.done = True
if selectedAvatar.name == 'son/father':
for avatar in avs:
if avatar.name == 'father/son':
avatar.done = True
break
if selectedAvatar.name == 'father/son':
for avatar in avs:
if avatar.name == 'son/father':
avatar.done = True
break
toOutput = 'Finished listening to ' + selectedAvatar.name
dc.collect(toOutput)
yield viztask.waitTime(0.1)
selectedAvatar = None
开发者ID:vhilab,项目名称:homelessness-study,代码行数:29,代码来源:AvatarStories.py
示例4: __init__
def __init__(self, dataset):
self.modeName = ''
self._maxThreads = 8
self._curThreads = 0
self._meshes = []
self._meshesByFilename = {}
self._keystones = []
self._proximityList = []
self._boundingBoxes = {}
self._keyBindings = []
self._inRange = []
self._meshesById = {}
self._boneInfo = None
self._closestBoneIdx = None
self._prevBoneIdx = None
self._lastGrabbed = None
self._lastMeshGrabbed = None
self._lastBoxGrabbed = None
self._highlighted = None
self._gloveLink = None
self._grabFlag = False
self._snapAttempts = 0
self._imploded = False
self._pointerTexture = model.pointer.getTexture()
self._pointerOrigColor = model.pointer.getColor()
# self.viewcube = puzzleView.viewCube()
viztask.schedule(self.load(dataset))
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:35,代码来源:puzzleGame.py
示例5: load
def load(self, dataset):
"""
Load datasets and initialize everything necessary to commence
the puzzle game.
"""
# Dataset
model.ds = bp3d.DatasetInterface()
# Proximity management
model.proxManager = vizproximity.Manager()
target = vizproximity.Target(model.pointer)
model.proxManager.addTarget(target)
model.proxManager.onEnter(None, self.EnterProximity)
model.proxManager.onExit(None, self.ExitProximity)
#Setup Key Bindings
self.bindKeys()
self.score = PuzzleScore(self.modeName)
# viztask.schedule(soundTask(glove))
self._meshesToLoad = model.ds.getOntologySet(dataset)
self._filesToPreSnap = model.ds.getPreSnapSet()
yield self.loadControl(self._meshesToLoad)
yield self.prepareMeshes()
yield self.preSnap()
yield self.setKeystone(1)
viztask.schedule(self.updateClosestBone())
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:33,代码来源:puzzleGame.py
示例6: startZone3Hunt
def startZone3Hunt():
global SWIM_ZONE_TO_ZONE_COMPLETE_EVENT
# yield viztask.waitEvent(scavengerhunt.ZONE1_OVER_EVENT)
# print "waiting for swimming to end"
# yield viztask.waitEvent(SWIM_ZONE_TO_ZONE_COMPLETE_EVENT)
# scavengerhunt.disableGrabber()
# globals_oa.basket.disable(viz.RENDERING)
yield fader.fadeOutTask()
globals_oa.AUDIO_ZONE_CUT_AMBIENT.play()
# globals_oa.ZONE3_TRANSITION.play()
#Untested fish hiding
# for school in schooling.all_fish_schools:
# chromis_chromis.hidePercentage(20)
# diplodus_annularis.hidePercentage(100)
# labrus_viridis.hidePercentage(100)
# sarpa_salpa.hidePercentage(20)
for school in schooling.all_fish_schools:
school.hidePercentage(50)
globals_oa.currentZoneNumber = 2
transport_vhil.cycleZones()
#viz.res.addPublishFile('data/speciesToFindZone3.txt')
#scavengerhunt.initialize(globals_oa.terrainZone3, globals_oa.filePathToSpeciesForScavengerHuntInZone3)
#Enable swimming
yield fader.fadeInTask()
globals_oa.AUDIO_ZONE3_AMBIENT.play()
yield viztask.waitTime(3)
globals_oa.ZONE3_AUDIO_1.play()
# playAudioAndSaveGlobalPointer(globals_oa.ZONE3_AUDIO_1)
viztask.schedule(startBoatOutro())
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:31,代码来源:TheCrystalReef.py
示例7: main
def main():
global masterTimerG, recordingTimer
setUp()
masterTimerG = vizact.ontimer(0, masterTimer)
#recordingTimer = vizact.ontimer(0, recordCurrentSubjectStatus)
if not KEYBOARD_NAVIGATE:
addKeyPresses()
else:
# Setup keyboard/mouse tracker
tracker = vizcam.addWalkNavigate(moveScale=10.0)
tracker.setPosition([0,1.8,0])
viz.link(tracker,viz.MainView)
viz.mouse.setVisible(False)
def printLocation():
print viz.MainView.getPosition(), viz.MainView.getEuler()
vizact.onkeydown('p', printLocation)
#Add Wiimote support
# wii = viz.add('wiimote.dle')
# #Connect to first available wiimote
# wiimote = wii.addWiimote()
# wiimote.led = wii.LED_4
# #Add button functions
# vizact.onsensordown(wiimote,wii.BUTTON_A,TurnFlyingOn)
# vizact.onsensordown(wiimote,wii.BUTTON_B,TurnFlyingOff)
# vizact.onsensordown(wiimote,wii.BUTTON_1,endChildHappy)
#
#Hacky bug fix below, I apologize -Mark
if not FLYING_F and YOKE_F:
viztask.schedule(fixStartHeliPos)
开发者ID:vhilab,项目名称:Demos,代码行数:32,代码来源:Flying_Demo_2015.py
示例8: startThreeTouch
def startThreeTouch():
#Captures the initial timeFrame whent the cubes are set up.
global hfScoreTimes
# global startTime
# startTime = time.clock()
viztask.schedule(playThreeTouch)
print "scheduled the game at time = " + str(time.clock())
开发者ID:vhilab,项目名称:thirdArm,代码行数:7,代码来源:touchcube.py
示例9: ExitProximity
def ExitProximity(e):
global lSelectedNode, rSelectedNode, lhandtarget, rhandtarget, molecExited, h2omodels, NUM_H2O
print "moleucle has left the building!!"
print "exit prox: ", lSelectedNode, rSelectedNode
#drop molecule to specified place
obj = None
if e.target == lhandtarget:
obj = lSelectedNode
lSelectedNode = None
moleculeManager.removeTarget(lhandtarget)
elif e.target == rhandtarget:
obj = rSelectedNode
rSelectedNode = None
moleculeManager.removeTarget(rhandtarget)
rhGrabber.removeItems([obj])
lhGrabber.removeItems([obj])
print obj
molecExited = True
'''x,y,z = (h2omodels[0]).getPosition()
x += .5
moveToH2O = vizact.moveTo([x,y,z] , speed = .75)
obj.addAction(moveToH2O)
print "should be moving!"'''
viztask.schedule(moveCO2toH2O(obj))
#start molecule combination animation
#hide and remove h20 and co2 molecules
'''obj.visible(viz.OFF)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:31,代码来源:MoleculeGrabbingHandTarget.py
示例10: __init__
def __init__(self):
#init canvas and create themes for the test panel
self.canvas = viz.addGUICanvas(align = viz.ALIGN_CENTER_CENTER)
self.canvas.setPosition(0,0,0)
viz.mouse.setVisible(False)
self.name = 'test'
self._theme = viz.Theme()
self._theme.borderColor = (0.1,0.1,0.1,1)
self._theme.backColor = (0.4,0.4,0.4,1)
self._theme.lightBackColor = (0.6,0.6,0.6,1)
self._theme.darkBackColor = (0.2,0.2,0.2,1)
self._theme.highBackColor = (0.2,0.2,0.2,1)
self._theme.textColor = (1,1,1,1)
self._theme.highTextColor = (1,1,1,1)
#initialize test panel
vizdlg.Panel.__init__(self, parent = self.canvas, theme = self._theme, align = viz.ALIGN_CENTER_TOP, fontSize = 15)
self.visible(viz.OFF)
self.setScale(*[i*config.menuScale[self.name] for i in [1,1,1]])
self.alpha(0.6)
# #title
title = vizdlg.TitleBar('INSTRUCTIONS')
self.addItem(title, align = viz.ALIGN_CENTER_TOP)
#bones to be snapped. source snapped to target.
source = 'a'*20
self.sourceText = viz.addTextbox(parent = self.canvas)
self.sourceText.setLength(1.5)
target = 'a'*20
self.targetText = viz.addTextbox(parent = self.canvas)
self.targetText.setLength(1.5)
#instructions
self.Instruct1 = self.addItem(viz.addText('Snap the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
self.sourceCommand = self.addItem(self.sourceText, align = viz.ALIGN_CENTER_TOP)
self.Instruct2 = self.addItem(viz.addText('To the: ', parent = self.canvas), align = viz.ALIGN_CENTER_TOP)
self.targetCommand = self.addItem(self.targetText, align = viz.ALIGN_CENTER_TOP)
#render canvas
if config.dispMode == config.DisplayMode.monitor:
self.canvas.billboard(viz.BILLBOARD_YAXIS)
self.canvas.setPosition(-2,0,0)
self.canvas.setBackdrop(viz.ALIGN_CENTER_TOP)
if config.dispMode == config.DisplayMode.oculus:
bb = self.canvas.getBoundingBox()
self.canvas.setRenderWorldOverlay([bb.width*1, bb.height*1], fov = bb.height, distance = 0.4)
self.canvas.setPosition(0,0.05,0)
self.canvasViewPos = self.canvas.getPosition()
self.canvas.setEuler(0,15,0)
self.canvas.setPosition(0, -5, 0)
self.canvasHidePos = self.canvas.getPosition()
viztask.schedule(self.updatePanelPos())
vizact.onkeydown(viz.KEY_ESCAPE, self.toggle)
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:59,代码来源:view.py
示例11: onCollideBegin
def onCollideBegin(e):
global people
for person in people:
if person.avatar == e.obj1:
person.coll = 1
person.avatar.clearActions()
viztask.schedule(person.collision())
开发者ID:rajeshnarasimha,项目名称:arimmersion,代码行数:8,代码来源:person.py
示例12: MainTask
def MainTask():
"""Top level task that controls the game"""
# Display instructions and wait for key press to continue
yield DisplayInstructionsTask()
# Create panel to display trial results
resultPanel = vizinfo.InfoPanel("", align=viz.ALIGN_CENTER, fontSize=25, icon=False, key=None)
resultPanel.visible(False)
viztask.waitDirector(getData)
while True:
num_trials += 1
# Randomly choose hiding spots from list
locations = random.sample(HIDING_SPOTS, TRIAL_COUNT)
# Reset score
score = 0
UpdateScore(score)
# Go through each position
for pos in locations:
# Perform a trial
found = yield TrialTask(pos)
# Update score and display status text
if found:
viz.playSound("sounds/pigeon_catch.wav")
score += 1
total_score += 1
UpdateScore(score)
tracker.runAction(vizact.spinTo(point=pos, time=0.8, interpolate=vizact.easeOutStrong))
resultPanel.setText(TRIAL_SUCCESS)
else:
viz.playSound("sounds/pigeon_fly.wav")
viztask.schedule(FadeToGrayTask())
resultPanel.setText(TRIAL_FAIL)
# Display success/failure message
resultPanel.visible(True)
# Add delay before starting next trial
yield viztask.waitTime(TRIAL_DELAY)
resultPanel.visible(False)
# Disable gray effect
gray_effect.setEnabled(False)
viztask.waitDirector(writeScore, score)
# Display results and ask to quit or play again
resultPanel.setText(RESULTS.format(score, TRIAL_COUNT))
resultPanel.visible(True)
yield viztask.waitKeyDown(" ")
resultPanel.visible(False)
开发者ID:vhilab,项目名称:VRITS-2015,代码行数:58,代码来源:HuntPigeon.py
示例13: ExitProximity
def ExitProximity(e):
global lSelectedNode, rSelectedNode, lhandtarget, rhandtarget, molecExited, h2omodels, NUM_H2O
print "moleucle has left the building!!"
print "exit prox: ", lSelectedNode, rSelectedNode
#drop molecule to specified place
obj = None
if e.target == lhandtarget:
if lSelectedNode == None: return #If hand exits but has no molecule
obj = lSelectedNode
lSelectedNode = None
moleculeManager.removeTarget(lhandtarget)
elif e.target == rhandtarget:
if rSelectedNode == None: return #If hand exits but has no molecule
obj = rSelectedNode
rSelectedNode = None
moleculeManager.removeTarget(rhandtarget)
rhGrabber.removeItems([obj])
lhGrabber.removeItems([obj])
print obj
molecExited = True
x,y,z = (h2omodels[0]).getPosition()
x += .5
'''moveToH2O = vizact.moveTo([x,y,z] , speed = .75)
obj.addAction(moveToH2O)
print "should be moving!"'''
#viztask.schedule( fadeAndAppear() )
viztask.schedule(moveCO2toH2O(obj))
#moveCO2 = vizact.moveTo([x,y,z],speed = .75 )
#obj.addAction(moveCO2)
'''co2 = obj
print "in moveCO2toH20", co2
#global h2omodels, NUM_H2O
x,y,z = (h2omodels[0]).getPosition()
x += .3
moveToH2O = vizact.moveTo([x,y,z] , speed = 1.75)
print x,y,z
print (h2omodels[0]).getPosition()
#viztask.addAction(co2, vizact.move(x,y,z,2))
sequence = vizact.sequence(moveToH2O, vizact.waittime(4), vizact.fadeTo(0, time = 1))
yield co2.add(sequence)
print "should be moving!"
#yield viztask.waitTime(2)
#"before turning off co2"
#co2.visible(viz.OFF)
h2omodels[0].visible(viz.OFF)
print "before removing h20"
h2omodels.remove(h2omodels[0])
NUM_H2O -= 1 '''
print "past viztask in exit prox"
#start molecule combination animation
#hide and remove h20 and co2 molecules
'''obj.visible(viz.OFF)
开发者ID:vhilab,项目名称:Ocean-Acidification,代码行数:57,代码来源:MoleculeGrabbingProximityWorking.py
示例14: disable
def disable():
global enabled
global selector
if enabled:
selector.disable()
enabled = False
viztask.schedule(playBusCloseAudio())
开发者ID:vhilab,项目名称:homelessness-study,代码行数:9,代码来源:AvatarStories.py
示例15: enable
def enable():
global started, enabled
global selector
if not started:
viztask.schedule(begin())
started = True
enabled = True
开发者ID:vhilab,项目名称:homelessness-study,代码行数:9,代码来源:AvatarStories.py
示例16: 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
示例17: checkForNextEvent
def checkForNextEvent( obj ):
global OBJS_WITH_NARRATION, selector
evict = next((obj for obj in OBJS_WITH_NARRATION if obj.name == 'EvictionNotice'), None)
door = next((obj for obj in OBJS_WITH_NARRATION if obj.name == 'Door'), None)
if obj.name == 'Radio.OSGB': playNarrationFile(door)
elif obj.name == 'Door': playNarrationFile(evict)
else:
selector.crosshair.visible(True)
viztask.schedule(prepareForObjectSelling(evict))
开发者ID:vhilab,项目名称:homelessness-study,代码行数:10,代码来源:ApartmentNarration.py
示例18: snap
def snap(self):
"""
Moves dog to the pos and euler of its target (dogTarget)
"""
movePos = vizact.moveTo(self.outlineCenter.getPosition(), time = self.snapTransitionTime)
moveAng = vizact.spinTo(euler = self.outlineCenter.getEuler(), time = self.snapTransitionTime)
transition = vizact.parallel(movePos, moveAng)
self.dogCenter.addAction(transition)
viz.playSound(".\\dataset\\snap.wav")
viztask.schedule(self.mechanics())
开发者ID:bmj8778,项目名称:sterescopicTableTop,代码行数:10,代码来源:tutorialGame.py
示例19: update
def update(self):
if not self.__nvd.isInView():
return True
else:
global seatQueue
if timerEnded and abs(self.__node.getPosition()[0] - firstSeatPosition[0]) > 0.1:
seatQueue.rotate(1) # Takes the most recent (past) position
viztask.schedule( moveBackwards(self.__node, seatQueue[0]) )
return True#abs(seatQueue[0][0] - self.__node.getPosition()[0]) < 0.1
else: return False
开发者ID:vhilab,项目名称:homelessness-study,代码行数:10,代码来源:CreepySeatChanging.py
示例20: snap
def snap(dog, dogTarget):
"""
Moves dog to the pos and euler of its target (dogTarget)
"""
movePos = vizact.moveTo(dogTarget.getPosition(), time=snapTransitionTime)
moveAng = vizact.spinTo(euler=dogTarget.getEuler(), time=snapTransitionTime)
transition = vizact.parallel(movePos, moveAng)
dog.addAction(transition)
viz.playSound(".\\dataset\\snap.wav")
viztask.schedule(Tutorial.mechanics())
开发者ID:erikmessier,项目名称:anatomy-puzzle,代码行数:10,代码来源:tutorial.py
注:本文中的viztask.schedule函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论