Пример #1
0
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()
Пример #2
0
def load(sceneRef=viz.MainScene):
    global SCENE
    SCENE = sceneRef  # TODO: Add scene params to all viz.add calls, etc in this module and submodules
    SCENE = viz.MainScene  # TODO: Add scene params to all viz.add calls, etc in this module and submodules

    # add bus
    BUS_OBJ_SCALE = 0.0365
    BUS_OSGB_SCALE = 35
    curscale = BUS_OSGB_SCALE
    bus = vizfx.addChild("bus_obj/Bus_Final_Scene2.osgb", scene=SCENE)
    bus.setScale([curscale] * 3)
    # bus.emissive(1,1,1) # Makes it look like daytime

    # add bus ambient noise
    global ambientAudio
    ambientAudio = viz.addAudio("Audio/Bus Scene/BusAmbientNoise.wav")

    # add homeless avatars
    global avatars
    avatars = avatarconfigStories.initAvatars(SCENE)

    # nodes to be removed at the end of the bus scene
    global toRemove
    toRemove = getRemoveNodes(bus)

    # make exit sign a node for selection to allow for ending the scene.
    exit = bus.getChild("Plane007")
    exit.name = "exit"
    exit.done = False
    avatars.append(exit)

    # init Avatar Stories and narration
    AvatarStories.init(avatars, toRemove, ambientAudio, SCENE)

    # BusLighting.addLighting(SCENE)
    BusLighting.addStreetlights(SCENE)
    global toggleBusLightsOnKeyPress
    toggleBusLightsOnKeyPress = vizact.onkeydown("z", BusLighting.toggleBusLighting)