def handleMouseEventGlobal(self, event):
     if self.__isMouseDown:
         isGuiVisible = BigWorld.getWatcher('Visibility/GUI')
         if isGuiVisible is not None and isGuiVisible.lower() == 'false':
             self.updateCameraByMouseMove(event.dx, event.dy, event.dz)
             return True
     return False
 def __handleMouseEvent(self, event):
     if self.__isMouseDown:
         isGuiVisible = BigWorld.getWatcher('Visibility/GUI')
         if isGuiVisible is not None and isGuiVisible.lower() == 'false':
             self.__updateCameraByMouseMove(event.dx, event.dy, event.dz)
             return True
     return False
Example #3
0
def adjustSpeed(diff):
    global g_currentMoveRate
    g_currentMoveRate = max(0.1, g_currentMoveRate + diff)
    strafeRate = float(BigWorld.getWatcher('Client Settings/Strafe Rate'))
    strafeRate = 1.0 + math.pow(g_currentMoveRate,
                                MOVE_SPEED_POW) * MOVE_SPEED_MAX
    BigWorld.setWatcher('Client Settings/Strafe Rate', strafeRate)
 def handleMouseEvent(self, dx, dy, dz):
     isGuiVisible = BigWorld.getWatcher('Visibility/GUI')
     if isGuiVisible is not None and isGuiVisible.lower() == 'false':
         if self.__isMouseDown and self.hangarSpace is not None:
             result = self.hangarSpace.handleMouseEvent(dx, dy, dz)
             return result
     return False
Example #5
0
 def handleMouseEvent(self, dx, dy, dz):
     isGuiVisible = BigWorld.getWatcher('Visibility/GUI')
     if isGuiVisible is not None and isGuiVisible.lower() == 'false':
         if self.__isMouseDown and self.hangarSpace is not None:
             result = self.hangarSpace.handleMouseEvent(dx, dy, dz)
             return result
     return False
Example #6
0
    def enable(self, doEnable):
        if self.__isEnabled == doEnable:
            return
        from cameras import FovExtended
        if not doEnable:
            self.__isEnabled = False
            BigWorld.camera(self.__savedCamera)
            BigWorld.wg_enableSuperShot(False, False)
            for k, v in self.__savedWatchers.iteritems():
                BigWorld.setWatcher(k, v)

            FovExtended.instance().enabled = True
            BigWorld.projection().nearPlane = self.__nearPlane
            BigWorld.projection().farPlane = self.__farPlane
            BigWorld.setWatcher('Render/Fog/enabled', True)
            BigWorld.setWatcher('Occlusion Culling/Enabled', True)
            BigWorld.setWatcher('Render/Terrain/AdaptiveMesh/cascades enabled', True)
            BigWorld.setWatcher('Render/Water/out land water', True)
            LOG_DEBUG('Vertical screenshot camera is disabled')
            return
        self.__isEnabled = True
        self.__savedCamera = BigWorld.camera()
        FovExtended.instance().enabled = False
        arenaBB = BigWorld.player().arena.arenaType.spaceBoundingBox
        centerXZ = Math.Vector2(0.5 * (arenaBB[0][0] + arenaBB[1][0]), 0.5 * (arenaBB[0][1] + arenaBB[1][1]))
        halfSizesXZ = Math.Vector2(0.5 * (arenaBB[1][0] - arenaBB[0][0]), 0.5 * (arenaBB[1][1] - arenaBB[0][1]))
        camFov = math.radians(15.0)
        camPos = Math.Vector3(centerXZ.x, 0, centerXZ.z)
        aspectRatio = BigWorld.getAspectRatio()
        camPos.y = max(halfSizesXZ.x / math.sin(0.5 * camFov * aspectRatio), halfSizesXZ.y / math.sin(0.5 * camFov))
        camMatr = Math.Matrix()
        camMatr.setRotateYPR(Math.Vector3(0.0, math.pi * 0.5, 0.0))
        camMatr.translation = camPos
        camMatr.invert()
        self.__cam = BigWorld.FreeCamera()
        self.__cam.set(camMatr)
        BigWorld.camera(self.__cam)
        BigWorld.wg_enableSuperShot(True, False)
        self.__savedWatchers = {}
        for name in self.__watcherNames:
            try:
                self.__savedWatchers[name] = BigWorld.getWatcher(name)
                if name.startswith('Visibility'):
                    BigWorld.setWatcher(name, False)
            except TypeError:
                LOG_WARNING('Failed to get/set watcher', name)

        self.__nearPlane = BigWorld.projection().nearPlane
        self.__farPlane = BigWorld.projection().farPlane
        BigWorld.setWatcher('Render/Fog/enabled', False)
        BigWorld.projection().fov = camFov
        BigWorld.projection().nearPlane = max(0.1, camPos.y - 1000.0)
        BigWorld.projection().farPlane = camPos.y + 1000
        BigWorld.setWatcher('Render/Shadows/qualityPreset', 4)
        BigWorld.setWatcher('Client Settings/Script tick', False)
        BigWorld.setWatcher('Occlusion Culling/Enabled', False)
        BigWorld.setWatcher('Render/Terrain/AdaptiveMesh/cascades enabled', False)
        BigWorld.setWatcher('Render/Water/out land water', False)
        LOG_DEBUG('Vertical screenshot camera is enabled')
Example #7
0
    def enable(self, doEnable):
        if self.__isEnabled == doEnable:
            return
        from cameras import FovExtended
        if not doEnable:
            self.__isEnabled = False
            BigWorld.camera(self.__savedCamera)
            BigWorld.wg_enableSuperShot(False, False)
            for k, v in self.__savedWatchers.iteritems():
                BigWorld.setWatcher(k, v)

            FovExtended.instance().enabled = True
            LOG_DEBUG('Vertical screenshot camera is disabled')
            return
        self.__isEnabled = True
        self.__savedCamera = BigWorld.camera()
        FovExtended.instance().enabled = False
        arenaBB = BigWorld.wg_getSpaceBounds()
        centerXZ = Math.Vector2(0.5 * (arenaBB[0] + arenaBB[2]),
                                0.5 * (arenaBB[1] + arenaBB[3]))
        halfSizesXZ = Math.Vector2(0.5 * (arenaBB[2] - arenaBB[0]),
                                   0.5 * (arenaBB[3] - arenaBB[1]))
        camFov = math.radians(15.0)
        camPos = Math.Vector3(centerXZ.x, 0, centerXZ.z)
        aspectRatio = 1.0
        if not BigWorld.isVideoWindowed():
            aspectRatio = BigWorld.getFullScreenAspectRatio()
        else:
            aspectRatio = BigWorld.screenWidth() / BigWorld.screenHeight()
        camPos.y = max(halfSizesXZ.x / math.sin(0.5 * camFov * aspectRatio),
                       halfSizesXZ.y / math.sin(0.5 * camFov))
        camMatr = Math.Matrix()
        camMatr.setRotateYPR(Math.Vector3(0.0, math.pi * 0.5, 0.0))
        camMatr.translation = camPos
        camMatr.invert()
        self.__cam = BigWorld.FreeCamera()
        self.__cam.set(camMatr)
        BigWorld.camera(self.__cam)
        BigWorld.wg_enableSuperShot(True, False)
        self.__savedWatchers = {}
        for name in self.__watcherNames:
            try:
                self.__savedWatchers[name] = BigWorld.getWatcher(name)
                if name.startswith('Visibility'):
                    BigWorld.setWatcher(name, False)
            except TypeError:
                LOG_WARNING('Failed to get/set watcher', name)

        BigWorld.setWatcher('Client Settings/std fog/enabled', False)
        BigWorld.projection().fov = camFov
        BigWorld.setWatcher('Render/Fov', camFov)
        BigWorld.setWatcher('Render/Near Plane', max(0.1, camPos.y - 1000.0))
        BigWorld.setWatcher('Render/Far Plane', camPos.y + 1000.0)
        BigWorld.setWatcher('Render/Objects Far Plane/Enabled', False)
        BigWorld.setWatcher('Render/Shadows/qualityPreset', 7)
        BigWorld.setWatcher('Client Settings/Script tick', False)
        LOG_DEBUG('Vertical screenshot camera is enabled')
Example #8
0
    def enable(self, doEnable):
        if self.__isEnabled == doEnable:
            return
        from cameras import FovExtended
        if not doEnable:
            self.__isEnabled = False
            BigWorld.camera(self.__savedCamera)
            BigWorld.wg_enableSuperShot(False, False)
            for k, v in self.__savedWatchers.iteritems():
                BigWorld.setWatcher(k, v)

            FovExtended.instance().enabled = True
            LOG_DEBUG('Vertical screenshot camera is disabled')
            return
        self.__isEnabled = True
        self.__savedCamera = BigWorld.camera()
        FovExtended.instance().enabled = False
        arenaBB = BigWorld.wg_getSpaceBounds()
        centerXZ = Math.Vector2(0.5 * (arenaBB[0] + arenaBB[2]), 0.5 * (arenaBB[1] + arenaBB[3]))
        halfSizesXZ = Math.Vector2(0.5 * (arenaBB[2] - arenaBB[0]), 0.5 * (arenaBB[3] - arenaBB[1]))
        camFov = math.radians(15.0)
        camPos = Math.Vector3(centerXZ.x, 0, centerXZ.z)
        aspectRatio = 1.0
        if not BigWorld.isVideoWindowed():
            aspectRatio = BigWorld.getFullScreenAspectRatio()
        else:
            aspectRatio = BigWorld.screenWidth() / BigWorld.screenHeight()
        camPos.y = max(halfSizesXZ.x / math.sin(0.5 * camFov * aspectRatio), halfSizesXZ.y / math.sin(0.5 * camFov))
        camMatr = Math.Matrix()
        camMatr.setRotateYPR(Math.Vector3(0.0, math.pi * 0.5, 0.0))
        camMatr.translation = camPos
        camMatr.invert()
        self.__cam = BigWorld.FreeCamera()
        self.__cam.set(camMatr)
        BigWorld.camera(self.__cam)
        BigWorld.wg_enableSuperShot(True, False)
        self.__savedWatchers = {}
        for name in self.__watcherNames:
            try:
                self.__savedWatchers[name] = BigWorld.getWatcher(name)
                if name.startswith('Visibility'):
                    BigWorld.setWatcher(name, False)
            except TypeError:
                LOG_WARNING('Failed to get/set watcher', name)

        BigWorld.setWatcher('Client Settings/std fog/enabled', False)
        BigWorld.projection().fov = camFov
        BigWorld.setWatcher('Render/Fov', camFov)
        BigWorld.setWatcher('Render/Near Plane', max(0.1, camPos.y - 1000.0))
        BigWorld.setWatcher('Render/Far Plane', camPos.y + 1000.0)
        BigWorld.setWatcher('Render/Objects Far Plane/Enabled', False)
        BigWorld.setWatcher('Render/Shadows/qualityPreset', 7)
        BigWorld.setWatcher('Client Settings/Script tick', False)
        LOG_DEBUG('Vertical screenshot camera is enabled')
Example #9
0
def updateUmbraDisabled(item):
    return BigWorld.getWatcher(
        "Render/Umbra/enabled") == "false" and WorldEditor.getOptionInt(
            "render/useUmbra") == 0
Example #10
0
def adjustSpeed(diff):
    global g_currentMoveRate
    g_currentMoveRate = max(0.1, g_currentMoveRate + diff)
    strafeRate = float(BigWorld.getWatcher('Client Settings/Strafe Rate'))
    strafeRate = 1.0 + math.pow(g_currentMoveRate, MOVE_SPEED_POW) * MOVE_SPEED_MAX
    BigWorld.setWatcher('Client Settings/Strafe Rate', strafeRate)
Example #11
0
def updateUmbraDisabled( item ):
	return BigWorld.getWatcher( "Render/Umbra/enabled") == "false" and WorldEditor.getOptionInt("render/useUmbra") == 0