Exemplo n.º 1
0
def enable():
    viz.MainWindow.setScene(SCENE)
    reset()

    global ambientAudio
    ambientAudio.volume(0.1)
    ambientAudio.loop(viz.ON)
    ambientAudio.play()

    viz.MainView.getHeadLight().disable()

    AvatarStories.enable()

    # Keypresses
    toggleBusLightsOnKeyPress.setEnabled(True)
    vizact.onkeydown("r", reset)
Exemplo n.º 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)
Exemplo n.º 3
0
def disable():
    AvatarStories.disable()
    toggleBusLightsOnKeyPress.setEnabled(False)
    ambientAudio.stop()