本文整理汇总了Python中helpers.EffectsList.EffectsListPlayer.play方法的典型用法代码示例。如果您正苦于以下问题:Python EffectsListPlayer.play方法的具体用法?Python EffectsListPlayer.play怎么用?Python EffectsListPlayer.play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.EffectsList.EffectsListPlayer
的用法示例。
在下文中一共展示了EffectsListPlayer.play方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addNewToNode
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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
示例2: _start
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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
示例3: checkUnderwater
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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
示例4: _start
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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)
示例5: checkUnderwater
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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
示例6: addNew
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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)
示例7: _CTFResourcePointModel
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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
示例8: CompoundAppearance
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
#.........这里部分代码省略.........
for tgDesc in (typeDescriptor.turret, typeDescriptor.gun):
exclMask = tgDesc.get('camouflageExclusionMask')
if exclMask is not None and exclMask != '':
out.append(exclMask)
self.__vID = vID
self.__typeDesc = typeDescriptor
self.__isTurretDetached = isTurretDetached
return out
def setVehicle(self, vehicle):
self.__vehicle = vehicle
if self.__customEffectManager is not None:
self.__customEffectManager.setVehicle(vehicle)
if self.__crashedTracksCtrl is not None:
self.__crashedTracksCtrl.setVehicle(vehicle)
self.highlighter.setVehicle(vehicle)
return
def activate(self):
if self.__activated or self.__vehicle is None:
return
else:
if self.__currentDamageState.isCurrentModelDamaged:
if self.__customEffectManager is not None:
self.__customEffectManager.destroy()
self.__customEffectManager = None
if self.detailedEngineState is not None:
self.detailedEngineState.destroy()
self.detailedEngineState = None
super(CompoundAppearance, self).activate()
isPlayerVehicle = self.__vehicle.isPlayerVehicle
isObserver = 'observer' in self.__typeDesc.type.tags
player = BigWorld.player()
self.__originalFilter = self.__vehicle.filter
self.__createFilter()
self.__vehicle.filter = self.__filter
self.__vehicle.filter.enableNewPhysics(True)
self.__vehicle.filter.enableStabilisedMatrix(isPlayerVehicle)
self.__filter.isStrafing = self.__vehicle.isStrafing
self.__filter.vehicleCollisionCallback = player.handleVehicleCollidedVehicle
self.__compoundModel.isHighPriorityReflection = isPlayerVehicle
self.__vehicleMatrixProv = self.__compoundModel.matrix
if isPlayerVehicle:
if player.inputHandler is not None:
player.inputHandler.addVehicleToCameraCollider(self.__vehicle)
BigWorld.setSpeedTreeCollisionBody(self.__compoundModel.getBoundsForPart(TankPartIndexes.HULL))
self.__linkCompound()
self.__chassisShadowForwardDecal.attach(self.__typeDesc, self.__compoundModel)
if not isObserver:
self.__chassisOcclusionDecal.attach(self.__typeDesc, self.__compoundModel)
self.__createStickers()
if self.__currentDamageState.isCurrentModelDamaged:
self.__attachStickers(items.vehicles.g_cache.commonConfig['miscParams']['damageStickerAlpha'], True)
else:
self.__startSystems()
self.__attachStickers()
self.setupGunMatrixTargets()
if not isObserver:
self.__vehicle.filter.enableLagDetection(True)
self.onModelChanged()
if self.lodCalculator is not None:
self.lodCalculator.setupPosition(DataLinks.linkMatrixTranslation(self.__compoundModel.matrix))
if hasattr(self.filter, 'placingCompensationMatrix') and self.swingingAnimator is not None:
self.swingingAnimator.placingCompensationMatrix = self.filter.placingCompensationMatrix
self.swingingAnimator.worldMatrix = self.__compoundModel.matrix
示例9: _TurretDetachmentEffects
# 需要导入模块: from helpers.EffectsList import EffectsListPlayer [as 别名]
# 或者: from helpers.EffectsList.EffectsListPlayer import play [as 别名]
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)