def __assembleNonDamagedOnly(resourceRefs, appearance, isPlayer, lodLink,
                              lodStateLink):
     model_assembler.assembleTerrainMatKindSensor(appearance, lodStateLink)
     model_assembler.assembleRecoil(appearance, lodLink)
     model_assembler.assembleGunLinkedNodesAnimator(appearance)
     model_assembler.assembleCollisionObstaclesCollector(
         appearance, lodStateLink)
     model_assembler.assembleTessellationCollisionSensor(
         appearance, lodStateLink)
     model_assembler.assembleSuspensionIfNeed(appearance, lodStateLink)
     model_assembler.assembleLeveredSuspensionIfNeed(
         appearance, lodStateLink)
     _assembleSwinging(appearance, lodLink)
     model_assembler.assembleSuspensionSound(appearance, lodLink, isPlayer)
     model_assembler.assembleSuspensionController(appearance)
     appearance.wheelsAnimator = model_assembler.createWheelsAnimator(
         appearance.compoundModel, appearance.typeDescriptor,
         appearance.splineTracks, appearance.filter, lodStateLink)
     appearance.trackNodesAnimator = model_assembler.createTrackNodesAnimator(
         appearance.compoundModel, appearance.typeDescriptor,
         appearance.wheelsAnimator, lodStateLink)
     model_assembler.assembleVehicleTraces(appearance, appearance.filter,
                                           lodStateLink)
     model_assembler.assembleTracks(resourceRefs, appearance.typeDescriptor,
                                    appearance, appearance.splineTracks,
                                    False, lodStateLink)
 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
示例#3
0
 def _assembleParts(self, isPlayer, appearance):
     if appearance.isAlive:
         appearance.detailedEngineState = self.__assembleEngineState(
             isPlayer)
         if not appearance.isPillbox and not gEffectsDisabled():
             appearance.engineAudition = self.__assembleEngineAudition(
                 isPlayer, appearance)
             appearance.detailedEngineState.onEngineStart += appearance.engineAudition.onEngineStart
             appearance.detailedEngineState.onStateChanged += appearance.engineAudition.onStateChanged
             createEffects(appearance)
         if isPlayer:
             gunRotatorConnector = GunRotatorConnector(appearance)
             appearance.addComponent(gunRotatorConnector)
             appearance.frictionAudition = Vehicular.FrictionAudition(
                 TANK_FRICTION_EVENT)
     self.__createTrackCrashControl(appearance)
     appearance.highlighter = Highlighter()
     isLodTopPriority = isPlayer
     lodCalcInst = Vehicular.LodCalculator(
         DataLinks.linkMatrixTranslation(appearance.compoundModel.matrix),
         True, VEHICLE_PRIORITY_GROUP, isLodTopPriority)
     appearance.lodCalculator = lodCalcInst
     lodLink = DataLinks.createFloatLink(lodCalcInst, 'lodDistance')
     lodStateLink = lodCalcInst.lodStateLink
     if not appearance.damageState.isCurrentModelDamaged:
         model_assembler.assembleRecoil(appearance, lodLink)
         model_assembler.assembleLeveredSuspensionIfNeed(
             appearance, lodStateLink)
         _assembleSwinging(appearance, lodLink)
         model_assembler.assembleSuspensionSound(appearance, lodLink,
                                                 isPlayer)
         model_assembler.assembleSuspensionController(appearance)
     model_assembler.setupTurretRotations(appearance)
示例#4
0
    def __assembleNonDamagedOnly(self, resourceRefs, isPlayer, lodLink, lodStateLink):
        model_assembler.assembleTerrainMatKindSensor(self, lodStateLink, self.spaceID)
        model_assembler.assembleRecoil(self, lodLink)
        model_assembler.assembleMultiGunRecoil(self, lodLink)
        model_assembler.assembleGunLinkedNodesAnimator(self)
        model_assembler.assembleCollisionObstaclesCollector(self, lodStateLink, self.typeDescriptor)
        model_assembler.assembleTessellationCollisionSensor(self, lodStateLink)
        wheelsScroll = None
        wheelsSteering = None
        generalWheelsAnimatorConfig = self.typeDescriptor.chassis.generalWheelsAnimatorConfig
        if generalWheelsAnimatorConfig is not None:
            scrollableWheelsCount = generalWheelsAnimatorConfig.getNonTrackWheelsCount()
            wheelsScroll = []
            for _ in xrange(scrollableWheelsCount):
                retrieverGameObject = ScriptGameObject(self.spaceID)
                retriever = retrieverGameObject.createComponent(NetworkFilters.FloatFilterRetriever)
                wheelsScroll.append(DataLinks.createFloatLink(retriever, 'value'))
                self.filterRetrievers.append(retriever)
                self.filterRetrieverGameObjects.append(retrieverGameObject)

            steerableWheelsCount = generalWheelsAnimatorConfig.getSteerableWheelsCount()
            wheelsSteering = []
            for _ in xrange(steerableWheelsCount):
                retrieverGameObject = ScriptGameObject(self.spaceID)
                retriever = retrieverGameObject.createComponent(NetworkFilters.FloatFilterRetriever)
                wheelsSteering.append(DataLinks.createFloatLink(retriever, 'value'))
                self.filterRetrievers.append(retriever)
                self.filterRetrieverGameObjects.append(retrieverGameObject)

        self.wheelsAnimator = model_assembler.createWheelsAnimator(self, ColliderTypes.VEHICLE_COLLIDER, self.typeDescriptor, lambda : self.wheelsState, wheelsScroll, wheelsSteering, self.splineTracks, lodStateLink)
        if self.customEffectManager is not None:
            self.customEffectManager.setWheelsData(self)
        suspensionLodLink = lodStateLink
        if 'wheeledVehicle' in self.typeDescriptor.type.tags:
            wheeledLodCalculator = self.wheelsGameObject.createComponent(Vehicular.LodCalculator, DataLinks.linkMatrixTranslation(self.compoundModel.matrix), True, WHEELED_CHASSIS_PRIORITY_GROUP, isPlayer)
            self.allLodCalculators.append(wheeledLodCalculator)
            suspensionLodLink = wheeledLodCalculator.lodStateLink
        model_assembler.assembleSuspensionIfNeed(self, suspensionLodLink)
        model_assembler.assembleLeveredSuspensionIfNeed(self, suspensionLodLink)
        self.__assembleSwinging(lodLink)
        model_assembler.assembleBurnoutProcessor(self)
        model_assembler.assembleSuspensionSound(self, lodLink, isPlayer)
        model_assembler.assembleHullAimingController(self)
        self.trackNodesAnimator = model_assembler.createTrackNodesAnimator(self, self.typeDescriptor, lodStateLink)
        model_assembler.assembleTracks(resourceRefs, self.typeDescriptor, self, self.splineTracks, False, lodStateLink)
        model_assembler.assembleVehicleTraces(self, self.filter, lodStateLink)
        return
 def _assembleParts(self, isPlayer, appearance):
     if appearance.isAlive:
         appearance.detailedEngineState = self.__assembleEngineState(isPlayer)
         if not appearance.isPillbox and not gEffectsDisabled():
             appearance.engineAudition = self.__assembleEngineAudition(isPlayer, appearance)
             appearance.detailedEngineState.onEngineStart += appearance.engineAudition.onEngineStart
             appearance.detailedEngineState.onStateChanged += appearance.engineAudition.onStateChanged
             _createEffects(appearance)
         if isPlayer:
             gunRotatorConnector = GunRotatorConnector(appearance)
             appearance.addComponent(gunRotatorConnector)
     self.__createTrackCrashControl(appearance)
     appearance.highlighter = Highlighter()
     lodCalcInst = Vehicular.LodCalculator(DataLinks.linkMatrixTranslation(appearance.compoundModel.matrix), True)
     appearance.lodCalculator = lodCalcInst
     lodLink = DataLinks.createFloatLink(lodCalcInst, 'lodDistance')
     if not appearance.damageState.isCurrentModelDamaged:
         model_assembler.assembleRecoil(appearance, lodLink)
         _assembleSwinging(appearance, lodLink)
     model_assembler.setupTurretRotations(appearance)
示例#6
0
 def _assembleParts(self, isPlayer, appearance):
     if appearance.isAlive:
         appearance.detailedEngineState = self.__assembleEngineState(
             isPlayer)
         if not appearance.isPillbox and not gEffectsDisabled():
             appearance.engineAudition = self.__assembleEngineAudition(
                 isPlayer, appearance)
             appearance.detailedEngineState.onEngineStart += appearance.engineAudition.onEngineStart
             appearance.detailedEngineState.onStateChanged += appearance.engineAudition.onStateChanged
             _createEffects(appearance)
         if isPlayer:
             gunRotatorConnector = GunRotatorConnector(appearance)
             appearance.addComponent(gunRotatorConnector)
     self.__createTrackCrashControl(appearance)
     appearance.highlighter = Highlighter()
     lodCalcInst = Vehicular.LodCalculator(
         DataLinks.linkMatrixTranslation(appearance.compoundModel.matrix),
         True)
     appearance.lodCalculator = lodCalcInst
     lodLink = DataLinks.createFloatLink(lodCalcInst, 'lodDistance')
     if not appearance.damageState.isCurrentModelDamaged:
         model_assembler.assembleRecoil(appearance, lodLink)
         _assembleSwinging(appearance, lodLink)
     model_assembler.setupTurretRotations(appearance)