当前位置: 首页>>代码示例>>Python>>正文


Python EffectsList.EffectsListPlayer类代码示例

本文整理汇总了Python中helpers.EffectsList.EffectsListPlayer的典型用法代码示例。如果您正苦于以下问题:Python EffectsListPlayer类的具体用法?Python EffectsListPlayer怎么用?Python EffectsListPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EffectsListPlayer类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addNewToNode

 def addNewToNode(self, node, matProv, effectsList, keyPoints, waitForKeyOff = False, **args):
     if not node and matProv is None:
         position = None
     else:
         position = (node, matProv)
     desc = EffectsListPlayer(effectsList, keyPoints, position=position, **args)
     desc.play(self.__model, None, partial(self._effects.remove, desc), waitForKeyOff)
     self._effects.append(desc)
     return desc
开发者ID:webiumsk,项目名称:WOT-0.9.15.1,代码行数:9,代码来源:bound_effects.py

示例2: _start

 def _start(self, data, args):
     data['_isStarted'] = False
     vehicle = data['entity']
     isUnderwater = vehicle.appearance.isUnderwater
     data['wasUnderwater'] = isUnderwater
     if not isUnderwater:
         stages, effects, _ = random.choice(vehicle.typeDescriptor.type.effects['flaming'])
         data['entity_id'] = vehicle.id
         effectListPlayer = EffectsListPlayer(effects, stages, **data)
         data['_effectsPlayer'] = effectListPlayer
         effectListPlayer.play(vehicle.appearance.compoundModel, None, None, True)
     data['_isStarted'] = True
     vehicle.appearance.switchFireVibrations(True)
     return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:14,代码来源:vehicle_extras.py

示例3: checkUnderwater

 def checkUnderwater(self, vehicle, isVehicleUnderwater):
     data = vehicle.extras[self.index]
     wasUnderwater = data.get('wasUnderwater', False)
     if isVehicleUnderwater and not wasUnderwater:
         if '_effectsPlayer' in data:
             effectsListPlayer = data['_effectsPlayer']
             effectsListPlayer.stop()
             del data['_effectsPlayer']
     if not isVehicleUnderwater and wasUnderwater:
         stages, effects, _ = random.choice(vehicle.typeDescriptor.type.effects['flaming'])
         data['entity_id'] = vehicle.id
         effectListPlayer = EffectsListPlayer(effects, stages, **data)
         data['_effectsPlayer'] = effectListPlayer
         effectListPlayer.play(vehicle.appearance.compoundModel, None, None, True)
     data['wasUnderwater'] = isVehicleUnderwater
     return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:16,代码来源:vehicle_extras.py

示例4: playEffect

 def playEffect(self):
     if self.__effectsPlayer is not None:
         return
     else:
         if self.__effectsTimeLine is not None:
             self.__effectsPlayer = EffectsListPlayer(self.__effectsTimeLine.effectsList, self.__effectsTimeLine.keyPoints)
             self.__effectsPlayer.play(self.__model)
         return
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:8,代码来源:ctfmanager.py

示例5: _start

    def _start(self, data, args):
        data['_isStarted'] = False
        vehicle = data['entity']
        isUnderwater = vehicle.appearance.isUnderwater
        data['wasUnderwater'] = isUnderwater
        if not isUnderwater:
            (stages, effects, _,) = random.choice(vehicle.typeDescriptor.type.effects['flaming'])
            data['modelMap'] = {}
            for (i, j,) in vehicle.appearance.modelsDesc.iteritems():
                data['modelMap'][i] = vehicle.appearance.modelsDesc[i]['model']

            data['entity_id'] = vehicle.id
            effectListPlayer = EffectsListPlayer(effects, stages, **data)
            data['_effectsPlayer'] = effectListPlayer
            effectListPlayer.play(vehicle.appearance.modelsDesc['hull']['model'], None, None, True)
        data['_isStarted'] = True
        vehicle.appearance.switchFireVibrations(True)
开发者ID:Infernux,项目名称:Projects,代码行数:17,代码来源:vehicle_extras.py

示例6: checkUnderwater

    def checkUnderwater(self, data, vehicle, isVehicleUnderwater):
        wasUnderwater = data.get('wasUnderwater', False)
        if isVehicleUnderwater and not wasUnderwater:
            if '_effectsPlayer' in data:
                effectsListPlayer = data['_effectsPlayer']
                effectsListPlayer.stop()
                del data['_effectsPlayer']
        if not isVehicleUnderwater and wasUnderwater:
            (stages, effects, _,) = random.choice(vehicle.typeDescriptor.type.effects['flaming'])
            data['modelMap'] = {}
            for (i, j,) in vehicle.appearance.modelsDesc.iteritems():
                data['modelMap'][i] = vehicle.appearance.modelsDesc[i]['model']

            data['entity_id'] = vehicle.id
            effectListPlayer = EffectsListPlayer(effects, stages, **data)
            data['_effectsPlayer'] = effectListPlayer
            effectListPlayer.play(vehicle.appearance.modelsDesc['hull']['model'], None, None, True)
        data['wasUnderwater'] = isVehicleUnderwater
开发者ID:Infernux,项目名称:Projects,代码行数:18,代码来源:vehicle_extras.py

示例7: __playEffect

 def __playEffect(self, kind, *modifs):
     self.__stopEffects()
     if kind == 'empty' or self.__vehicle is None:
         return
     else:
         enableDecal = True
         if not self.__isPillbox and kind in ('explosion', 'destruction'):
             filter = self.__vehicle.filter
             isFlying = filter.numLeftTrackContacts < 2 and filter.numRightTrackContacts < 2
             if isFlying:
                 enableDecal = False
         if self.isUnderwater:
             if kind not in ('submersionDeath',):
                 return
         effects = self.typeDescriptor.type.effects[kind]
         if not effects:
             return
         vehicle = self.__vehicle
         effects = random.choice(effects)
         self.__effectsPlayer = EffectsListPlayer(effects[1], effects[0], showShockWave=vehicle.isPlayerVehicle, showFlashBang=vehicle.isPlayerVehicle, isPlayer=vehicle.isPlayerVehicle, showDecal=enableDecal, start=vehicle.position + Math.Vector3(0.0, -1.0, 0.0), end=vehicle.position + Math.Vector3(0.0, 1.0, 0.0), entity_id=vehicle.id)
         self.__effectsPlayer.play(self.__compoundModel, *modifs)
         return
开发者ID:aevitas,项目名称:wotsdk,代码行数:22,代码来源:vehicle_systemscompoundappearance.py

示例8: addNew

 def addNew(self, matProv, effectsList, keyPoints, **args):
     desc = EffectsListPlayer(effectsList, keyPoints, position=(self.__nodeName, matProv), **args)
     desc.play(self.__model, None, partial(self._effects.remove, desc))
     self._effects.append(desc)
开发者ID:wotmods,项目名称:WOTDecompiled,代码行数:4,代码来源:bound_effects.py

示例9: _CTFResourcePointModel

class _CTFResourcePointModel():

    def __init__(self, pointModelName, effectsSectionName):
        self.__modelFile = None
        self.__model = None
        self.__effectsTimeLine = None
        self.__effectsPlayer = None
        self.__loadTask = None
        self.__hideListener = None
        g_ctfManager.registerResourcePointModel(self)
        modelParams = _g_ctfConfig.readModelParams(pointModelName)
        if modelParams is not None:
            self.__modelFile = modelParams.get('file')
        if self.__modelFile is None:
            LOG_ERROR('%s: can\'t find the "%s" model.' % (_g_ctfConfig.name, pointModelName))
        effectsSection = _g_ctfConfig.readFirstLvlSection(effectsSectionName)
        if effectsSection is not None:
            self.__effectsTimeLine = effectsFromSection(effectsSection)
        return

    def __del__(self):
        self.__hideListener = None
        if self.__loadTask is not None:
            _g_resLoader.stopLoadTask(self.__loadTask)
            self.__loadTask = None
        g_ctfManager.unregisterResourcePointModel(self)
        if self.__effectsPlayer is not None:
            self.stopEffect()
            self.__effectsPlayer = None
        self.__effectsTimeLine = None
        if self.__model is not None:
            BigWorld.delModel(self.__model)
            self.__model = None
        self.__modelFile = None
        return

    def _createPoint(self):
        if g_ctfManager.isNeedHideAll:
            return
        else:
            raise self.__modelFile is not None or AssertionError
            self.__loadTask = _g_resLoader.startLoadTask((self.__modelFile,), self.__onModelLoaded)
            return

    def __onModelLoaded(self, resourceRefs):
        if resourceRefs.failedIDs:
            LOG_ERROR('Failed to load model %s' % (resourceRefs.failedIDs,))
        else:
            model = resourceRefs[self.__modelFile]
            if not model is not None:
                raise AssertionError
                model.position = self.position
                roll, pitch, yaw = self.direction
                model.rotate(roll, (0.0, 0.0, 1.0))
                model.rotate(pitch, (1.0, 0.0, 0.0))
                model.rotate(yaw, (0.0, 1.0, 0.0))
                BigWorld.addModel(model, BigWorld.player().spaceID)
                BigWorld.wg_applyOverlayToModel(model, False)
                self.__model = model
                g_ctfManager.updateRegisteredResourcePointModel(self)
                g_ctfManager.isNeedHideAll and self.__hideResPointFlag()
            else:
                self.__hideListener = _GlobalHideListener(self.__hideResPointFlag)
        return

    def __hideResPointFlag(self):
        if self.__model is not None:
            self.__model.visible = False
        self.stopEffect()
        return

    def playEffect(self):
        if self.__effectsPlayer is not None:
            return
        elif self.__model is None:
            return
        else:
            if self.__effectsTimeLine is not None:
                self.__effectsPlayer = EffectsListPlayer(self.__effectsTimeLine.effectsList, self.__effectsTimeLine.keyPoints)
                self.__effectsPlayer.play(self.__model)
            return

    def stopEffect(self):
        if self.__effectsPlayer is None:
            return
        else:
            self.__effectsPlayer.stop()
            self.__effectsPlayer = None
            return
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:89,代码来源:ctfmanager.py

示例10: CompoundAppearance


#.........这里部分代码省略.........
        node = self.compoundModel.node(TankPartNames.GUN)
        hkm = BigWorld.wg_createHKAttachment(node, vDesc.gun['hitTester'].getBspModel())
        if hkm is not None:
            node.attach(hkm)
        return

    def __reattachComponents(self, model):
        self.__boundEffects.reattachTo(model)
        if self.__effectsPlayer is not None:
            self.__effectsPlayer.reattachTo(model)
        if self.engineAudition is not None:
            self.engineAudition.attachToModel(model)
        return

    def __playEffect(self, kind, *modifs):
        self.__stopEffects()
        if kind == 'empty' or self.__vehicle is None:
            return
        else:
            enableDecal = True
            if not self.__isPillbox and kind in ('explosion', 'destruction'):
                filter = self.__vehicle.filter
                isFlying = filter.numLeftTrackContacts < 2 and filter.numRightTrackContacts < 2
                if isFlying:
                    enableDecal = False
            if self.isUnderwater:
                if kind not in ('submersionDeath',):
                    return
            effects = self.typeDescriptor.type.effects[kind]
            if not effects:
                return
            vehicle = self.__vehicle
            effects = random.choice(effects)
            self.__effectsPlayer = EffectsListPlayer(effects[1], effects[0], showShockWave=vehicle.isPlayerVehicle, showFlashBang=vehicle.isPlayerVehicle, isPlayer=vehicle.isPlayerVehicle, showDecal=enableDecal, start=vehicle.position + Math.Vector3(0.0, -1.0, 0.0), end=vehicle.position + Math.Vector3(0.0, 1.0, 0.0), entity_id=vehicle.id)
            self.__effectsPlayer.play(self.__compoundModel, *modifs)
            return

    __SPORT_ACTIONS_CAMOUFLAGES = {'ussr:T62A_sport': (95, 94),
     'usa:M24_Chaffee_GT': (82, 83)}

    def __getCamouflageParams(self, vDesc, vID):
        vehicleInfo = BigWorld.player().arena.vehicles.get(vID)
        if vehicleInfo is not None:
            camouflageIdPerTeam = VehicleAppearance.SPORT_ACTIONS_CAMOUFLAGES.get(vDesc.name)
            if camouflageIdPerTeam is not None:
                camouflageId = camouflageIdPerTeam[0] if vehicleInfo['team'] == 1 else camouflageIdPerTeam[1]
                return (camouflageId, time.time(), 100.0)
            camouflagePseudoname = vehicleInfo['events'].get('hunting', None)
            if camouflagePseudoname is not None:
                camouflIdsByNation = {0: {'black': 29,
                     'gold': 30,
                     'red': 31,
                     'silver': 32},
                 1: {'black': 25,
                     'gold': 26,
                     'red': 27,
                     'silver': 28},
                 2: {'black': 52,
                     'gold': 50,
                     'red': 51,
                     'silver': 53},
                 3: {'black': 48,
                     'gold': 46,
                     'red': 47,
                     'silver': 49},
                 4: {'black': 60,
开发者ID:aevitas,项目名称:wotsdk,代码行数:67,代码来源:vehicle_systemscompoundappearance.py

示例11: __playStateEffect

 def __playStateEffect(self, startKeyPoint = SpecialKeyPointNames.START):
     self.__stopStateEffects()
     effectName = _TurretDetachmentEffects.__EFFECT_NAMES[self.__state]
     stages, effectsList, _ = self.__detachmentEffectsDesc[effectName]
     self.__stateEffectListPlayer = EffectsListPlayer(effectsList, stages)
     self.__stateEffectListPlayer.play(self.__turretModel, startKeyPoint)
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:6,代码来源:detachedturret.py

示例12: __playPullEffect

 def __playPullEffect(self, effectMaterialIdx):
     self.__stopPullEffects()
     stages, effectsList, _ = self.__detachmentEffectsDesc['pull'][effectMaterialIdx]
     self.__pullEffectListPlayer = EffectsListPlayer(effectsList, stages)
     self.__pullEffectListPlayer.play(self.__turretModel, SpecialKeyPointNames.START)
     self.__pullEffectListPlayer.effectMaterialIdx = effectMaterialIdx
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:6,代码来源:detachedturret.py

示例13: _TurretDetachmentEffects

class _TurretDetachmentEffects(object):

    class State:
        FLYING = 0
        ON_GROUND = 1

    __EFFECT_NAMES = {State.FLYING: 'flight',
     State.ON_GROUND: 'flamingOnGround'}
    _MAX_COLLISION_ENERGY = 98.10000000000001
    _MIN_COLLISION_ENERGY = _MIN_COLLISION_SPEED ** 2 * 0.5
    _MIN_NORMALIZED_ENERGY = 0.1
    _DROP_ENERGY_PARAM = 'RTPC_ext_drop_energy'

    def __init__(self, turretModel, detachmentEffectsDesc, onGround):
        self.__turretModel = turretModel
        self.__detachmentEffectsDesc = detachmentEffectsDesc
        self.__stateEffectListPlayer = None
        self.__pullEffectListPlayer = None
        startKeyPoint = SpecialKeyPointNames.START
        if onGround:
            self.__state = self.State.ON_GROUND
            startKeyPoint = SpecialKeyPointNames.STATIC
        else:
            self.__state = self.State.FLYING
        self.__playStateEffect(startKeyPoint)
        return

    def destroy(self):
        self.stopEffects()

    def __stopStateEffects(self):
        if self.__stateEffectListPlayer is not None:
            self.__stateEffectListPlayer.stop()
            self.__stateEffectListPlayer = None
        return

    def __stopPullEffects(self):
        if self.__pullEffectListPlayer is not None:
            self.__pullEffectListPlayer.stop()
            self.__pullEffectListPlayer = None
        return

    def stopEffects(self):
        self.__stopStateEffects()
        self.__stopPullEffects()

    def notifyAboutCollision(self, energy, collisionPoint, effectMaterialIdx, groundEffect, underWater):
        if groundEffect:
            stages, effectsList, _ = self.__detachmentEffectsDesc['collision'][effectMaterialIdx]
            normalizedEnergy = self.__normalizeEnergy(energy)
            dropEnergyParam = SoundStartParam(_TurretDetachmentEffects._DROP_ENERGY_PARAM, normalizedEnergy)
            BigWorld.player().terrainEffects.addNew(collisionPoint, effectsList, stages, None, soundParams=(dropEnergyParam,))
        if self.__state != self.State.ON_GROUND:
            self.__state = self.State.ON_GROUND
            if not underWater:
                self.__playStateEffect()
        return

    def notifyAboutBeingPulled(self, isPulled, effectMaterialIdx):
        if isPulled:
            if self.__pullEffectListPlayer is None or self.__pullEffectListPlayer.effectMaterialIdx != effectMaterialIdx:
                self.__playPullEffect(effectMaterialIdx)
        else:
            self.__stopPullEffects()
        return

    def __playPullEffect(self, effectMaterialIdx):
        self.__stopPullEffects()
        stages, effectsList, _ = self.__detachmentEffectsDesc['pull'][effectMaterialIdx]
        self.__pullEffectListPlayer = EffectsListPlayer(effectsList, stages)
        self.__pullEffectListPlayer.play(self.__turretModel, SpecialKeyPointNames.START)
        self.__pullEffectListPlayer.effectMaterialIdx = effectMaterialIdx

    def __playStateEffect(self, startKeyPoint = SpecialKeyPointNames.START):
        self.__stopStateEffects()
        effectName = _TurretDetachmentEffects.__EFFECT_NAMES[self.__state]
        stages, effectsList, _ = self.__detachmentEffectsDesc[effectName]
        self.__stateEffectListPlayer = EffectsListPlayer(effectsList, stages)
        self.__stateEffectListPlayer.play(self.__turretModel, startKeyPoint)

    def __normalizeEnergy(self, energy):
        minBound, maxBound = _TurretDetachmentEffects._MIN_COLLISION_ENERGY, _TurretDetachmentEffects._MAX_COLLISION_ENERGY
        clampedEnergy = mathUtils.clamp(minBound, maxBound, energy)
        t = (clampedEnergy - minBound) / (maxBound - minBound)
        return mathUtils.lerp(_TurretDetachmentEffects._MIN_NORMALIZED_ENERGY, 1.0, t)
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:85,代码来源:detachedturret.py


注:本文中的helpers.EffectsList.EffectsListPlayer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。