def initControlMode(self, mode, available):
     super(BattleRoyalePersonalEntriesPlugin,
           self).initControlMode(mode, available)
     bottomLeft, upperRight = self._arenaVisitor.type.getBoundingBox()
     arenaWidth, _ = upperRight - bottomLeft
     if self._isInArcadeMode():
         matrix = matrix_factory.makeVehicleTurretMatrixMP()
         entryID = self._addEntry(BattleRoyaleEntries.VIEW_RANGE_SECTOR,
                                  _C_NAME.FLAGS,
                                  matrix=matrix,
                                  active=True)
         self.__viewRangeEntityID = entryID
         self._parentObj.setEntryParameters(
             self.__viewRangeEntityID,
             doClip=False,
             scaleType=MINIMAP_SCALE_TYPES.REAL_SCALE)
         self._invoke(entryID, ViewRangeSectorAs3Descr.AS_INIT_ARENA_SIZE,
                      arenaWidth)
         playerAvatar = BigWorld.player()
         vehicle = playerAvatar.getVehicleAttached()
         if vehicle is not None:
             sector = getCircularVisionAngle(vehicle)
             if sector is not None:
                 self.__addSectorEntity(sector)
         else:
             _logger.info('Initialize sector when vehicle will be created.')
             playerAvatar.onVehicleEnterWorld += self.__onVehicleEnterWorld
     return
 def __onUpgradeStarted(self, vehicleId):
     if self.__viewRangeEntityID:
         provider = matrix_factory.makeVehicleTurretMatrixMP()
         self._setMatrix(self.__viewRangeEntityID, Math.Matrix(provider))
     lineEntryID = self.__getDirectionLineEntryID()
     if lineEntryID:
         if self._ctrlVehicleID and avatar_getter.getPlayerVehicleID(
         ) != self._ctrlVehicleID:
             provider = matrix_factory.makePostmortemCameraMatrix()
         else:
             provider = matrix_factory.makeArcadeCameraMatrix()
         self._setMatrix(lineEntryID, Math.Matrix(provider))
 def __restoreMatrixProviders(self):
     self.__restoreMatrixCbkID = None
     if self.__viewRangeEntityID:
         self._setMatrix(self.__viewRangeEntityID,
                         matrix_factory.makeVehicleTurretMatrixMP())
     lineEntryID = self.__getDirectionLineEntryID()
     if lineEntryID:
         if self._ctrlVehicleID and avatar_getter.getPlayerVehicleID(
         ) != self._ctrlVehicleID:
             provider = matrix_factory.makePostmortemCameraMatrix()
         else:
             provider = matrix_factory.makeArcadeCameraMatrix()
         self._setMatrix(lineEntryID, provider)
     return