def ClientMain(): # create fog effect getSimContext().setFog() # add a camera camRotateSpeed = 100 camMoveSpeed = 3000 camZoomSpeed = 500 cam = getSimContext().addCamera(camRotateSpeed, camMoveSpeed, camZoomSpeed) cam.setFarPlane(5000) cam.setEdgeScroll(False) recenter_cam = recenter(cam) # create a closure to avoid having a global variable recenter_cam() # call the recenter function # load the background addObject("data/terrain/Sea.xml", Vector3f(-3000 + NUDGE_X,-3000 + NUDGE_Y,-20)) addObject("data/terrain/IslandTerrain.xml", Vector3f(-1100 + NUDGE_X, -2400 + NUDGE_Y, -17), Vector3f(0,0,-45)) addSkyBox("data/sky/irrlicht2") # load the maze getSimContext().addLightSource(Vector3f(-500,-500,1000), 1500) getMod().add_maze() # load the GUI CreateGui(getGuiManager()) # create the key binding ioMap = createInputMapping() ioMap.BindKey( "KEY_SPACE", "onPress", recenter_cam ) getSimContext().setInputMapping(ioMap)
def ClientMain(): # physics off, ai off by default # disable_physics() OpenNero.disable_ai() if not module.getMod().setup_map(): inputConfig.switchToHub() return # add a light source OpenNero.getSimContext().addLightSource(OpenNero.Vector3f(500, -500, 1000), 1500) # common.addSkyBox("data/sky/irrlicht2") # setup the gui CreateGui(common.getGuiManager()) # add a camera camRotateSpeed = 100 camMoveSpeed = 15000 camZoomSpeed = 200 cam = OpenNero.getSimContext().addCamera(camRotateSpeed, camMoveSpeed, camZoomSpeed) cam.setFarPlane(40000) cam.setEdgeScroll(False) recenter_cam = recenter(cam) recenter_cam() # create the io map ioMap = inputConfig.createInputMapping() ioMap.BindKey("KEY_SPACE", "onPress", recenter_cam) OpenNero.getSimContext().setInputMapping(ioMap)
def ClientMain(mode): # create fog effect getSimContext().setFog() # add a camera camRotateSpeed = 100 camMoveSpeed = 3000 camZoomSpeed = 500 cam = getSimContext().addCamera(camRotateSpeed, camMoveSpeed, camZoomSpeed) cam.setFarPlane(5000) cam.setEdgeScroll(False) recenter_cam = recenter( cam) # create a closure to avoid having a global variable recenter_cam() # call the recenter function # load the background addObject("data/terrain/Sea.xml", Vector3f(-3000 + NUDGE_X, -3000 + NUDGE_Y, -20)) addObject("data/terrain/IslandTerrain.xml", Vector3f(-1100 + NUDGE_X, -2400 + NUDGE_Y, -17), Vector3f(0, 0, -45)) addSkyBox("data/sky/irrlicht2") # load the maze getSimContext().addLightSource(Vector3f(-500, -500, 1000), 1500) getMod().add_maze() # load the GUI CreateGui(getGuiManager(), mode) # create the key binding ioMap = createInputMapping() ioMap.BindKey("KEY_SPACE", "onPress", recenter_cam) getSimContext().setInputMapping(ioMap)
def ClientMain(): # physics off, ai off by default #disable_physics() OpenNero.disable_ai() if not module.getMod().setup_map(): inputConfig.switchToHub() return # add a light source OpenNero.getSimContext().addLightSource(OpenNero.Vector3f(500, -500, 1000), 1500) #common.addSkyBox("data/sky/irrlicht2") # setup the gui CreateGui(common.getGuiManager()) # add a camera camRotateSpeed = 100 camMoveSpeed = 15000 camZoomSpeed = 200 cam = OpenNero.getSimContext().addCamera(camRotateSpeed, camMoveSpeed, camZoomSpeed) cam.setFarPlane(40000) cam.setEdgeScroll(False) recenter_cam = recenter(cam) recenter_cam() # create the io map ioMap = inputConfig.createInputMapping() ioMap.BindKey("KEY_SPACE", "onPress", recenter_cam) OpenNero.getSimContext().setInputMapping(ioMap)