Ejemplo n.º 1
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)
     if aim is None:
         return
     self.__aim = weakref.proxy(aim)
     self.__cam = BigWorld.HomingCamera()
     aimOffset = self.__aim.offset()
     self.__cam.aimPointClipCoords = Vector2(aimOffset)
     self.__curSense = 0
     self.__curScrollSense = 0
     self.__defaultAimOffset = (aimOffset[0], aimOffset[1])
     self.__postmortemMode = False
     self.__modelsToCollideWith = []
     self.__onChangeControlMode = None
     self.__aimingSystem = None
     self.__focalPointDist = 1.0
     self.__autoUpdateDxDyDz = Vector3(0.0)
Ejemplo n.º 2
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))
     return
Ejemplo n.º 3
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))
Ejemplo n.º 4
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
     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)
Ejemplo n.º 5
0
 def __init__(self, updatePeriod=0.0):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     self.__updatePeriod = updatePeriod
     self.__turretSound = None
     self.__prevTurretYaw = None
     return
Ejemplo n.º 6
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
Ejemplo n.º 7
0
 def __init__(self, configDataSec):
     CallbackDelayer.__init__(self)
     self.__cam = BigWorld.FreeCamera()
     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.__prevTime = 0.0
     self.__rotateAroundPointEnabled = False
     self.__rotationRadius = 40.0
     self.__boundVehicleMProv = None
     self.__alignerToLand = _AlignerToLand()
     self.__predefinedVelocities = {}
     self.__predefinedVerticalVelocities = {}
     self.__keySwitches = {}
     self.__readCfg(configDataSec)
     self.__aim = None
     return
Ejemplo n.º 8
0
 def __init__(self):
     CallbackDelayer.__init__(self)
     self.__alwaysShowAim = False
     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.__eMode = _CTRLS_FIRST
     self.__detachCount = 0
     return
Ejemplo n.º 9
0
 def __init__(self, updatePeriod=0.0):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     self.__updatePeriod = updatePeriod
     self.__turretSound = None
     self.__prevTurretYaw = None
     return
Ejemplo n.º 10
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)
     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.__curSense = 0
         self.__curScrollSense = 0
         self.__defaultAimOffset = (aimOffset[0], aimOffset[1])
         self.__postmortemMode = False
         self.__modelsToCollideWith = []
         self.__onChangeControlMode = None
         self.__aimingSystem = None
         self.__focalPointDist = 1.0
         self.__autoUpdateDxDyDz = Vector3(0.0)
         return
Ejemplo n.º 11
0
 def __init__(self, configDataSec):
     CallbackDelayer.__init__(self)
     TimeDeltaMeter.__init__(self)
     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
Ejemplo n.º 12
0
 def __init__(self, curShotInfoFunc, dispersionUpdateFunc,
              desiredShotInfoFunc):
     _SPGFlashGunMarker.__init__(self, curShotInfoFunc,
                                 dispersionUpdateFunc,
                                 _SuperGunMarker.GUN_MARKER_CLIENT)
     CallbackDelayer.__init__(self)
     self.__updateInterval = 0.0 if BattleReplay.g_replayCtrl.isPlaying else 0.1
     self.__desiredShotInfoFunc = desiredShotInfoFunc
     self.__trajectoryDrawer = BigWorld.wg_trajectory_drawer()
Ejemplo n.º 13
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"], None)
     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]
Ejemplo n.º 14
0
 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
Ejemplo n.º 15
0
 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
Ejemplo n.º 16
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 = {}
 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
Ejemplo n.º 18
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 = {}
Ejemplo n.º 19
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'],
                                                  None)
     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]
Ejemplo n.º 20
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
Ejemplo n.º 21
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])
            self.__bombers.append(Bomber(bomberDesc))
Ejemplo n.º 22
0
 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
Ejemplo n.º 23
0
 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
Ejemplo n.º 24
0
 def __init__(self):
     CallbackDelayer.__init__(self)
     self.__alwaysShowAim = False
     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.__eMode = _CTRLS_FIRST
     self.__detachCount = 0
Ejemplo n.º 25
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])
            self.__bombers.append(Bomber(bomberDesc))
Ejemplo n.º 26
0
 def __init__(self, position, equipment):
     CallbackDelayer.__init__(self)
     self.equipment = equipment
     self.delayCallback(self._TICK_DELAY, self.__tick)
Ejemplo n.º 27
0
 def __init__(self, curShotInfoFunc, dispersionUpdateFunc, desiredShotInfoFunc):
     _SPGFlashGunMarker.__init__(self, curShotInfoFunc, dispersionUpdateFunc, _SuperGunMarker.GUN_MARKER_CLIENT)
     CallbackDelayer.__init__(self)
     self.__updateInterval = 0.0 if BattleReplay.g_replayCtrl.isPlaying else 0.1
     self.__desiredShotInfoFunc = desiredShotInfoFunc
     self.__trajectoryDrawer = BigWorld.wg_trajectory_drawer()
Ejemplo n.º 28
0
 def __init__(self, avatar):
     CallbackDelayer.__init__(self)
     self.__avatar = weakref.proxy(avatar)
     self.__bFollowCamera = False
Ejemplo n.º 29
0
 def __init__(self, position, equipment):
     CallbackDelayer.__init__(self)
     self.equipment = equipment
     self.delayCallback(self._TICK_DELAY, self.__tick)
Ejemplo n.º 30
0
 def __init__(self, avatar):
     CallbackDelayer.__init__(self)
     self.__avatar = weakref.proxy(avatar)
     self.__bFollowCamera = False