def disable(): CreepySeatChanging.disable() controlAvOnKeyPress.setEnabled(False) controlViewOnKeyPress.setEnabled(False) toggleBusLightsOnKeyPress.setEnabled(False) introAudio.stop() ambientAudio.stop()
def load(sceneRef=viz.MainScene): global SCENE SCENE = sceneRef # TODO: Add scene params to all viz.add calls, etc in this module and submodules #Add audio global introAudio introAudio = viz.addAudio('Audio/Bus Scene/BusIntroduction.wav') global ambientAudio ambientAudio = viz.addAudio('Audio/Bus Scene/BusAmbientNoise.wav') #add bus BUS_OBJ_SCALE = .0365 BUS_OSGB_SCALE = 35 curscale = BUS_OSGB_SCALE bus = vizfx.addChild('bus_obj/Bus_Final_Scene1.OSGB', scene=SCENE) bus.setScale([curscale]*3) #bus.emissive(1,1,1) # Makes it look like daytime # add homeless avatars global avatars avatars = avatarconfig.initAvatars(SCENE) # create reference to backpack and thief for fading. The .fade attribute = True means that the # object should fade if not in view. pack_objs = [] pack = bus.getChild('pack') straps = bus.getChild('backpackstraps') avatars[1].fade = False pack.fade = True straps.fade = True pack_objs.append(avatars[1]) pack_objs.append(pack) pack_objs.append(straps) viz.MainView.getHeadLight().disable() global controlAvOnKeyPress, controlViewOnKeyPress controlAvOnKeyPress = vizact.onkeydown('c', keyboardcontrol.control, avatars[0]) controlViewOnKeyPress = vizact.onkeydown('v', keyboardcontrol.control, MainView) if RIFT: creepySeatChanging = CreepySeatChanging.init(avatars[0], pack_objs, introAudio, vfov=VFOV_RIFT, hfov=HFOV_RIFT) else: creepySeatChanging = CreepySeatChanging.init(avatars[0], pack_objs, introAudio, vfov=VFOV_DEFAULT) CreepySeatChanging.disable() #BusLighting.addLighting(SCENE) BusLighting.addStreetlights(SCENE) global toggleBusLightsOnKeyPress toggleBusLightsOnKeyPress = vizact.onkeydown('z', BusLighting.toggleBusLighting) global dc dc = DataCollector(filePrefix='Data/CreepySeatTrackingData_Participant', fileSuffix='.csv') dc.addMainviewTracker() dc.startCollecting()
def enable(): viz.MainWindow.setScene(SCENE) reset() global introAudio global ambientAudio ambientAudio.volume(.1) ambientAudio.loop(viz.ON) introAudio.volume(2) ambientAudio.play() introAudio.play() # Functionality CreepySeatChanging.enable() # Keypresses controlAvOnKeyPress.setEnabled(True) controlViewOnKeyPress.setEnabled(True) toggleBusLightsOnKeyPress.setEnabled(True) vizact.onkeydown('r', reset)