def __assembleModel(self):
     resources = self.__resources
     self.__model = resources[self.__vDesc.name]
     self.__setupEmblems(self.__vDesc)
     if not self.__isVehicleDestroyed:
         self.__fashions = VehiclePartsTuple(
             BigWorld.WGVehicleFashion(False), None, None, None)
         model_assembler.setupTracksFashion(self.__fashions.chassis,
                                            self.__vDesc,
                                            self.__isVehicleDestroyed)
         self.__model.setupFashions(self.__fashions)
         chassisFashion = self.__fashions.chassis
         model_assembler.setupSplineTracks(chassisFashion, self.__vDesc,
                                           self.__model, self.__resources)
         self.wheelsAnimator = model_assembler.createWheelsAnimator(
             self.__model, self.__vDesc, None)
         self.trackNodesAnimator = model_assembler.createTrackNodesAnimator(
             self.__model, self.__vDesc, self.wheelsAnimator)
     else:
         self.__fashions = VehiclePartsTuple(None, None, None, None)
         self.wheelsAnimator = None
         self.trackNodesAnimator = None
     self.updateCamouflage()
     yaw = self.__vDesc.gun.staticTurretYaw
     pitch = self.__vDesc.gun.staticPitch
     if yaw is None:
         yaw = 0.0
     if pitch is None:
         pitch = 0.0
     gunMatrix = mathUtils.createRTMatrix(Math.Vector3(yaw, pitch, 0.0),
                                          (0.0, 0.0, 0.0))
     self.__model.node('gun', gunMatrix)
     return self.__model
Esempio n. 2
0
 def __assembleModel(self):
     resources = self.__resources
     self.__model = resources[self.__vDesc.name]
     self.__setupEmblems(self.__vDesc)
     if not self.__isVehicleDestroyed:
         self.__fashions = VehiclePartsTuple(
             BigWorld.WGVehicleFashion(False, _CFG['v_scale']), None, None,
             None)
         import VehicleAppearance
         VehicleAppearance.setupTracksFashion(self.__fashions.chassis,
                                              self.__vDesc,
                                              self.__isVehicleDestroyed)
         self.__model.setupFashions(self.__fashions)
         chassisFashion = self.__fashions.chassis
         chassisFashion.initialUpdateTracks(1.0, 10.0)
         VehicleAppearance.setupSplineTracks(chassisFashion, self.__vDesc,
                                             self.__model, self.__resources)
     else:
         self.__fashions = VehiclePartsTuple(None, None, None, None)
     self.updateCamouflage()
     yaw = self.__vDesc.gun.get('staticTurretYaw', 0.0)
     pitch = self.__vDesc.gun.get('staticPitch', 0.0)
     if yaw is None:
         yaw = 0.0
     if pitch is None:
         pitch = 0.0
     gunMatrix = mathUtils.createRTMatrix(Math.Vector3(yaw, pitch, 0.0),
                                          (0.0, 0.0, 0.0))
     self.__model.node('gun', gunMatrix)
     return self.__model
    def __assembleModel(self):
        from vehicle_systems import model_assembler
        resources = self.__resources
        self.__vEntity.model = resources[self.__vDesc.name]
        if not self.__isVehicleDestroyed:
            self.__fashions = VehiclePartsTuple(BigWorld.WGVehicleFashion(False), BigWorld.WGBaseFashion(), BigWorld.WGBaseFashion(), BigWorld.WGBaseFashion())
            model_assembler.setupTracksFashion(self.__vDesc, self.__fashions.chassis)
            self.__vEntity.model.setupFashions(self.__fashions)
            self.__initMaterialHandlers()
            model_assembler.assembleCollisionObstaclesCollector(self, None)
            model_assembler.assembleTessellationCollisionSensor(self, None)
            self.wheelsAnimator = model_assembler.createWheelsAnimator(self.__vEntity.model, self.__vDesc, None)
            self.trackNodesAnimator = model_assembler.createTrackNodesAnimator(self.__vEntity.model, self.__vDesc, self.wheelsAnimator)
            chassisFashion = self.__fashions.chassis
            splineTracksImpl = model_assembler.setupSplineTracks(chassisFashion, self.__vDesc, self.__vEntity.model, self.__resources)
            model_assembler.assembleTracks(self.__resources, self.__vDesc, self, splineTracksImpl, True)
            self.updateCustomization(self.__outfit)
            dirtEnabled = BigWorld.WG_dirtEnabled() and 'HD' in self.__vDesc.type.tags
            if dirtEnabled:
                dirtHandlers = [BigWorld.PyDirtHandler(True, self.__vEntity.model.node(TankPartNames.CHASSIS).position.y),
                 BigWorld.PyDirtHandler(False, self.__vEntity.model.node(TankPartNames.HULL).position.y),
                 BigWorld.PyDirtHandler(False, self.__vEntity.model.node(TankPartNames.TURRET).position.y),
                 BigWorld.PyDirtHandler(False, self.__vEntity.model.node(TankPartNames.GUN).position.y)]
                modelHeight, _ = self.computeVehicleHeight()
                self.dirtComponent = Vehicular.DirtComponent(dirtHandlers, modelHeight)
                for fashionIdx, _ in enumerate(TankPartNames.ALL):
                    self.__fashions[fashionIdx].addMaterialHandler(dirtHandlers[fashionIdx])

                self.dirtComponent.setBase()
        else:
            self.__fashions = VehiclePartsTuple(BigWorld.WGBaseFashion(), BigWorld.WGBaseFashion(), BigWorld.WGBaseFashion(), BigWorld.WGBaseFashion())
            self.__vEntity.model.setupFashions(self.__fashions)
            self.wheelsAnimator = None
            self.trackNodesAnimator = None
            self.dirtComponent = None
        cfg = hangarCFG()
        turretYaw = self.__vDesc.gun.staticTurretYaw
        gunPitch = self.__vDesc.gun.staticPitch
        if not ('AT-SPG' in self.__vDesc.type.tags or 'SPG' in self.__vDesc.type.tags):
            if turretYaw is None:
                turretYaw = cfg['vehicle_turret_yaw']
                turretYawLimits = self.__vDesc.gun.turretYawLimits
                if turretYawLimits is not None:
                    turretYaw = mathUtils.clamp(turretYawLimits[0], turretYawLimits[1], turretYaw)
            if gunPitch is None:
                gunPitch = cfg['vehicle_gun_pitch']
                gunPitchLimits = self.__vDesc.gun.pitchLimits['absolute']
                gunPitch = mathUtils.clamp(gunPitchLimits[0], gunPitchLimits[1], gunPitch)
        else:
            if turretYaw is None:
                turretYaw = 0.0
            if gunPitch is None:
                gunPitch = 0.0
        turretYawMatrix = mathUtils.createRotationMatrix((turretYaw, 0.0, 0.0))
        self.__vEntity.model.node(TankPartNames.TURRET, turretYawMatrix)
        gunPitchMatrix = mathUtils.createRotationMatrix((0.0, gunPitch, 0.0))
        self.__vEntity.model.node(TankPartNames.GUN, gunPitchMatrix)
        return
Esempio n. 4
0
 def __prepareSystemsForDamagedVehicle(self, vehicle, isTurretDetached):
     if self.flyingInfoProvider is not None:
         self.flyingInfoProvider.setData(vehicle.filter, None)
     self.vehicleTraces = None
     self.suspensionSound = None
     self.swingingAnimator = None
     self.gunRecoil = None
     self.gunLinkedNodesAnimator = None
     self.suspension = None
     self.leveredSuspension = None
     self.trackNodesAnimator = None
     self.wheelsAnimator = None
     fashions = VehiclePartsTuple(BigWorld.WGVehicleFashion(True), None,
                                  None, None)
     self.__setFashions(fashions, isTurretDetached)
     model_assembler.setupTracksFashion(self.__typeDesc, self.__fashion)
     self.showStickers(False)
     self.customEffectManager = None
     self.__destroyEngineAudition()
     self.detailedEngineState = None
     self.trackCrashAudition = None
     self.frictionAudition = None
     self.terrainMatKindSensor = None
     self.__splineTracks = None
     model = self.compoundModel
     self.waterSensor.sensorPlaneLink = model.root
     self.peripheralsController = None
     self.dirtComponent = None
     self.tracks = None
     self.collisionObstaclesCollector = None
     self.tessellationCollisionSensor = None
     self.siegeEffects = None
     self.__destroySystems()
     return
Esempio n. 5
0
 def __assembleModel(self):
     resources = self.__resources
     self.__model = resources[self.__vDesc.name]
     self.__setupEmblems(self.__vDesc)
     if not self.__isVehicleDestroyed:
         self.__fashions = VehiclePartsTuple(BigWorld.WGVehicleFashion(False, _CFG['v_scale']), None, None, None)
         import VehicleAppearance
         VehicleAppearance.setupTracksFashion(self.__fashions.chassis, self.__vDesc, self.__isVehicleDestroyed)
         self.__model.setupFashions(self.__fashions)
         chassisFashion = self.__fashions.chassis
         chassisFashion.initialUpdateTracks(1.0, 10.0)
         VehicleAppearance.setupSplineTracks(chassisFashion, self.__vDesc, self.__model, self.__resources)
     else:
         self.__fashions = VehiclePartsTuple(None, None, None, None)
     self.updateCamouflage()
     return self.__model
Esempio n. 6
0
 def __prepareSystemsForDamagedVehicle(self, vehicle, isTurretDetached):
     if self.flyingInfoProvider is not None:
         self.flyingInfoProvider.setData(vehicle.filter, None)
     self.vehicleTraces = None
     self.suspensionSound = None
     self.swingingAnimator = None
     self.gunRecoil = None
     self.gunLinkedNodesAnimator = None
     self.suspension = None
     self.leveredSuspension = None
     self.trackNodesAnimator = None
     self.wheelsAnimator = None
     fashions = VehiclePartsTuple(None, None, None, None)
     self.__setFashions(fashions, isTurretDetached)
     self.customEffectManager = None
     self.__destroyEngineAudition()
     self.detailedEngineState = None
     self.trackCrashAudition = None
     self.frictionAudition = None
     self.terrainMatKindSensor = None
     self.__splineTracks = None
     model = self.compoundModel
     self.waterSensor.sensorPlaneLink = model.root
     self.peripheralsController = None
     self.__destroySystems()
     return
 def __onModelsRefresh(self, modelState, resourceList):
     if BattleReplay.isFinished():
         return
     elif modelState != self.__currentDamageState.modelState:
         self.__requestModelsRefresh()
         return
     elif self.__vehicle is None:
         return
     else:
         vehicle = self.__vehicle
         newCompoundModel = resourceList[self.__typeDesc.name]
         self.deactivate(False)
         self.__compoundModel = newCompoundModel
         self.__isTurretDetached = vehicle.isTurretDetached
         if self.__currentDamageState.isCurrentModelDamaged:
             fashions = VehiclePartsTuple(None, None, None, None)
             self.swingingAnimator = None
             self.gunRecoil = None
             self.__setFashions(fashions, self.__isTurretDetached)
             self.__destroySystems()
             self.__trackFashionSet = False
         self.__setupModels()
         self.setVehicle(vehicle)
         self.activate()
         self.__reattachComponents(self.__compoundModel)
         lodLink = DataLinks.createFloatLink(self.lodCalculator, 'lodDistance')
         if not self.damageState.isCurrentModelDamaged:
             model_assembler.assembleRecoil(self, lodLink)
         model_assembler.setupTurretRotations(self)
         return
 def __init__(self, spaceId, vEntity):
     ScriptGameObject.__init__(self, vEntity.spaceID)
     self.__loadState = _LoadStateNotifier()
     self.__curBuildInd = 0
     self.__vDesc = None
     self.__vState = None
     size = len(TankPartNames.ALL)
     self.__fashions = VehiclePartsTuple(*([None] * size))
     self.__repaintHandlers = [None] * size
     self.__camoHandlers = [None] * size
     self.__projectionDecalsHandlers = [None] * size
     self.__projectionDecalsUpdater = None
     self.__spaceId = spaceId
     self.__vEntity = weakref.proxy(vEntity)
     self.__onLoadedCallback = None
     self.__onLoadedAfterRefreshCallback = None
     self.__vehicleStickers = None
     self.__isVehicleDestroyed = False
     self.__outfit = None
     self.__staticTurretYaw = 0.0
     self.__staticGunPitch = 0.0
     self.__anchorsHelpers = None
     self.__anchorsParams = None
     self.__attachments = []
     self.__modelAnimators = []
     self.shadowManager = None
     cfg = hangarCFG()
     self.__currentEmblemsAlpha = cfg['emblems_alpha_undamaged']
     self.__showMarksOnGun = self.settingsCore.getSetting('showMarksOnGun')
     self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.itemsCache.onSyncCompleted += self.__onItemsCacheSyncCompleted
     g_eventBus.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                            self.__handleEntityUpdated)
     g_currentVehicle.onChanged += self.__onVehicleChanged
     return
Esempio n. 9
0
 def __init__(self, spaceId, vEntity):
     ComponentSystem.__init__(self)
     self.__loadState = _LoadStateNotifier()
     self.__curBuildInd = 0
     self.__vDesc = None
     self.__vState = None
     self.__fashions = VehiclePartsTuple(None, None, None, None)
     self.__repaintHandlers = [None, None, None, None]
     self.__camoHandlers = [None, None, None, None]
     self.__spaceId = spaceId
     self.__vEntity = weakref.proxy(vEntity)
     self.__onLoadedCallback = None
     self.__onLoadedAfterRefreshCallback = None
     self.__vehicleStickers = None
     self.__isVehicleDestroyed = False
     self.__outfit = None
     self.shadowManager = None
     cfg = hangarCFG()
     self.__currentEmblemsAlpha = cfg['emblems_alpha_undamaged']
     self.__showMarksOnGun = self.settingsCore.getSetting('showMarksOnGun')
     self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     self.itemsCache.onSyncCompleted += self.__onItemsCacheSyncCompleted
     g_eventBus.addListener(CameraRelatedEvents.CAMERA_ENTITY_UPDATED,
                            self.__handleEntityUpdated)
     return
Esempio n. 10
0
def applyCamouflage(vDesc, fashions, isCurrentModelDamaged, camouflageId=None):
    fashions = list(fashions)
    texture = ''
    colors = [0, 0, 0, 0]
    weights = Math.Vector4(1, 0, 0, 0)
    camouflagePresent = False
    customization = items.vehicles.g_cache.customization(
        vDesc.type.customizationNationID)
    defaultTiling = None
    if camouflageId is not None and customization is not None:
        camouflage = customization['camouflages'].get(camouflageId)
        if camouflage is not None:
            camouflagePresent = True
            texture = camouflage['texture']
            colors = camouflage['colors']
            weights = Math.Vector4(*[(c >> 24) / 255.0 for c in colors])
            defaultTiling = camouflage['tiling'].get(vDesc.type.compactDescr)
    if isCurrentModelDamaged:
        weights *= 0.1
    for fashionIdx, descId in enumerate(TankPartNames.ALL):
        exclusionMap = vDesc.type.camouflage.exclusionMask
        tiling = defaultTiling
        if tiling is None:
            tiling = vDesc.type.camouflage.tiling
        if descId == 'chassis':
            compDesc = vDesc.chassis
        elif descId == 'hull':
            compDesc = vDesc.hull
        elif descId == 'turret':
            compDesc = vDesc.turret
        elif descId == 'gun':
            compDesc = vDesc.gun
        else:
            compDesc = None
        if compDesc is not None:
            coeff = compDesc.camouflage.tiling
            if coeff is not None:
                if tiling is not None:
                    tiling = (tiling[0] * coeff[0], tiling[1] * coeff[1],
                              tiling[2] + coeff[2], tiling[3] + coeff[3])
                else:
                    tiling = coeff
            if compDesc.camouflage.exclusionMask:
                exclusionMap = compDesc.camouflage.exclusionMask
        useCamouflage = camouflagePresent and texture
        fashion = fashions[fashionIdx]
        if fashion is not None:
            if useCamouflage:
                fashion.setCamouflage(texture, exclusionMap, tiling, colors[0],
                                      colors[1], colors[2], colors[3], weights)
            else:
                fashion.removeCamouflage()
        elif useCamouflage:
            LOG_ERROR(
                'Unexpected lack of fashion, but camouflage is being applied. Use prepareFashions function!'
            )

    return VehiclePartsTuple(*fashions)
def prepareFashions(isDamaged):
    if isDamaged:
        fashions = [None, None, None, None]
    else:
        fashions = [
            BigWorld.WGVehicleFashion(),
            BigWorld.WGBaseFashion(),
            BigWorld.WGBaseFashion(),
            BigWorld.WGBaseFashion()
        ]
    return VehiclePartsTuple(*fashions)
Esempio n. 12
0
    def __prepareSystemsForDamagedVehicle(self, vehicle, isTurretDetached):
        if self.flyingInfoProvider is not None:
            self.flyingInfoProvider.setData(vehicle.filter, None)
        if self.vehicleTraces is not None and not self.vehicleTraces.activePostmortem:
            self.vehicleTraces = None
        self.suspensionSound = None
        self.swingingAnimator = None
        self.burnoutProcessor = None
        self.gunRecoil = None
        self.gunAnimators = []
        self.gunLinkedNodesAnimator = None
        if self.suspension is not None and not self.suspension.activePostmortem:
            self.suspension = None
        if self.leveredSuspension is not None and not self.leveredSuspension.activePostmortem:
            self.leveredSuspension = None
        self.trackNodesAnimator = None
        if self.wheelsAnimator is not None and not self.wheelsAnimator.activePostmortem:
            self.wheelsAnimator = None
        self.gearbox = None
        self.gunRotatorAudition = None
        while self.__tmpGameObjectNames:
            tmpName = self.__tmpGameObjectNames.pop()
            tmpCmp = self.findComponent(tmpName)
            if tmpCmp:
                self.removeComponent(tmpCmp)
            _logger.warning('Component "%s" has not been found', tmpName)

        fashions = VehiclePartsTuple(BigWorld.WGVehicleFashion(), None, None,
                                     None)
        self._setFashions(fashions, isTurretDetached)
        model_assembler.setupTracksFashion(self.typeDescriptor, self.fashion)
        self.showStickers(False)
        self.customEffectManager = None
        self.__destroyEngineAudition()
        self.detailedEngineState = None
        self.frictionAudition = None
        self.terrainMatKindSensor = None
        self._splineTracks = None
        model = self.compoundModel
        self.waterSensor.sensorPlaneLink = model.root
        self.peripheralsController = None
        self.dirtComponent = None
        self.tracks = None
        if self.collisionObstaclesCollector is not None and not self.collisionObstaclesCollector.activePostmortem:
            self.collisionObstaclesCollector = None
        if self.tessellationCollisionSensor is not None and not self.tessellationCollisionSensor.activePostmortem:
            self.tessellationCollisionSensor = None
        self.siegeEffects = None
        self._destroySystems()
        return
 def destroy(self):
     self.flagComponent = None
     self.__modelAnimators = []
     self._destroySystems()
     fashions = VehiclePartsTuple(None, None, None, None)
     self._setFashions(fashions, self._isTurretDetached)
     super(CommonTankAppearance, self).destroy()
     self.__typeDesc = None
     if self.boundEffects is not None:
         self.boundEffects.destroy()
     self._vehicleStickers = None
     self._chassisDecal.destroy()
     self._chassisDecal = None
     self._compoundModel = None
     return
Esempio n. 14
0
 def assembleStipple(self):
     compound = self.compoundModel
     compound.matrix = Math.Matrix(compound.matrix)
     hullNode = compound.node(TankPartNames.HULL)
     compound.node(TankPartNames.HULL, hullNode.localMatrix)
     turretRotation = compound.node(TankPartNames.TURRET)
     if turretRotation is not None:
         compound.node(TankPartNames.TURRET, turretRotation.localMatrix)
     gunInclination = compound.node(TankNodeNames.GUN_INCLINATION)
     if gunInclination is not None:
         compound.node(TankNodeNames.GUN_INCLINATION, gunInclination.localMatrix)
     gunRecoil = compound.node(TankNodeNames.GUN_RECOIL)
     if gunRecoil is not None:
         compound.node(TankNodeNames.GUN_RECOIL, gunRecoil.localMatrix)
     self.fashions = VehiclePartsTuple(None, None, None, None)
     return
Esempio n. 15
0
def applyRepaint(vDesc, fashions):
    if not hasattr(vDesc.type, 'repaintParameters'):
        return fashions
    else:
        repaintReferenceColor, repaintReplaceColor, repaintGlossRangeScale = _getRepaintParams(
            vDesc)
        fashions = list(fashions)
        for fashionIdx, fashion in enumerate(fashions):
            if fashion is not None:
                fashion.setRepaint(repaintReferenceColor, repaintReplaceColor,
                                   repaintGlossRangeScale)
            else:
                LOG_ERROR(
                    'Unexpected lack of fashion, but repaint is being applied. Use prepareFashions function!'
                )

        return VehiclePartsTuple(*fashions)
Esempio n. 16
0
 def destroy(self):
     if self.__vehicle is not None:
         self.deactivate()
     self.__destroySystems()
     fashions = VehiclePartsTuple(None, None, None, None)
     self.__setFashions(fashions, self.__isTurretDetached)
     ComponentSystem.destroy(self)
     self.__typeDesc = None
     if self.__boundEffects is not None:
         self.__boundEffects.destroy()
     self.__vehicleStickers = None
     self.onModelChanged = None
     self.__chassisDecal.destroy()
     self.__chassisDecal = None
     self.__compoundModel = None
     CallbackDelayer.destroy(self)
     return
Esempio n. 17
0
 def __init__(self, spaceId, vEntityId, hangarSpace):
     self.__isLoaded = False
     self.__curBuildInd = 0
     self.__vDesc = None
     self.__vState = None
     self.__fashions = VehiclePartsTuple(None, None, None, None)
     self.__spaceId = spaceId
     self.__vEntityId = vEntityId
     self.__onLoadedCallback = None
     self.__emblemsAlpha = _CFG['emblems_alpha_undamaged']
     self.__vehicleStickers = None
     self.__isVehicleDestroyed = False
     self.__smCb = None
     self.__smRemoveCb = None
     self.__hangarSpace = weakref.proxy(hangarSpace)
     self.__removeHangarShadowMap()
     self.__showMarksOnGun = self.settingsCore.getSetting('showMarksOnGun')
     self.settingsCore.onSettingsChanged += self.__onSettingsChanged
     g_itemsCache.onSyncCompleted += self.__onItemsCacheSyncCompleted
     return
Esempio n. 18
0
    def destroy(self):
        self._vehicleInfo = {}
        self.flagComponent = None
        self._destroySystems()
        fashions = VehiclePartsTuple(None, None, None, None)
        self._setFashions(fashions, self._isTurretDetached)
        self.shadowManager.unregisterCompoundModel(self.compoundModel)
        for go in self.filterRetrieverGameObjects:
            go.destroy()

        self.wheelsGameObject.destroy()
        super(CommonTankAppearance, self).destroy()
        self.__typeDesc = None
        if self.boundEffects is not None:
            self.boundEffects.destroy()
        self._vehicleStickers = None
        self._chassisDecal.destroy()
        self._chassisDecal = None
        self._compoundModel = None
        self._destroyStickers()
        return
Esempio n. 19
0
 def __onModelsRefresh(self, modelState, resourceList):
     if self.__vehicle is None:
         return
     elif modelState != self.__currentDamageState.modelState:
         self.__requestModelsRefresh()
         return
     else:
         BigWorld.player().inputHandler.removeVehicleFromCameraCollider(
             self.__vehicle)
         self.__chassisOcclusionDecal.detach()
         self.__gunFireNode = None
         if self.exhaustEffects:
             self.__attachExhaust(False)
         if self.trailEffects:
             self.__trailEffects.stopEffects()
         if self.customEffectManager:
             self.__customEffectManager.stop()
         self.__crashedTracksCtrl.reset()
         fashions = self.fashions
         self.fashions = VehiclePartsTuple(None, None, None, None)
         self.__compoundModel = resourceList[self.__typeDesc.name]
         if self.__currentDamageState.isCurrentModelDamaged:
             if self.__vehicle.isTurretDetached:
                 fashions = fashions._replace(chassis=None,
                                              turret=None,
                                              gun=None)
             else:
                 fashions = fashions._replace(chassis=None, gun=None)
             self.__swingingAnimator = None
             self.__gunRecoil = None
         self.fashions = fashions
         self.__setupModels(False)
         actualFilter = self.__vehicle.filter
         self.__vehicle.filter = self.__originalFilter
         self.__vehicle.filter = actualFilter
         return
    def __assembleModel(self):
        from vehicle_systems import model_assembler
        resources = self.__resources
        self.__vEntity.model = resources[self.__vDesc.name]
        if not self.__isVehicleDestroyed:
            self.__fashions = VehiclePartsTuple(BigWorld.WGVehicleFashion(),
                                                BigWorld.WGBaseFashion(),
                                                BigWorld.WGBaseFashion(),
                                                BigWorld.WGBaseFashion())
            model_assembler.setupTracksFashion(self.__vDesc,
                                               self.__fashions.chassis)
            self.__vEntity.model.setupFashions(self.__fashions)
            model_assembler.assembleCollisionObstaclesCollector(
                self, None, self.__vDesc,
                BigWorld.player().spaceID)
            model_assembler.assembleTessellationCollisionSensor(self, None)
            wheelsScroll = None
            wheelsSteering = None
            if self.__vDesc.chassis.generalWheelsAnimatorConfig is not None:
                scrollableWheelsCount = self.__vDesc.chassis.generalWheelsAnimatorConfig.getWheelsCount(
                )
                wheelsScroll = [(lambda: 0.0)
                                for _ in xrange(scrollableWheelsCount)]
                steerableWheelsCount = self.__vDesc.chassis.generalWheelsAnimatorConfig.getSteerableWheelsCount(
                )
                wheelsSteering = [(lambda: 0.0)
                                  for _ in xrange(steerableWheelsCount)]
            chassisFashion = self.__fashions.chassis
            splineTracksImpl = model_assembler.setupSplineTracks(
                chassisFashion, self.__vDesc, self.__vEntity.model,
                self.__resources, self.__outfit.modelsSet)
            self.wheelsAnimator = model_assembler.createWheelsAnimator(
                self, ColliderTypes.VEHICLE_COLLIDER, self.__vDesc, lambda: 0,
                wheelsScroll, wheelsSteering, splineTracksImpl)
            self.trackNodesAnimator = model_assembler.createTrackNodesAnimator(
                self, self.__vDesc)
            model_assembler.assembleTracks(self.__resources, self.__vDesc,
                                           self, splineTracksImpl, True)
            dirtEnabled = BigWorld.WG_dirtEnabled(
            ) and 'HD' in self.__vDesc.type.tags
            if dirtEnabled:
                dirtHandlers = [
                    BigWorld.PyDirtHandler(
                        True,
                        self.__vEntity.model.node(
                            TankPartNames.CHASSIS).position.y),
                    BigWorld.PyDirtHandler(
                        False,
                        self.__vEntity.model.node(
                            TankPartNames.HULL).position.y),
                    BigWorld.PyDirtHandler(
                        False,
                        self.__vEntity.model.node(
                            TankPartNames.TURRET).position.y),
                    BigWorld.PyDirtHandler(
                        False,
                        self.__vEntity.model.node(
                            TankPartNames.GUN).position.y)
                ]
                modelHeight, _ = self.computeVehicleHeight()
                self.dirtComponent = self.createComponent(
                    Vehicular.DirtComponent, dirtHandlers, modelHeight)
                for fashionIdx, _ in enumerate(TankPartNames.ALL):
                    self.__fashions[fashionIdx].addMaterialHandler(
                        dirtHandlers[fashionIdx])

                self.dirtComponent.setBase()
            outfitData = camouflages.getOutfitData(
                self, self.__outfit, self.__vDesc,
                self.__vState != 'undamaged')
            self.c11nComponent = self.createComponent(
                Vehicular.C11nEditComponent, self.__fashions,
                self.compoundModel, outfitData)
            self.__updateDecals(self.__outfit)
            self.__updateSequences(self.__outfit)
        else:
            self.__fashions = VehiclePartsTuple(BigWorld.WGVehicleFashion(),
                                                BigWorld.WGBaseFashion(),
                                                BigWorld.WGBaseFashion(),
                                                BigWorld.WGBaseFashion())
            self.__vEntity.model.setupFashions(self.__fashions)
            self.wheelsAnimator = None
            self.trackNodesAnimator = None
            self.dirtComponent = None
            self.flagComponent = None
        self.__staticTurretYaw = self.__vDesc.gun.staticTurretYaw
        self.__staticGunPitch = self.__vDesc.gun.staticPitch
        if not ('AT-SPG' in self.__vDesc.type.tags
                or 'SPG' in self.__vDesc.type.tags):
            if self.__staticTurretYaw is None:
                self.__staticTurretYaw = self._getTurretYaw()
                turretYawLimits = self.__vDesc.gun.turretYawLimits
                if turretYawLimits is not None:
                    self.__staticTurretYaw = math_utils.clamp(
                        turretYawLimits[0], turretYawLimits[1],
                        self.__staticTurretYaw)
            if self.__staticGunPitch is None:
                self.__staticGunPitch = self._getGunPitch()
                gunPitchLimits = self.__vDesc.gun.pitchLimits['absolute']
                self.__staticGunPitch = math_utils.clamp(
                    gunPitchLimits[0], gunPitchLimits[1],
                    self.__staticGunPitch)
        else:
            if self.__staticTurretYaw is None:
                self.__staticTurretYaw = 0.0
            if self.__staticGunPitch is None:
                self.__staticGunPitch = 0.0
        turretYawMatrix = math_utils.createRotationMatrix(
            (self.__staticTurretYaw, 0.0, 0.0))
        self.__vEntity.model.node(TankPartNames.TURRET, turretYawMatrix)
        gunPitchMatrix = math_utils.createRotationMatrix(
            (0.0, self.__staticGunPitch, 0.0))
        self.__setGunMatrix(gunPitchMatrix)
        return