コード例 #1
0
    def __init__(self, dataSec, defaultOffset = None):
        CallbackDelayer.__init__(self)
        TimeDeltaMeter.__init__(self)
        self.__shiftKeySensor = None
        self.__movementOscillator = None
        self.__impulseOscillator = None
        self.__noiseOscillator = None
        self.__dynamicCfg = CameraDynamicConfig()
        self.__accelerationSmoother = None
        self.__readCfg(dataSec)
        self.__onChangeControlMode = None
        self.__aimingSystem = None
        self.__curSense = 0
        self.__curScrollSense = 0
        self.__postmortemMode = False
        self.__vehiclesToCollideWith = set()
        self.__focalPointDist = 1.0
        self.__autoUpdateDxDyDz = Vector3(0.0)
        self.__updatedByKeyboard = False
        if defaultOffset is not None:
            self.__defaultAimOffset = defaultOffset
            self.__cam = BigWorld.HomingCamera(self.__adCfg['enable'])
            if self.__adCfg['enable']:
                self.__cam.initAdvancedCollider(self.__adCfg['fovRatio'], self.__adCfg['rollbackSpeed'], self.__adCfg['minimalCameraDistance'], self.__adCfg['speedThreshold'], self.__adCfg['minimalVolume'])
                for group_name in VOLUME_GROUPS_NAMES:
                    self.__cam.addVolumeGroup(self.__adCfg['volumeGroups'][group_name])

            self.__cam.aimPointClipCoords = defaultOffset
        else:
            self.__defaultAimOffset = Vector2()
            self.__cam = None
        return
コード例 #2
0
 def __init__(self):
     CallbackDelayer.__init__(self)
     ComponentSystem.__init__(self)
     self.__alwaysShowAimKey = None
     self.__showMarkersKey = None
     sec = self._readCfg()
     self.onCameraChanged = Event()
     self.onPostmortemVehicleChanged = Event()
     self.onPostmortemKillerVisionEnter = Event()
     self.onPostmortemKillerVisionExit = Event()
     self.__isArenaStarted = False
     self.__isStarted = False
     self.__targeting = _Targeting()
     self.__vertScreenshotCamera = _VertScreenshotCamera()
     self.__ctrls = dict()
     self.__killerVehicleID = None
     self.__isAutorotation = True
     self.__prevModeAutorotation = None
     self.__isSPG = False
     self.__isATSPG = False
     self.__setupCtrls(sec)
     self.__curCtrl = self.__ctrls[_CTRLS_FIRST]
     self.__ctrlModeName = _CTRLS_FIRST
     self.__isDetached = False
     self.__waitObserverCallback = None
     self.__observerVehicle = None
     self.__observerIsSwitching = False
     self.__commands = []
     self.__remoteCameraSender = None
     self.__isGUIVisible = False
     return
コード例 #3
0
ファイル: __init__.py プロジェクト: webiumsk/WOT-0.9.15.1
 def __init__(self):
     CallbackDelayer.__init__(self)
     self.__alwaysShowAimKey = None
     self.__showMarkersKey = None
     sec = self._readCfg()
     self.onCameraChanged = Event()
     self.onPostmortemVehicleChanged = Event()
     self.onSetReloading = Event()
     self.onSetReloadingPercents = Event()
     self.__isArenaStarted = False
     self.__isStarted = False
     self.__targeting = _Targeting()
     self.__vertScreenshotCamera = _VertScreenshotCamera()
     self.__ctrls = dict()
     self.__killerVehicleID = None
     self.__isAutorotation = True
     self.__prevModeAutorotation = None
     self.__isSPG = False
     self.__isATSPG = False
     self.__setupCtrls(sec)
     self.__curCtrl = self.__ctrls[_CTRLS_FIRST]
     self.ctrlModeName = _CTRLS_FIRST
     self.__isDetached = False
     self.__waitObserverCallback = None
     self.__observerVehicle = None
     return
コード例 #4
0
 def destroy(self):
     super(BotAirdrop, self).destroy()
     CallbackDelayer.destroy(self)
     self.__removeMarkerArea()
     self.__removeDeliveryEffect()
     ScriptGameObject.destroy(self)
     CallbackDelayer.destroy(self)
コード例 #5
0
ファイル: videocamera.py プロジェクト: webiumsk/WOT-0.9.12
 def destroy(self):
     CallbackDelayer.destroy(self)
     self.__cam = None
     if self.__aim is not None:
         self.__aim.destroy()
         self.__aim = None
     return
コード例 #6
0
 def destroy(self):
     self.__trackScrollCtl = None
     if self.__vehicle is not None:
         self.deactivate()
     self.__destroySystems()
     ComponentSystem.destroy(self)
     self.__typeDesc = None
     self.highlighter.destroy()
     if self.__vibrationsCtrl is not None:
         self.__vibrationsCtrl.destroy()
         self.__vibrationsCtrl = None
     if self.__lightFxCtrl is not None:
         self.__lightFxCtrl.destroy()
         self.__lightFxCtrl = None
     if self.__auxiliaryFxCtrl is not None:
         self.__auxiliaryFxCtrl.destroy()
         self.__auxiliaryFxCtrl = None
     if self.__boundEffects is not None:
         self.__boundEffects.destroy()
     self.__vehicleStickers = None
     self.onModelChanged = None
     if self.__crashedTracksCtrl is not None:
         self.__crashedTracksCtrl.destroy()
         self.__crashedTracksCtrl = None
     self.__chassisOcclusionDecal.destroy()
     self.__chassisOcclusionDecal = None
     self.__chassisShadowForwardDecal.destroy()
     self.__chassisShadowForwardDecal = None
     self.__compoundModel = None
     CallbackDelayer.destroy(self)
     return
コード例 #7
0
ファイル: videocamera.py プロジェクト: webiumsk/WOT-0.9.12
 def __init__(self, configDataSec):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self, time.clock)
     self.__cam = BigWorld.FreeCamera()
     self.__cam.invViewProvider = Math.MatrixProduct()
     self.__ypr = Math.Vector3()
     self.__position = Math.Vector3()
     self.__defaultFov = BigWorld.projection().fov
     self.__velocity = Math.Vector3()
     self.__isVerticalVelocitySeparated = False
     self.__yprVelocity = Math.Vector3()
     self.__zoomVelocity = 0.0
     self.__inertiaEnabled = False
     self.__movementInertia = None
     self.__rotationInertia = None
     self.__movementSensor = None
     self.__verticalMovementSensor = None
     self.__rotationSensor = None
     self.__zoomSensor = None
     self.__targetRadiusSensor = None
     self.__mouseSensitivity = 0.0
     self.__scrollSensitivity = 0.0
     self.__rotateAroundPointEnabled = False
     self.__rotationRadius = 40.0
     self.__alignerToLand = _AlignerToLand()
     self.__predefinedVelocities = {}
     self.__predefinedVerticalVelocities = {}
     self.__keySwitches = {}
     self.__readCfg(configDataSec)
     self.__aim = None
     self.__basisMProv = _VehicleBounder()
     self.__entityPicker = _VehiclePicker()
     return
コード例 #8
0
    def __init__(self, equipmentID, wingControlPoints):
        CallbackDelayer.__init__(self)
        self.__withdrawn = False
        self.__bombers = []
        modelName, soundEvent = self.__readData(equipmentID)
        speed = self.__calculateSpeed(wingControlPoints[0],
                                      wingControlPoints[1])
        flatVectors = map(
            self.__calculateDirAndNorm,
            (wingControlPoints[0].direction, wingControlPoints[1].direction))
        times = map(self.__convertTime,
                    (wingControlPoints[0].time, wingControlPoints[1].time))
        for offset in self.__offsets:
            points = []
            for i in xrange(2):
                point = wingControlPoints[i]
                realOffset = self.__calculateOffset(offset, flatVectors[i])
                points.append(
                    CurveControlPoint(point.position + realOffset,
                                      speed * point.direction, times[i]))

            bomberDesc = BomberDesc(modelName, soundEvent, points[0],
                                    points[1], None)
            self.__bombers.append(Bomber(bomberDesc))

        return
コード例 #9
0
 def onEnterWorld(self, prereqs):
     LOG_DEBUG('onEnterWorld', self.__vehDescr.name, self.spaceID)
     self.model = prereqs[self.__vehDescr.name]
     self.model.matrix = self.matrix
     self.collisions = prereqs['collisionAssembler']
     self.__detachConfirmationTimer.onEnterWorld()
     self.__vehDescr.keepPrereqs(prereqs)
     turretDescr = self.__vehDescr.turret
     if self.isUnderWater == 0:
         self.__detachmentEffects = _TurretDetachmentEffects(
             self.model, turretDescr.turretDetachmentEffects,
             self.isCollidingWithWorld == 1)
         self.addComponent(self.__detachmentEffects)
     else:
         self.__detachmentEffects = None
     self.__hitEffects = _HitEffects(self.model)
     self.addComponent(self.__hitEffects)
     self.__componentsDesc = (self.__vehDescr.turret, self.__vehDescr.gun)
     from helpers.CallbackDelayer import CallbackDelayer
     self.__isBeingPulledCallback = CallbackDelayer()
     self.__isBeingPulledCallback.delayCallback(self.__checkIsBeingPulled(),
                                                self.__checkIsBeingPulled)
     DetachedTurret.allTurrets.append(self)
     collisionData = ((TankPartNames.getIdx(TankPartNames.TURRET),
                       self.model.matrix),
                      (TankPartNames.getIdx(TankPartNames.GUN),
                       self.model.node(TankPartNames.GUN)))
     self.collisions.connect(self.id, ColliderTypes.DYNAMIC_COLLIDER,
                             collisionData)
     ScriptGameObject.activate(self)
     return
コード例 #10
0
 def destroy(self):
     CallbackDelayer.destroy(self)
     if self.__cloud is not None:
         self.__cloud.destroy()
     self.__evtManager.clear()
     self.__state = GasAttackState.DONE
     return
コード例 #11
0
 def destroy(self):
     _SPGFlashGunMarker.destroy(self)
     CallbackDelayer.destroy(self)
     self.__desiredShotInfoFunc = None
     self.__trajectoryDrawer.visible = False
     self.__trajectoryDrawer = None
     return
コード例 #12
0
ファイル: snipercamera.py プロジェクト: webiumsk/WOT-0.9.15.1
 def __init__(self, dataSec, defaultOffset = None, binoculars = None):
     CallbackDelayer.__init__(self)
     self.__impulseOscillator = None
     self.__movementOscillator = None
     self.__noiseOscillator = None
     self.__dynamicCfg = CameraDynamicConfig()
     self.__accelerationSmoother = None
     self.__readCfg(dataSec)
     if binoculars is None:
         return
     else:
         self.__cam = BigWorld.FreeCamera()
         self.__zoom = self.__cfg['zoom']
         self.__curSense = 0
         self.__curScrollSense = 0
         self.__waitVehicleCallbackId = None
         self.__onChangeControlMode = None
         self.__aimingSystem = SniperAimingSystem(dataSec)
         self.__binoculars = binoculars
         self.__defaultAimOffset = defaultOffset or Vector2()
         self.__crosshairMatrix = createCrosshairMatrix(offsetFromNearPlane=self.__dynamicCfg['aimMarkerDistance'])
         self.__prevTime = BigWorld.time()
         self.__autoUpdateDxDyDz = Vector3(0, 0, 0)
         if BattleReplay.g_replayCtrl.isPlaying:
             BattleReplay.g_replayCtrl.setDataCallback('applyZoom', self.__applyZoom)
         return
コード例 #13
0
 def __init__(self, updatePeriod = 0.0):
     CallbackDelayer.__init__(self)
     self.__updatePeriod = updatePeriod
     self.__currentSpeedState = self.__SPEED_IDLE
     self.__keyOffCalled = False
     self.__manualSound = None
     self.__gearSound = None
     self.__gearDamagedParam = None
     self.__manGearDamagedParam = None
     self.__gearKeyOffParam = None
     self.__stateTable = ((None,
       self.__startManualSound,
       self.__initHighSpeed,
       None),
      (self.__stopManualSound,
       None,
       self.__initHighSpeed,
       None),
      (self.__stopManualSound,
       self.__startManualSoundFromFast,
       None,
       None),
      (self.__stopGearSoundPlaying,
       self.__startManualSoundFromFast,
       None,
       self.__checkGearSound))
     self.__init_sound()
     return
コード例 #14
0
 def destroy(self):
     CallbackDelayer.destroy(self)
     if self.__manualSound is not None:
         self.__manualSound.stopAll()
         self.__manualSound = None
     self.__stateTable = None
     return
コード例 #15
0
ファイル: artyhitmarker.py プロジェクト: webiumsk/WOT0.10.0
 def destroy(self):
     _SPGFlashGunMarker.destroy(self)
     CallbackDelayer.destroy(self)
     self.__desiredShotInfoFunc = None
     self.__trajectoryDrawer.visible = False
     self.__trajectoryDrawer = None
     return
コード例 #16
0
 def __init__(self, updatePeriod = 0.0):
     CallbackDelayer.__init__(self)
     self.__updatePeriod = updatePeriod
     self.__currentSpeedState = self.__SPEED_IDLE
     self.__keyOffCalled = False
     self.__manualSound = None
     self.__gearSound = None
     self.__gearDamagedParam = None
     self.__manGearDamagedParam = None
     self.__gearKeyOffParam = None
     self.__stateTable = ((None,
       self.__startManualSound,
       self.__initHighSpeed,
       None),
      (self.__stopManualSound,
       None,
       self.__initHighSpeed,
       None),
      (self.__stopManualSound,
       self.__startManualSoundFromFast,
       None,
       None),
      (self.__stopGearSoundPlaying,
       self.__startManualSoundFromFast,
       None,
       self.__checkGearSound))
     self.__init_sound()
     return
コード例 #17
0
 def __init__(self):
     CallbackDelayer.__init__(self)
     ComponentSystem.__init__(self)
     self.turretMatrix = Math.WGAdaptiveMatrixProvider()
     self.gunMatrix = Math.WGAdaptiveMatrixProvider()
     self.__vehicle = None
     self.__filter = None
     self.__originalFilter = None
     self.__typeDesc = None
     self.__waterHeight = -1.0
     self.__isInWater = False
     self.__isUnderWater = False
     self.__splashedWater = False
     self.__vibrationsCtrl = None
     self.__lightFxCtrl = None
     self.__auxiliaryFxCtrl = None
     self.__fashion = None
     self.__crashedTracksCtrl = None
     self.__gunRecoil = None
     self.__currentDamageState = VehicleDamageState()
     self.__loadingProgress = 0
     self.__effectsPlayer = None
     self.__engineMode = (0, 0)
     self.__swingMoveFlags = 0
     self.__currTerrainMatKind = [-1] * _MATKIND_COUNT
     self.__leftLightRotMat = None
     self.__rightLightRotMat = None
     self.__leftFrontLight = None
     self.__rightFrontLight = None
     self.__prevVelocity = None
     self.__prevTime = None
     self.__isPillbox = False
     self.__chassisOcclusionDecal = OcclusionDecal()
     self.__chassisShadowForwardDecal = ShadowForwardDecal()
     self.__splodge = None
     self.__vehicleStickers = None
     self.onModelChanged = Event()
     self.__speedInfo = Math.Vector4(0.0, 0.0, 0.0, 0.0)
     self.__wasOnSoftTerrain = False
     self.__vehicleMatrixProv = None
     self.__leftTrackScroll = 0.0
     self.__rightTrackScroll = 0.0
     self.__distanceFromPlayer = 0.0
     self.__fashions = None
     self.__compoundModel = None
     self.__boundEffects = None
     self.__swingingAnimator = None
     self.__splineTracks = None
     self.__customEffectManager = None
     self.__trackScrollCtl = BigWorld.PyTrackScroll()
     self.__weaponEnergy = 0.0
     self.__activated = False
     self.__systemStarted = False
     self.__vID = 0
     self.__isAlive = True
     self.__isTurretDetached = False
     self.__trackFashionSet = False
     self.__periodicTimerID = None
     self.__wasDeactivated = False
     return
コード例 #18
0
    def stop(self):
        self.__isStarted = False
        import SoundGroups
        SoundGroups.g_instance.changePlayMode(0)
        aih_global_binding.clear()
        for control in self.__ctrls.itervalues():
            control.destroy()

        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isRecording:
            replayCtrl.setPlayerVehicleID(0)
        if self.__remoteCameraSender is not None:
            self.__remoteCameraSender.destroy()
            self.__remoteCameraSender = None
        self.onCameraChanged.clear()
        self.onCameraChanged = None
        self.onPostmortemVehicleChanged.clear()
        self.onPostmortemVehicleChanged = None
        self.onPostmortemKillerVisionEnter.clear()
        self.onPostmortemKillerVisionEnter = None
        self.onPostmortemKillerVisionExit.clear()
        self.onPostmortemKillerVisionExit = None
        self.__targeting.enable(False)
        self.__killerVehicleID = None
        if self.__onRecreateDevice in g_guiResetters:
            g_guiResetters.remove(self.__onRecreateDevice)
        BigWorld.player().arena.onPeriodChange -= self.__onArenaStarted
        self.settingsCore.onSettingsChanged -= self.__onSettingsChanged
        BigWorld.player().consistentMatrices.onVehicleMatrixBindingChanged -= self.__onVehicleChanged
        ComponentSystem.destroy(self)
        CallbackDelayer.destroy(self)
        return
コード例 #19
0
 def destroy(self):
     CallbackDelayer.destroy(self)
     if self.__manualSound is not None:
         self.__manualSound.stopAll()
         self.__manualSound = None
     self.__stateTable = None
     return
コード例 #20
0
class BerserkerSoundPlayer(_VehicleStateSoundPlayer):
    def __init__(self):
        self.__effectIsWorking = False
        self.__endTime = 0
        self.__delayer = None
        return

    def _onVehicleStateUpdated(self, state, value):
        if state == VEHICLE_VIEW_STATE.DOT_EFFECT:
            if value is not None:
                if value.attackReasonID == ATTACK_REASONS.index(
                        ATTACK_REASON.BERSERKER):
                    self.__effectIsWorking = True
                    self.__endTime = value.endTime
                    BREvents.playSound(BREvents.BERSERKER_ACTIVATION)
                    self.__delayer = CallbackDelayer()
                    self.__delayer.delayCallback(value.period,
                                                 self.__updateShowDotEffect,
                                                 value.period)
            elif self.__effectIsWorking and BigWorld.serverTime(
            ) >= self.__endTime:
                self.__effectIsWorking = False
                self.__endTime = 0
                BREvents.playSound(BREvents.BERSERKER_DEACTIVATION)
                self.__delayer.stopCallback(self.__updateShowDotEffect)
                self.__delayer = None
        return

    def __updateShowDotEffect(self, period):
        BREvents.playSound(BREvents.BERSERKER_PULSE_RED)
        return period
コード例 #21
0
 def __init__(self, gunMakerType, dataProvider, artyEquipmentUDO, areaRadius, interval=0.1):
     super(_ArtyHitMarkerController, self).__init__(gunMakerType, dataProvider, enabledFlag=_MARKER_FLAG.ARTY_HIT_ENABLED)
     self.__artyEquipmentUDO = artyEquipmentUDO
     self.__areaRadius = areaRadius
     self.__interval = interval
     self.__delayer = CallbackDelayer()
     self.__trajectoryDrawer = BigWorld.wg_trajectory_drawer()
コード例 #22
0
 def __init__(self, effectDesc):
     CallbackDelayer.__init__(self)
     self._desc = effectDesc
     self._sound = None
     self._almostCompleteSnd = None
     self._startLoopT = 0.0
     return
コード例 #23
0
ファイル: snipercamera.py プロジェクト: webiumsk/WOT0.10.0
 def __init__(self, dataSec, aim, binoculars):
     CallbackDelayer.__init__(self)
     self.__impulseOscillator = None
     self.__movementOscillator = None
     self.__noiseOscillator = None
     self.__dynamicCfg = CameraDynamicConfig()
     self.__accelerationSmoother = None
     self.__readCfg(dataSec)
     if aim is None or binoculars is None:
         return
     else:
         self.__cam = BigWorld.FreeCamera()
         self.__zoom = self.__cfg['zoom']
         self.__curSense = 0
         self.__curScrollSense = 0
         self.__waitVehicleCallbackId = None
         self.__onChangeControlMode = None
         self.__aimingSystem = SniperAimingSystem(dataSec)
         self.__aim = weakref.proxy(aim)
         self.__binoculars = binoculars
         self.__defaultAimOffset = self.__aim.offset()
         self.__defaultAimOffset = (self.__defaultAimOffset[0], self.__defaultAimOffset[1])
         self.__crosshairMatrix = createCrosshairMatrix(offsetFromNearPlane=self.__dynamicCfg['aimMarkerDistance'])
         self.__prevTime = BigWorld.time()
         self.__autoUpdateDxDyDz = Vector3(0, 0, 0)
         return
コード例 #24
0
 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
コード例 #25
0
 def __init__(self, dataSec, aim):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     self.__shiftKeySensor = None
     self.__movementOscillator = None
     self.__impulseOscillator = None
     self.__noiseOscillator = None
     self.__dynamicCfg = CameraDynamicConfig()
     self.__accelerationSmoother = None
     self.__readCfg(dataSec)
     self.__cam = None
     self.__aim = None
     self.__onChangeControlMode = None
     self.__aimingSystem = None
     self.__curSense = 0
     self.__curScrollSense = 0
     self.__postmortemMode = False
     self.__vehiclesToCollideWith = set()
     self.__focalPointDist = 1.0
     self.__autoUpdateDxDyDz = Vector3(0.0)
     self.__defaultAimOffset = (0.0, 0.0)
     if aim is None:
         return
     else:
         self.__aim = weakref.proxy(aim)
         self.__cam = BigWorld.HomingCamera()
         aimOffset = self.__aim.offset()
         self.__cam.aimPointClipCoords = Vector2(aimOffset)
         self.__defaultAimOffset = (aimOffset[0], aimOffset[1])
         return
コード例 #26
0
 def __init__(self, dataSec, defaultOffset=None, binoculars=None):
     CallbackDelayer.__init__(self)
     self.__impulseOscillator = None
     self.__movementOscillator = None
     self.__noiseOscillator = None
     self.__dynamicCfg = CameraDynamicConfig()
     self.__accelerationSmoother = None
     self.__readCfg(dataSec)
     if binoculars is None:
         return
     else:
         self.__cam = BigWorld.FreeCamera()
         self.__zoom = self.__cfg['zoom']
         self.__curSense = 0
         self.__curScrollSense = 0
         self.__waitVehicleCallbackId = None
         self.__onChangeControlMode = None
         self.__aimingSystem = None
         self.__binoculars = binoculars
         self.__defaultAimOffset = defaultOffset or Vector2()
         self.__crosshairMatrix = createCrosshairMatrix(
             offsetFromNearPlane=self.__dynamicCfg['aimMarkerDistance'])
         self.__prevTime = BigWorld.time()
         self.__autoUpdateDxDyDz = Vector3(0, 0, 0)
         if BattleReplay.g_replayCtrl.isPlaying:
             BattleReplay.g_replayCtrl.setDataCallback(
                 'applyZoom', self.__applySerializedZoom)
         return
コード例 #27
0
ファイル: arcadecamera.py プロジェクト: webiumsk/WOT-0.9.15.1
 def __init__(self, dataSec, defaultOffset = None):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     self.__shiftKeySensor = None
     self.__movementOscillator = None
     self.__impulseOscillator = None
     self.__noiseOscillator = None
     self.__dynamicCfg = CameraDynamicConfig()
     self.__accelerationSmoother = None
     self.__readCfg(dataSec)
     self.__onChangeControlMode = None
     self.__aimingSystem = None
     self.__curSense = 0
     self.__curScrollSense = 0
     self.__postmortemMode = False
     self.__vehiclesToCollideWith = set()
     self.__focalPointDist = 1.0
     self.__autoUpdateDxDyDz = Vector3(0.0)
     self.__updatedByKeyboard = False
     if defaultOffset is not None:
         self.__defaultAimOffset = defaultOffset
         self.__cam = BigWorld.HomingCamera()
         self.__cam.aimPointClipCoords = defaultOffset
     else:
         self.__defaultAimOffset = Vector2()
         self.__cam = None
     return
コード例 #28
0
 def __init__(self, deliveryPoint, dropAltitude, dropTime):
     CallbackDelayer.__init__(self)
     angle = random.random() * 2 * math.pi
     self.__flightYaw = angle
     rotationMatrix = math_utils.createRotationMatrix((angle, 0, 0))
     dropPoint = deliveryPoint + Math.Vector3(0, dropAltitude, 0)
     beginPosition = dropPoint - rotationMatrix.applyVector(
         self.ARRIVAL_TRAJECTORY_INCLINATION)
     flatFlyVelocity = rotationMatrix.applyToAxis(2) * self.FLIGHT_SPEED
     beginPointDesc = CurveControlPoint(
         beginPosition, flatFlyVelocity,
         dropTime - self.FLY_TIME_BEFORE_DROP)
     dropPointDesc = CurveControlPoint(dropPoint, flatFlyVelocity, dropTime)
     dropPlaneConfig = self.__dynamicObjectsCache.getConfig(
         self.__sessionProvider.arenaVisitor.getArenaGuiType(
         )).getDropPlane()
     spaceId = BigWorld.player().spaceID
     compoundName = 'dropPlaneModel'
     modelAssembler = BigWorld.CompoundAssembler(compoundName, spaceId)
     modelAssembler.addRootPart(dropPlaneConfig.model, 'root')
     animationBuilder = AnimationSequence.Loader(
         dropPlaneConfig.flyAnimation, spaceId)
     planeDesc = BomberDesc(modelAssembler, dropPlaneConfig.sound,
                            beginPointDesc, dropPointDesc, animationBuilder)
     self.dropPlane = CompoundBomber(planeDesc)
     endPosition = dropPoint + rotationMatrix.applyVector(
         self.DEPARTURE_TRAJECTORY_INCLINATION)
     self.dropPlane.addControlPoint(endPosition, flatFlyVelocity,
                                    dropTime + self.FLY_TIME_AFTER_DROP)
     delayTime = dropTime - BigWorld.time() - self.FLY_TIME_BEFORE_DROP
     self.delayCallback(delayTime, self.__openCargo)
     self.delayCallback(delayTime + self.UNLOAD_ANIMATION_TIME,
                        self.__closeCargo)
     self.prevTime = BigWorld.time()
コード例 #29
0
 def __init__(self, yaw, dropPoint, landingPosition, descendTime):
     ScriptGameObject.__init__(self, BigWorld.player().spaceID)
     CallbackDelayer.__init__(self)
     self.descendSimulator = DescendSimulator(yaw, dropPoint,
                                              landingPosition, descendTime)
     self.__descendTime = descendTime
     self.__dropPoint = dropPoint
コード例 #30
0
 def destroy(self):
     CallbackDelayer.destroy(self)
     if self.__soundObject is not None:
         self.__soundObject.stopAll()
         self.__soundObject = None
     self.__stateTable = None
     return
コード例 #31
0
ファイル: mapcasemode.py プロジェクト: webiumsk/WOT0.10.0
 def destroy(self):
     CallbackDelayer.destroy(self)
     self.disable()
     self.__activeSelector = None
     self.__cam.destroy()
     self.__aih = None
     return
コード例 #32
0
    def onEnterWorld(self, prereqs):
        self.model = prereqs[self.__vehDescr.name]
        self.model.matrix = self.matrix
        self.__detachConfirmationTimer.onEnterWorld()
        self.__vehDescr.keepPrereqs(prereqs)
        turretDescr = self.__vehDescr.turret
        if self.isUnderWater == 0:
            self.__detachmentEffects = _TurretDetachmentEffects(
                self.model, turretDescr.turretDetachmentEffects,
                self.isCollidingWithWorld == 1)
            self.addComponent(self.__detachmentEffects)
        else:
            self.__detachmentEffects = None
        self.__hitEffects = _HitEffects(self.model)
        self.addComponent(self.__hitEffects)
        self.__componentsDesc = (self.__vehDescr.turret, self.__vehDescr.gun)
        for desc in self.__componentsDesc:
            desc.hitTester.loadBspModel()

        from helpers.CallbackDelayer import CallbackDelayer
        self.__isBeingPulledCallback = CallbackDelayer()
        self.__isBeingPulledCallback.delayCallback(self.__checkIsBeingPulled(),
                                                   self.__checkIsBeingPulled)
        DetachedTurret.allTurrets.append(self)
        ProjectileAwareEntities.addEntity(self)
        BigWorld.callback(0.0, self.__createAndAttachStickers)
        return
コード例 #33
0
 def __init__(self):
     ClientSelectableObject.__init__(self)
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     self.__state = CameraMovementStates.FROM_OBJECT
     self.__camera = cameras.FreeCamera()
     self.cameraPitch = mathUtils.clamp(-math.pi / 2 * 0.99,
                                        math.pi / 2 * 0.99,
                                        self.cameraPitch)
     self.cameraYaw = normalizeAngle(self.cameraYaw)
     self.__goalPosition = Math.Vector3(0.0, 0.0, 0.0)
     self.__goalDistance = None
     self.__goalTarget = Math.Vector3(0.0, 0.0, 0.0)
     self.__startPosition = Math.Vector3(0.0, 0.0, 0.0)
     self.__startYaw = 0.0
     self.__startPitch = 0.0
     self.__curTime = None
     self.__easedInYaw = 0.0
     self.__easedInPitch = 0.0
     self.__easeInDuration = 0.0
     self.__startFov = None
     self.__goalFov = None
     if self.enableYawLimits:
         self.__yawLimits = Math.Vector2(self.yawLimitMin, self.yawLimitMax)
     else:
         self.__yawLimits = None
     self.__pitchLimits = Math.Vector2(math.degrees(self.pitchLimitMin),
                                       math.degrees(self.pitchLimitMax))
     self.__p1 = Math.Vector3(0.0, 0.0, 0.0)
     self.__p2 = Math.Vector3(0.0, 0.0, 0.0)
     self.__wasPreviousUpdateSkipped = False
     return
コード例 #34
0
 def __init__(self):
     CallbackDelayer.__init__(self)
     self.__alwaysShowAimKey = None
     self.__showMarkersKey = None
     sec = self._readCfg()
     self.onCameraChanged = Event()
     self.onPostmortemVehicleChanged = Event()
     self.onSetReloading = Event()
     self.onSetReloadingPercents = Event()
     self.__isArenaStarted = False
     self.__isStarted = False
     self.__targeting = _Targeting()
     self.__vertScreenshotCamera = _VertScreenshotCamera()
     self.__ctrls = dict()
     self.__killerVehicleID = None
     self.__isAutorotation = True
     self.__prevModeAutorotation = None
     self.__isSPG = False
     self.__isATSPG = False
     self.__setupCtrls(sec)
     self.__curCtrl = self.__ctrls[_CTRLS_FIRST]
     self.ctrlModeName = _CTRLS_FIRST
     self.__isDetached = False
     self.__waitObserverCallback = None
     self.__observerVehicle = None
     return
コード例 #35
0
 def __init__(self):
     EpicMissionsPanelMeta.__init__(self)
     CallbackDelayer.__init__(self)
     self.__nearestHQ = None
     self.__timeCB = None
     self.__currentEndTime = 0
     return
コード例 #36
0
 def __init__(self, configDataSec):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self, time.clock)
     self._cam = BigWorld.FreeCamera()
     self._cam.invViewProvider = Math.MatrixProduct()
     self.__cameraTransition = BigWorld.TransitionCamera()
     self.__ypr = Math.Vector3()
     self.__position = Math.Vector3()
     self.__defaultFov = BigWorld.projection().fov
     self.__velocity = Math.Vector3()
     self.__isVerticalVelocitySeparated = False
     self.__yprVelocity = Math.Vector3()
     self.__zoomVelocity = 0.0
     self._inertiaEnabled = False
     self._movementInertia = None
     self._rotationInertia = None
     self._movementSensor = None
     self._verticalMovementSensor = None
     self._rotationSensor = None
     self._zoomSensor = None
     self._targetRadiusSensor = None
     self._mouseSensitivity = 0.0
     self._scrollSensitivity = 0.0
     self.__rotateAroundPointEnabled = False
     self.__rotationRadius = 40.0
     self._alignerToLand = _AlignerToLand()
     self.__predefinedVelocities = {}
     self.__predefinedVerticalVelocities = {}
     self._keySwitches = {}
     self._readCfg(configDataSec)
     self.__isModeOverride = False
     self.__basisMProv = _VehicleBounder()
     self.__entityPicker = _VehiclePicker()
     return
コード例 #37
0
 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
コード例 #38
0
 def __init__(self, defLocalDirPath='notifications'):
     self.__callbackMethod = None
     self.__imageUrl = ''
     self.__callbackDelayer = CallbackDelayer()
     self.__webCache = None
     self.__defLocalDirPath = defLocalDirPath
     return
コード例 #39
0
ファイル: arcadecamera.py プロジェクト: webiumsk/WOT-0.9.15.1
 def __init__(self, dataSec, defaultOffset=None):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     self.__shiftKeySensor = None
     self.__movementOscillator = None
     self.__impulseOscillator = None
     self.__noiseOscillator = None
     self.__dynamicCfg = CameraDynamicConfig()
     self.__accelerationSmoother = None
     self.__readCfg(dataSec)
     self.__onChangeControlMode = None
     self.__aimingSystem = None
     self.__curSense = 0
     self.__curScrollSense = 0
     self.__postmortemMode = False
     self.__vehiclesToCollideWith = set()
     self.__focalPointDist = 1.0
     self.__autoUpdateDxDyDz = Vector3(0.0)
     self.__updatedByKeyboard = False
     if defaultOffset is not None:
         self.__defaultAimOffset = defaultOffset
         self.__cam = BigWorld.HomingCamera()
         self.__cam.aimPointClipCoords = defaultOffset
     else:
         self.__defaultAimOffset = Vector2()
         self.__cam = None
     return
コード例 #40
0
 def __init__(self, position, equipment):
     CallbackDelayer.__init__(self)
     self.equipment = equipment
     self.aimLimits = None
     if isinstance(equipment, ArcadeEquipmentConfigReader):
         self.aimLimits = (equipment.minApplyRadius, equipment.maxApplyRadius)
     self.delayCallback(self._TICK_DELAY, self.__tick)
     return
コード例 #41
0
 def destroy(self):
     self.hangarSpace.onSpaceCreate -= self.__onSpaceCreated
     self.hangarSpace.onSpaceDestroy -= self.__onSpaceDestroy
     self.__camera = None
     self.__isInIdle = None
     self.stopCallback(self.__update)
     CallbackDelayer.destroy(self)
     return
コード例 #42
0
 def __init__(self, componentSystem):
     ClientArenaComponent.__init__(self, componentSystem)
     CallbackDelayer.__init__(self)
     self.__smokeScreen = dict()
     self.__healingEffect = None
     self.__inspiringEffect = None
     self.__repairPointEffect = None
     return
コード例 #43
0
 def destroy(self):
     CallbackDelayer.destroy(self)
     self.disable()
     self.__onChangeControlMode = None
     self.__cam = None
     if self.__aimingSystem is not None:
         self.__aimingSystem.destroy()
         self.__aimingSystem = None
     return
コード例 #44
0
ファイル: snipercamera.py プロジェクト: webiumsk/WOT-0.9.15.1
 def destroy(self):
     g_settingsCore.onSettingsChanged -= self.__onSettingsChanged
     self.disable()
     self.__onChangeControlMode = None
     self.__cam = None
     if self.__aimingSystem is not None:
         self.__aimingSystem.destroy()
         self.__aimingSystem = None
     CallbackDelayer.destroy(self)
     return
コード例 #45
0
 def __init__(self, updatePeriod = 0.1):
     CallbackDelayer.__init__(self)
     self.__updatePeriod = updatePeriod
     self.__currentSpeedState = self.__SPEED_IDLE
     self.__manualSound = None
     self.__gearDamagedParam = None
     self.__oldPitch = 0
     self.__oldTime = 0
     self.__init_sound()
     return
コード例 #46
0
 def enable(self, enableSound):
     if enableSound:
         self.delayCallback(self.__updatePeriod, self.__update)
     else:
         CallbackDelayer.destroy(self)
         if self.__manualSound is not None:
             self.__manualSound.stop()
         if self.__gearSound is not None:
             self.__gearSound.stop()
     return
コード例 #47
0
ファイル: snipercamera.py プロジェクト: webiumsk/WOT0.10.0
 def destroy(self):
     self.disable()
     self.__onChangeControlMode = None
     self.__cam = None
     self._writeUserPreferences()
     self.__aimingSystem.destroy()
     self.__aimingSystem = None
     self.__aim = None
     CallbackDelayer.destroy(self)
     return
コード例 #48
0
 def __init__(self, beginExplosionPos, endExplosionPos, areaWidth, velocity):
     CallbackDelayer.__init__(self)
     self.model = BigWorld.Model("helpers/models/unit_cube.model")
     BigWorld.addModel(self.model)
     self.model.position = beginExplosionPos
     linearHomer = BigWorld.LinearHomer()
     self.model.addMotor(linearHomer)
     linearHomer.align = mathUtils.createSRTMatrix((areaWidth, 5, 1), (0.0, 0, 0), Vector3(0, 0, 0))
     linearHomer.acceleration = 0
     linearHomer.velocity = velocity
     linearHomer.target = mathUtils.createTranslationMatrix(endExplosionPos)
     linearHomer.proximityCallback = self.__onDeath
コード例 #49
0
ファイル: flockexotic.py プロジェクト: webiumsk/WOT-0.9.15-CT
 def __init__(self):
     BigWorld.Entity.__init__(self)
     FlockLike.__init__(self)
     CallbackDelayer.__init__(self)
     self.flightAngleMin = math.radians(self.flightAngleMin)
     self.flightAngleMax = math.radians(self.flightAngleMax)
     if self.flightAngleMin < 0:
         self.flightAngleMin += math.ceil(abs(self.flightAngleMin) / (math.pi * 2)) * math.pi * 2
     elif self.flightAngleMin > math.pi * 2:
         self.flightAngleMin -= math.floor(self.flightAngleMin / (math.pi * 2)) * math.pi * 2
     self.__isTriggered = False
     self.__models = []
コード例 #50
0
 def __init__(self, dataSection, avatarInputHandler):
     CallbackDelayer.__init__(self)
     self.__preferredPos = Vector3(0, 0, 0)
     self.__aih = weakref.proxy(avatarInputHandler)
     self.__cam = StrategicCamera.StrategicCamera(dataSection['camera'])
     self.__isEnabled = False
     self.__updateInterval = 0.1
     self.__activeSelector = _DefaultStrikeSelector(Vector3(0, 0, 0), None)
     self.__equipmentID = None
     self.__aimingMode = 0
     MapCaseControlMode.prevCtlMode = [Vector3(0, 0, 0), '', 0]
     return
コード例 #51
0
 def __init__(self):
     if not constants.IS_DEVELOPMENT:
         return
     CallbackDelayer.__init__(self)
     self.__items = {}
     self.__avgInfo = {}
     self.__textGui = GUI.Text()
     GUI.addRoot(self.__textGui)
     self.__textGui.position = (0, -0.25, 0)
     self.__textGui.multiline = True
     self.clear()
     self.__tickNames = {}
コード例 #52
0
    def onEnterWorld(self, prereqs):
        self.model = prereqs[self.__vehDescr.turret['models']['exploded']]
        self.model.addMotor(BigWorld.Servo(self.matrix))
        self.__gunModel = prereqs[self.__vehDescr.gun['models']['exploded']]
        node = self.model.node(TankNodeNames.GUN_JOINT, Math.Matrix())
        node.attach(self.__gunModel)
        self.__detachConfirmationTimer.onEnterWorld()
        self.__vehDescr.keepPrereqs(prereqs)
        turretDescr = self.__vehDescr.turret
        if self.isUnderWater == 0:
            self.__detachmentEffects = _TurretDetachmentEffects(self.model, turretDescr['turretDetachmentEffects'], self.isCollidingWithWorld == 1)
            self.__reactors.append(self.__detachmentEffects)
        else:
            self.__detachmentEffects = None
        self.__hitEffects[TankPartNames.TURRET] = turretHitEffects = _HitEffects(self.model)
        self.__hitEffects[TankPartNames.GUN] = gunHitEffects = _HitEffects(self.__gunModel)
        self.__reactors.append(turretHitEffects)
        self.__reactors.append(gunHitEffects)
        self.__componentsDesc = (self.__vehDescr.turret, self.__vehDescr.gun)
        for desc in self.__componentsDesc:
            desc['hitTester'].loadBspModel()

        from helpers.CallbackDelayer import CallbackDelayer
        self.__isBeingPulledCallback = CallbackDelayer()
        self.__isBeingPulledCallback.delayCallback(self.__checkIsBeingPulled(), self.__checkIsBeingPulled)
        DetachedTurret.allTurrets.append(self)
        return
コード例 #53
0
 def __init__(self):
     self.__callbackDelayer = CallbackDelayer()
     self.__selectedAreas = {}
     self.__wings = {}
     if _ENABLE_DEBUG_DRAW:
         self.debugPolyLine = Flock.DebugPolyLine()
         self.debugPoints = []
         self.debugDirs = []
コード例 #54
0
ファイル: bomberswing.py プロジェクト: webiumsk/WOT-0.9.15.1
    def __init__(self, equipmentID, wingControlPoints):
        CallbackDelayer.__init__(self)
        self.__withdrawn = False
        self.__bombers = []
        modelName, soundEvent = self.__readData(equipmentID)
        speed = self.__calculateSpeed(wingControlPoints[0], wingControlPoints[1])
        flatVectors = map(self.__calculateDirAndNorm, (wingControlPoints[0].direction, wingControlPoints[1].direction))
        times = map(self.__convertTime, (wingControlPoints[0].time, wingControlPoints[1].time))
        for offset in self.__offsets:
            points = []
            for i in xrange(2):
                point = wingControlPoints[i]
                realOffset = self.__calculateOffset(offset, flatVectors[i])
                points.append(CurveControlPoint(point.position + realOffset, speed * point.direction, times[i]))

            bomberDesc = BomberDesc(modelName, soundEvent, points[0], points[1])
            self.__bombers.append(Bomber(bomberDesc))
コード例 #55
0
ファイル: __init__.py プロジェクト: webiumsk/WOT0.10.0
    def stop(self):
        self.__isStarted = False
        import SoundGroups
        SoundGroups.g_instance.changePlayMode(1)
        self.__removeBattleCtrlListeners()
        for control in self.__ctrls.itervalues():
            control.destroy()

        replayCtrl = BattleReplay.g_replayCtrl
        if replayCtrl.isRecording:
            replayCtrl.setPlayerVehicleID(0)
        self.onCameraChanged = None
        self.__targeting.enable(False)
        self.__killerVehicleID = None
        g_guiResetters.remove(self.__onRecreateDevice)
        BigWorld.player().arena.onPeriodChange -= self.__onArenaStarted
        from account_helpers.settings_core.SettingsCore import g_settingsCore
        g_settingsCore.onSettingsChanged -= self.__onSettingsChanged
        CallbackDelayer.destroy(self)
        return
コード例 #56
0
 def __init__(self, physicsMode, isPlayerVehicle, modelsDesc, typeDesc, vehicleId):
     CallbackDelayer.__init__(self)
     self.__prevVelocity = 0
     self.__prevTime = 0.0
     self.__prevTerrSwitch = None
     self.__physicsMode = physicsMode
     self.__isPlayerVehicle = isPlayerVehicle
     self.__typeDesc = typeDesc
     self.__commonTrackScroll = 0.0
     self.__engineSound = None
     self.__movementSound = None
     self.__gunSound = None
     self.__modelsDesc = modelsDesc
     self.__vehicleId = vehicleId
     self.__event = None
     self.__eventC = None
     self.__cameraUnit = False
     self.__initSounds()
     BigWorld.player().inputHandler.onCameraChanged += self.__onCameraChanged
     return
コード例 #57
0
ファイル: gas_attack.py プロジェクト: webiumsk/WOT-0.9.15.1
 def __init__(self, mapSettings = None):
     if mapSettings is None:
         mapSettings = _getDefaultMapSettings()
     CallbackDelayer.__init__(self)
     self.__mapSettings = mapSettings
     self.__gasAttackSettings = None
     self.__state = GasAttackState.NO
     self.__startTime = 0
     self.__cloud = None
     if _ENABLE_DEBUG_LOG:
         self.__windupTime = 0
     self.__evtManager = Event.EventManager()
     self.onAttackPreparing = Event.Event(self.__evtManager)
     self.onAttackStarted = Event.Event(self.__evtManager)
     self.onAttackStopped = Event.Event(self.__evtManager)
     if not mapSettings.cloudModel:
         LOG_ERROR('Empty model name for cloud model')
     else:
         BigWorld.loadResourceListBG([mapSettings.cloudModel], self.__onCloudModelLoaded)
     self.__cloudModelResource = None
     return