def reset():
    global ownVehicle, getDistanceID, distance
    ownVehicle = None
    if getDistanceID is not None:
        cancelCallback(getDistanceID)
        getDistanceID = None
    distance = None
def updateCoordinates():
    global dataHor, dataVert, scaleHor, scaleVert, smoothingID
    if isMapCas:
        return
    if smoothingID is not None:
        cancelCallback(smoothingID)
        smoothingID = None
    verticalFov = projection().fov
    horizontalFov = verticalFov * getAspectRatio()
    screenW = screenWidth()
    screenH = screenHeight()
    scaleHor = screenW / horizontalFov if horizontalFov else screenW
    scaleVert = screenH / verticalFov if verticalFov else screenH
    dataHor, dataVert = coordinate(yaw, pitch)
    updateLabels()
def set_gunAnglesPacked(self, prev):
    global yaw, old_yaw, pitch, old_pitch, old_gunAnglesPacked, dataHor, dataVert, smoothingID, currentStepPitch, currentStepYaw
    if self.isPlayerVehicle and (
            self.gunAnglesPacked != old_gunAnglesPacked
    ) and battle.isBattleTypeSupported and showCorners and not isMapCas:
        if player() is not None and not player().isObserver():
            _pitch = self.gunAnglesPacked & 63
            if ((old_gunAnglesPacked & 63) == _pitch) and not showHorCorners:
                return
            old_gunAnglesPacked = self.gunAnglesPacked
            yaw = YAW_STEP_CORNER * (self.gunAnglesPacked >> 6 & 1023) - pi
            pitch = minBound + _pitch * pitchStep
            currentStepPitch = (pitch - old_pitch) * STEP
            currentStepYaw = (yaw - old_yaw) * STEP
            if smoothingID is not None:
                cancelCallback(smoothingID)
                smoothingID = None
            smoothing(old_yaw + currentStepYaw, old_pitch + currentStepPitch,
                      STEP)
            old_yaw = 0 if not showHorCorners else yaw
            old_pitch = pitch
        else:
            hideCorners()
Ejemplo n.º 4
0
 def cancelUpdate(self):
     if self.callbackID is not None:
         cancelCallback(self.callbackID)
         self.callbackID = None
Ejemplo n.º 5
0
def resetCallback(CallbackID):
    if CallbackID is not None:
        cancelCallback(CallbackID)
    return None