def __setupCamera(self): self.__cam = BigWorld.CursorCamera() self.__cam.spaceID = self.__spaceId self.__cam.pivotMaxDist = _CFG['cam_start_dist'] self.__cam.pivotMinDist = 0.0 self.__cam.maxDistHalfLife = _CFG['cam_fluency'] self.__cam.turningHalfLife = _CFG['cam_fluency'] self.__cam.movementHalfLife = 0.0 self.__cam.pivotPosition = _CFG['cam_pivot_pos'] mat = Math.Matrix() mat.setRotateYPR((math.radians(_CFG['cam_start_angles'][0]), math.radians(_CFG['cam_start_angles'][1]), 0.0)) self.__cam.source = mat mat = Math.Matrix() mat.setTranslate(_CFG['cam_start_target_pos']) self.__cam.target = mat BigWorld.camera(self.__cam) from gui.WindowsManager import g_windowsManager container = g_windowsManager.window.containerManager.getContainer( 'lobbySubView') from gui.Scaleform.daapi.settings.views import VIEW_ALIAS if container is not None and container.getView( ).uniqueName == VIEW_ALIAS.LOBBY_CUSTOMIZATION: self.locateCameraToPreview() return
def __setupCamera(self): from gui.ClientHangarSpace import hangarCFG cfg = hangarCFG() self.__cam = BigWorld.CursorCamera() self.__cam.isHangar = True self.__cam.spaceID = self.__spaceId self.__cam.pivotMaxDist = mathUtils.clamp(cfg['cam_dist_constr'][0], cfg['cam_dist_constr'][1], cfg['cam_start_dist']) self.__cam.pivotMinDist = 0.0 self.__cam.maxDistHalfLife = cfg['cam_fluency'] self.__cam.turningHalfLife = cfg['cam_fluency'] self.__cam.movementHalfLife = cfg['cam_fluency'] self.__cam.pivotPosition = cfg['cam_pivot_pos'] self.__camConstraints[0] = cfg['cam_pitch_constr'] self.__camConstraints[1] = cfg['cam_yaw_constr'] self.__camConstraints[2] = (0.0, 0.0) self.__yawCameraFilter = HangarCameraYawFilter( math.radians(cfg['cam_yaw_constr'][0]), math.radians(cfg['cam_yaw_constr'][1]), cfg['cam_sens']) self.__yawCameraFilter.setYawLimits(self.__camConstraints[1]) mat = Math.Matrix() yaw = self.__yawCameraFilter.toLimit( math.radians(cfg['cam_start_angles'][0])) mat.setRotateYPR((yaw, math.radians(cfg['cam_start_angles'][1]), 0.0)) self.__cam.source = mat mat = Math.Matrix() mat.setTranslate(cfg['cam_start_target_pos']) self.__cam.target = mat self.__cam.wg_applyParams() BigWorld.camera(self.__cam) self.__cameraIdle = HangarCameraIdle(self.__cam) self.__cameraParallax = HangarCameraParallax(self.__cam) self.__cam.setDynamicCollisions(True)
def __init__(self, dataSec): super(ArtyCamera, self).__init__() CallbackDelayer.__init__(self) self.isAimOffsetEnabled = True self.__positionOscillator = None self.__positionNoiseOscillator = None self.__switchers = CameraSwitcherCollection(cameraSwitchers=[ CameraSwitcher(switchType=SwitchTypes.FROM_TRANSITION_DIST_AS_MAX, switchToName=CTRL_MODE_NAME.STRATEGIC, switchToPos=0.0) ], isEnabled=True) self.__dynamicCfg = CameraDynamicConfig() self._readConfigs(dataSec) self.__cam = BigWorld.CursorCamera() self.__curSense = self._cfg['sensitivity'] self.__onChangeControlMode = None self.__camDist = 0.0 self.__desiredCamDist = 0.0 self.__aimingSystem = None self.__prevTime = 0.0 self.__prevAimPoint = Vector3() self.__dxdydz = Vector3(0.0, 0.0, 0.0) self.__autoUpdatePosition = False self.__needReset = 0 self.__sourceMatrix = None self.__targetMatrix = None self.__rotation = 0.0 self.__positionHysteresis = None self.__timeHysteresis = None self.__transitionEnabled = True self.__scrollSmoother = SPGScrollSmoother(0.3) self.__collisionDist = 0.0 self.__camViewPoint = Vector3() return
def __init__(self, dataSec): super(StrategicCamera, self).__init__() CallbackDelayer.__init__(self) self.__positionOscillator = None self.__positionNoiseOscillator = None self.__activeDistRangeSettings = None self.__dynamicCfg = CameraDynamicConfig() self.__cameraYaw = 0.0 self.__switchers = CameraSwitcherCollection(cameraSwitchers=[CameraSwitcher(switchType=SwitchTypes.FROM_TRANSITION_DIST_AS_MIN, switchToName=CTRL_MODE_NAME.ARTY, switchToPos=1.0)], isEnabled=True) self._readConfigs(dataSec) self.__cam = BigWorld.CursorCamera() self.__cam.isHangar = False self.__curSense = self._cfg['sensitivity'] self.__onChangeControlMode = None self.__aimingSystem = None self.__prevTime = BigWorld.time() self.__autoUpdatePosition = False self.__dxdydz = Vector3(0, 0, 0) self.__needReset = 0 self.__smoothingPivotDelta = 0 self.__transitionEnabled = True self.__camDist = 0.0 self.__scrollSmoother = SPGScrollSmoother(0.3) self.__saveDist = False return
def testWindow(): BigWorld.camera(BigWorld.CursorCamera()) BigWorld.setCursor(GUI.mcursor()) GUI.mcursor().visible = True clear() w = GUI.load('gui/tests/window.gui') GUI.addRoot(w) return w
def __init__(self, dataSec): self.__readCfg(dataSec) self.__cam = BigWorld.CursorCamera() self.__requiredHeight = 0.0 self.__totalMove = Math.Vector3(0, 0, 0) self.__yaw = 0.0 self.__curSense = 0 self.__autoUpdateCallbackId = None self.__onChangeControlMode = None return
def init(self): self.__cam = BigWorld.CursorCamera() self.__cam.pivotMaxDist = 0 self.__cam.pivotMinDist = 0 self.__cam.turningHalfLife = self.__cam.maxDistHalfLife = self.__cfg[ 'cam_fluency'] self.__cam.movementHalfLife = 0.0 self.__cam.pivotPosition = Math.Vector3() self.__cam.source = Math.Matrix() self.__cam.target = Math.Matrix() self.__cam.wg_applyParams()
def __init__(self): CallbackDelayer.__init__(self) self.__totalInterpolationTime = max(0.01, _INTERPOLATION_TIME) self.__elapsedTime = 0.0 self.__easingMethod = _EASING_METHOD self.__cam = BigWorld.CursorCamera() self.__prevTime = 0.0 self.__initialState = None self.__finalState = None self.__initialFov = 0.0 self.__finalFov = 0.0 return
def __setupCamera(self): if self.__cam is None: self.__cam = BigWorld.CursorCamera() self.__cam.target = mathUtils.MatrixProviders.product( self.__finalState.target.a, Math.Matrix()) self.__cam.source = Math.Matrix() self.__cam.pivotMaxDist = 0.0 self.__cam.maxDistHalfLife = 0.01 self.__cam.movementHalfLife = 0.0 self.__cam.turningHalfLife = -1 self.__cam.pivotPosition = self.__initialState.pivotPosition self.__cam.forceUpdate() BigWorld.camera(self.__cam) BigWorld.projection().fov = self.__initialFov return
def __init__(self, dataSec): CallbackDelayer.__init__(self) self.__positionOscillator = None self.__positionNoiseOscillator = None self.__dynamicCfg = CameraDynamicConfig() self.__readCfg(dataSec) self.__cam = BigWorld.CursorCamera() self.__curSense = self.__cfg['sensitivity'] self.__onChangeControlMode = None self.__aimingSystem = None self.__prevTime = BigWorld.time() self.__autoUpdatePosition = False self.__dxdydz = Vector3(0, 0, 0) self.__needReset = 0 self.__smoothingPivotDelta = 0 return
def __init__(self, dataSec): self.__shiftKeySensor = None self.__readCfg(dataSec) self.__cam = BigWorld.CursorCamera() self.__camDist = 0 self.__curSense = 0 self.__curScrollSense = 0 self.__pitch = 0.0 self.__yaw = 0.0 self.__cursorOffset = (0, 0) self.__postmortemMode = False self.__modelsToCollideWith = [] self.__defaultPivotPos = Math.Vector3(0, 0, 0) self.__onChangeControlMode = None self.__autoUpdateCallbackId = None self.__cameraUpdateCallbackId = None return
def __init__(self, dataSec, aim): CallbackDelayer.__init__(self) self.__positionOscillator = None self.__positionNoiseOscillator = None self.__dynamicCfg = CameraDynamicConfig() self.__readCfg(dataSec) self.__cam = BigWorld.CursorCamera() self.__curSense = self.__cfg['sensitivity'] self.__onChangeControlMode = None self.__aimingSystem = StrategicAimingSystem( self.__cfg['distRange'][0], StrategicCamera._CAMERA_YAW) self.__prevTime = BigWorld.time() self.__aimOffsetFunc = None if aim is None: self.__aimOffsetFunc = lambda x=None: (0, 0) else: self.__aimOffsetFunc = aim.offset self.__autoUpdatePosition = False self.__dxdydz = Vector3(0, 0, 0) self.__needReset = 0
def __setupCamera(self): global _CAM_START_TARGET_POS global _CAM_START_DIST global _CAM_PIVOT_POS global _CAM_START_ANGLES global _CAM_FLUENCY self.__cam = BigWorld.CursorCamera() self.__cam.spaceID = self.__spaceId self.__cam.pivotMaxDist = _CAM_START_DIST self.__cam.maxDistHalfLife = _CAM_FLUENCY self.__cam.turningHalfLife = _CAM_FLUENCY self.__cam.movementHalfLife = 0.0 self.__cam.pivotPosition = _CAM_PIVOT_POS mat = Math.Matrix() mat.setRotateYPR((math.radians(_CAM_START_ANGLES[1]), math.radians(_CAM_START_ANGLES[0]), 0.0)) self.__cam.source = mat mat = Math.Matrix() mat.setTranslate(_CAM_START_TARGET_POS) self.__cam.target = mat BigWorld.camera(self.__cam)
def __setupCamera(self): self.__cam = BigWorld.CursorCamera() self.__cam.spaceID = self.__spaceId self.__cam.pivotMaxDist = mathUtils.clamp(_CFG['cam_dist_constr'][0], _CFG['cam_dist_constr'][1], _CFG['cam_start_dist']) self.__cam.pivotMinDist = 0.0 self.__cam.maxDistHalfLife = _CFG['cam_fluency'] self.__cam.turningHalfLife = _CFG['cam_fluency'] self.__cam.movementHalfLife = 0.0 self.__cam.pivotPosition = _CFG['cam_pivot_pos'] mat = Math.Matrix() yaw = self.__yawCameraFilter.toLimit( math.radians(_CFG['cam_start_angles'][0])) mat.setRotateYPR((yaw, math.radians(_CFG['cam_start_angles'][1]), 0.0)) self.__cam.source = mat mat = Math.Matrix() mat.setTranslate(_CFG['cam_start_target_pos']) self.__cam.target = mat self.__cam.wg_applyParams() BigWorld.camera(self.__cam)
def __init__(self, dataSec): CallbackDelayer.__init__(self) self.__positionOscillator = None self.__positionNoiseOscillator = None self.__dynamicCfg = CameraDynamicConfig() self.__readCfg(dataSec) self.__cam = BigWorld.CursorCamera() self.__curSense = self.__cfg['sensitivity'] self.__onChangeControlMode = None self.__camDist = 0.0 self.__desiredCamDist = 0.0 self.__aimingSystem = None self.__prevTime = 0.0 self.__dxdydz = Vector3(0.0, 0.0, 0.0) self.__autoUpdatePosition = False self.__needReset = 0 self.__sourceMatrix = None self.__targetMatrix = None self.__rotation = 0.0 self.__positionHysteresis = None self.__timeHysteresis = None return
def __setupCamera(self): if self.__cam: self.__cam = None if self.__cameraIdle: self.__cameraIdle.destroy() self.__cameraIdle = None self.__cam = BigWorld.CursorCamera() self.__cam.isHangar = True self.__cam.spaceID = self.__initialCam.spaceID self.__cam.maxDistHalfLife = 0 self.__cam.pivotPosition = Math.Vector3(0.0, 0.0, 0.0) self.__yawCameraFilter = HangarCameraYawFilter( self.__currentParams.yawConstraints[0], self.__currentParams.yawConstraints[1], self.__currentParams.sensitivity) targetMatrix = Math.Matrix() targetMatrix.setTranslate(self.__currentParams.targetPos) self.__cam.target = targetMatrix distance = self.__currentParams.initMatrix.translation.distTo( self.__currentParams.targetPos) self.__cam.pivotMaxDist = distance sourceMatrix = Math.Matrix() sourceMatrix.setRotateYPR( Math.Vector3(self.__currentParams.initMatrix.yaw, -self.__currentParams.initMatrix.pitch, 0.0)) self.__cam.source = sourceMatrix if self.__currentParams.name == AnchorNames.HEROTANK: self.__cam.setDynamicCollisions(True) self.__cameraIdle = HangarCameraIdle(self.__cam) self.__cameraIdle.setDefaultStartDelay() self.__cam.forceUpdate() if self.__cameraParallax: self.__cameraParallax.deactivate() self.__cameraParallax.destroy() self.__cameraParallax = None self.__cameraParallax = HangarCameraParallax(self.__cam) self.__cameraParallax.activate() return
def setup(): BigWorld.camera(BigWorld.CursorCamera()) BigWorld.setCursor(GUI.mcursor()) GUI.mcursor().visible = True
anchors game localReSort globalReSort mouseEvents mouseButtonFocus To execute a test, type GUITest.testname() into the Python console. You can use GUITest.clear() to remove all GUI components from the screen. """ import math import BigWorld, GUI, Math import Keys import random from functools import partial BigWorld.camera(BigWorld.CursorCamera()) BigWorld.setCursor(GUI.mcursor()) GUI.mcursor().visible = True def clear(): for x in GUI.roots(): GUI.delRoot(x) GUI.mcursor().visible = True GUI.mcursor().clipped = False BigWorld.setCursor(GUI.mcursor()) def _setAllModeCombinations(c, name): setattr(c, name, 'PIXEL') setattr(c, name, 'LEGACY')