Пример #1
0
 def updateCamouflage(self, camouflageID = None):
     if camouflageID is None:
         camouflageID = self.__getCurrentCamouflage()
     self.initFashions()
     self.__fashions = camouflages.applyCamouflage(self.__vDesc, self.__fashions, self.__vState != 'undamaged', camouflageID)
     self.__fashions = camouflages.applyRepaint(self.__vDesc, self.__fashions)
     return
    def start(self, prereqs = None):
        if prereqs is None:
            self.__typeDesc.chassis['hitTester'].loadBspModel()
            self.__typeDesc.hull['hitTester'].loadBspModel()
            self.__typeDesc.turret['hitTester'].loadBspModel()
        for hitTester in self.__typeDesc.getHitTesters():
            hitTester.loadBspModel()

        self.__compoundModel = prereqs[self.__typeDesc.name]
        self.__boundEffects = bound_effects.ModelBoundEffects(self.__compoundModel)
        fashions = camouflages.prepareFashions(self.__typeDesc, self.__currentDamageState.isCurrentModelDamaged, self.__getCamouflageParams(self.__typeDesc, self.__vID)[0])
        if not self.__currentDamageState.isCurrentModelDamaged:
            self.__trackFashionSet = _setupVehicleFashion(fashions[0], self.__typeDesc)
        self.__compoundModel.setupFashions(fashions)
        fashions = camouflages.applyCamouflage(self.__typeDesc, fashions, self.__currentDamageState.isCurrentModelDamaged, self.__getCamouflageParams(self.__typeDesc, self.__vID)[0])
        fashions = camouflages.applyRepaint(self.__typeDesc, fashions)
        self.__setFashions(fashions, self.__isTurretDetached)
        self.__setupModels()
        if not VehicleDamageState.isDamagedModel(self.__currentDamageState.modelState):
            self.__splineTracks = setupSplineTracks(self.__fashion, self.__typeDesc, self.__compoundModel, prereqs)
        if self.__currentDamageState.effect is not None:
            self.__playEffect(self.__currentDamageState.effect, SpecialKeyPointNames.STATIC)
        if self.__currentDamageState.isCurrentModelDamaged:
            self.__trackScrollCtl = None
            self.__crashedTracksCtrl = None
        else:
            self.__crashedTracksCtrl = CrashedTrackController(self.__typeDesc, self.__fashion)
        return
    def start(self, prereqs=None):
        for hitTester in self.__typeDesc.getHitTesters():
            hitTester.loadBspModel()

        self.__compoundModel = prereqs[self.__typeDesc.name]
        self.__boundEffects = bound_effects.ModelBoundEffects(
            self.__compoundModel)
        isCurrentModelDamaged = self.__currentDamageState.isCurrentModelDamaged
        fashions = camouflages.prepareFashions(
            self.__typeDesc, isCurrentModelDamaged,
            self.__getCamouflageParams(self.__typeDesc, self.__vID)[0])
        if not isCurrentModelDamaged:
            model_assembler.setupVehicleFashion(fashions[0], self.__typeDesc)
        self.__compoundModel.setupFashions(fashions)
        fashions = camouflages.applyCamouflage(
            self.__typeDesc, fashions, isCurrentModelDamaged,
            self.__getCamouflageParams(self.__typeDesc, self.__vID)[0])
        fashions = camouflages.applyRepaint(self.__typeDesc, fashions)
        self.__setFashions(fashions, self.__isTurretDetached)
        self.__setupModels()
        if not isCurrentModelDamaged:
            self.__splineTracks = model_assembler.setupSplineTracks(
                self.__fashion, self.__typeDesc, self.__compoundModel, prereqs)
            self.__crashedTracksCtrl = CrashedTrackController(
                self.__typeDesc, self.__fashion)
        else:
            self.__trackScrollCtl = None
        if self.__currentDamageState.effect is not None:
            self.__playEffect(self.__currentDamageState.effect,
                              SpecialKeyPointNames.STATIC)
        self.__chassisDecal.create()
        return
Пример #4
0
 def start(self, vehicle, prereqs=None):
     self.__vehicle = vehicle
     player = BigWorld.player()
     if prereqs is None:
         self.__typeDesc.chassis['hitTester'].loadBspModel()
         self.__typeDesc.hull['hitTester'].loadBspModel()
         self.__typeDesc.turret['hitTester'].loadBspModel()
     if not self.__isPillbox:
         self.__filter.isStrafing = vehicle.isStrafing
         self.__filter.vehicleCollisionCallback = player.handleVehicleCollidedVehicle
     self.__originalFilter = vehicle.filter
     vehicle.filter = self.__filter
     enableNewPhysics = vehicle.physicsMode == VEHICLE_PHYSICS_MODE.DETAILED
     vehicle.filter.enableNewPhysics(enableNewPhysics)
     vehicle.filter.enableStabilisedMatrix(vehicle.isPlayerVehicle)
     self.__createStickers(prereqs)
     self.__compoundModel = prereqs[self.__typeDesc.name]
     self.__compoundModel.isHighPriorityReflection = vehicle.isPlayerVehicle
     self.__boundEffects = bound_effects.ModelBoundEffects(
         self.__compoundModel)
     fashions = camouflages.prepareFashions(
         self.__typeDesc, self.__currentDamageState.isCurrentModelDamaged,
         self.__getCamouflageParams(vehicle)[0],
         vehicle.physicsMode == VEHICLE_PHYSICS_MODE.DETAILED)
     if not self.__currentDamageState.isCurrentModelDamaged:
         _setupVehicleFashion(self, fashions[0], self.__vehicle)
     self.__compoundModel.setupFashions(fashions)
     fashions = camouflages.applyCamouflage(
         self.__typeDesc, fashions,
         self.__currentDamageState.isCurrentModelDamaged,
         self.__getCamouflageParams(vehicle)[0])
     fashions = camouflages.applyRepaint(self.__typeDesc, fashions)
     self.fashions = fashions
     self.__setupModels(True)
     if not VehicleDamageState.isDamagedModel(
             self.__currentDamageState.modelState):
         self.__splineTracks = setupSplineTracks(
             self.__fashion, self.__vehicle.typeDescriptor,
             self.__compoundModel, prereqs)
     if self.__currentDamageState.effect is not None:
         self.__playEffect(self.__currentDamageState.effect,
                           SpecialKeyPointNames.STATIC)
     toCrashedFashion = self.__fashion
     if self.__currentDamageState.isCurrentModelDamaged:
         toCrashedFashion = None
         self.__trackScrollCtl = None
     else:
         self.__trackScrollCtl.setData(self.__vehicle.filter,
                                       self.fashions.chassis)
     self.__crashedTracksCtrl = CrashedTrackController(
         vehicle.typeDescriptor, vehicle, toCrashedFashion,
         self.__vehicle.isPlayerVehicle)
     if vehicle.isAlive() and self.__vehicle.isPlayerVehicle:
         self.__vibrationsCtrl = VibrationControllersManager()
         if LightFx.LightManager.g_instance is not None and LightFx.LightManager.g_instance.isEnabled(
         ):
             self.__lightFxCtrl = LightFxControllersManager(self.__vehicle)
         if AuxiliaryFx.g_instance is not None:
             self.__auxiliaryFxCtrl = AuxiliaryFx.g_instance.createFxController(
                 self.__vehicle)
     if not BattleReplay.isPlaying():
         self.compoundModel.stipple = True
         self.delayCallback(_VEHICLE_APPEAR_TIME, self.__disableStipple)
     self.__vehicleMatrixProv = vehicle.model.matrix
     return