本文整理汇总了Python中Math.Matrix.setScale方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.setScale方法的具体用法?Python Matrix.setScale怎么用?Python Matrix.setScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Math.Matrix
的用法示例。
在下文中一共展示了Matrix.setScale方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __addEntryLit
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def __addEntryLit(self, id, matrix, visible = True):
battleCtx = g_sessionProvider.getCtx()
if battleCtx.isObserver(id):
return
if matrix is None:
return
mp = Math.WGReplayAwaredSmoothTranslationOnlyMP()
mp.source = matrix
scaledMatrix = None
if self.__markerScale is not None:
scaleMatrix = Matrix()
scaleMatrix.setScale(Vector3(self.__markerScale, self.__markerScale, self.__markerScale))
scaledMatrix = mathUtils.MatrixProviders.product(scaleMatrix, mp)
if scaledMatrix is None:
handle = self.__ownUI.addEntry(mp, self.zIndexManager.getVehicleIndex(id))
else:
handle = self.__ownUI.addEntry(scaledMatrix, self.zIndexManager.getVehicleIndex(id))
entry = {'matrix': mp,
'handle': handle}
arena = BigWorld.player().arena
entryVehicle = arena.vehicles[id]
entityName = battleCtx.getPlayerEntityName(id, entryVehicle.get('team'))
markerType = entityName.base
entryName = entityName.name()
self.__entrieLits[id] = entry
vName = entryVehicle['vehicleType'].type.shortUserString
self.__ownUI.entryInvoke(entry['handle'], ('init', [markerType,
entryName,
'lastLit',
'',
vName]))
if not visible:
self.__ownUI.entryInvoke(entry['handle'], ('setVisible', [visible]))
if self.__markerScale is None:
self.__parentUI.call('minimap.entryInited', [])
示例2: __addDeadEntry
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def __addDeadEntry(self, entry, id):
"""
adding death animation to minimap (WOTD-5884)
"""
if id in BigWorld.entities.keys():
m = self.__getEntryMatrixByLocation(id, entry['location'])
scaledMatrix = None
if self.__markerScale is not None:
scaleMatrix = Matrix()
scaleMatrix.setScale(Vector3(self.__markerScale, self.__markerScale, self.__markerScale))
scaledMatrix = mathUtils.MatrixProviders.product(scaleMatrix, m)
if scaledMatrix is None:
entry['handle'] = self.__ownUI.addEntry(m, self.zIndexManager.getDeadVehicleIndex(id))
else:
entry['handle'] = self.__ownUI.addEntry(scaledMatrix, self.zIndexManager.getVehicleIndex(id))
self.__entries[id] = entry
if not GUI_SETTINGS.permanentMinimapDeath:
self.__deadCallbacks[id] = BigWorld.callback(GUI_SETTINGS.minimapDeathDuration / 1000, partial(self.__delEntry, id))
self.__callEntryFlash(id, 'setDead', [GUI_SETTINGS.permanentMinimapDeath])
self.__callEntryFlash(id, 'init', [entry['markerType'],
entry['entryName'],
entry['vClass'],
''])
if self.__markerScale is None:
self.__parentUI.call('minimap.entryInited', [])
示例3: __addEntryMarker
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def __addEntryMarker(self, marker, matrix):
if matrix is None:
return
else:
mp = Math.WGReplayAwaredSmoothTranslationOnlyMP()
mp.source = matrix
scaledMatrix = None
if self.__markerScale is not None:
scaleMatrix = Matrix()
scaleMatrix.setScale(Vector3(self.__markerScale, self.__markerScale, self.__markerScale))
scaledMatrix = mathUtils.MatrixProviders.product(scaleMatrix, mp)
zIndex = self.zIndexManager.getMarkerIndex(marker)
if scaledMatrix is None:
handle = self.__ownUI.addEntry(mp, zIndex)
else:
handle = self.__ownUI.addEntry(scaledMatrix, zIndex)
entry = {'matrix': mp,
'handle': handle}
self.__entrieMarkers[marker] = entry
self.__ownUI.entryInvoke(entry['handle'], ('init', ['fortConsumables',
marker,
'',
'',
'empty']))
if self.__markerScale is None:
self.__parentUI.call('minimap.entryInited', [])
return handle
示例4: scaleMarker
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def scaleMarker(self, handle, originalMatrix, scale):
if handle is not None and originalMatrix is not None:
scaleMatrix = Matrix()
scaleMatrix.setScale(Vector3(scale, scale, scale))
mp = mathUtils.MatrixProviders.product(scaleMatrix, originalMatrix)
self.__ownUI.entrySetMatrix(handle, mp)
return
示例5: createSRTMatrix
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def createSRTMatrix(scale, rotation, translation):
scaleMatrix = Matrix()
scaleMatrix.setScale(scale)
result = Matrix()
result.setRotateYPR(rotation)
result.translation = translation
result.preMultiply(scaleMatrix)
return result
示例6: plasmaExplode
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def plasmaExplode(owner, targetModel, delTargetModel):
m = BigWorld.Model('objects/models/fx/03_pchangs/shockwave.model')
targetModel.root.attach(m)
m.Go()
BigWorld.callback(1.0, partial(targetModel.root.detach, m))
m = targetModel.root
m2 = Matrix()
m2.setScale((5, 5, 5))
m2.postMultiply(m)
v1 = Vector4(1.0, 100000, 0, 0)
v2 = Vector4(0.0, 0, 0, 0)
v = Vector4Animation()
v.keyframes = [(0, v1), (0.5, v2)]
v.duration = 1
v.time = 0
try:
BigWorld.addWarp(0.5, m2, v)
except:
pass
shake(targetModel)
ps2 = Pixie.create('particles/plasma_blow.xml')
targetModel.root.attach(ps2)
ps2.system(0).actions[0].force(1)
BigWorld.callback(5.0, partial(targetModel.root.detach, ps2))
if delTargetModel:
BigWorld.callback(5.0, partial(owner.delModel, targetModel))
if BigWorld.player().flashBangCount == 0:
fba = Vector4Animation()
fba.keyframes = [(0, Vector4(0, 0, 0, 0)), (0.1, Vector4(0.1, 0.1, 0.2, 0.5)), (0.3, Vector4(0, 0, 0, 0))]
fba.duration = 0.3
try:
BigWorld.flashBangAnimation(fba)
except:
pass
BigWorld.callback(fba.duration, partial(BigWorld.flashBangAnimation, None))
return
示例7: __addEntry
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import setScale [as 别名]
def __addEntry(self, id, location, doMark):
battleCtx = g_sessionProvider.getCtx()
if battleCtx.isObserver(id):
return
arena = BigWorld.player().arena
entry = dict()
m = self.__getEntryMatrixByLocation(id, location)
scaledMatrix = None
if self.__markerScale is not None:
scaleMatrix = Matrix()
scaleMatrix.setScale(Vector3(self.__markerScale, self.__markerScale, self.__markerScale))
scaledMatrix = mathUtils.MatrixProviders.product(scaleMatrix, m)
if location == VehicleLocation.AOI_TO_FAR:
self.__aoiToFarCallbacks[id] = BigWorld.callback(self.__AOI_TO_FAR_TIME, partial(self.__delEntry, id))
entry['location'] = location
entry['matrix'] = m
if scaledMatrix is None:
entry['handle'] = self.__ownUI.addEntry(m, self.zIndexManager.getVehicleIndex(id))
else:
entry['handle'] = self.__ownUI.addEntry(scaledMatrix, self.zIndexManager.getVehicleIndex(id))
self.__entries[id] = entry
entryVehicle = arena.vehicles[id]
entityName = battleCtx.getPlayerEntityName(id, entryVehicle.get('team'))
markerType = entityName.base
entryName = entityName.name()
markMarker = ''
if not entityName.isFriend:
if doMark:
if 'SPG' in entryVehicle['vehicleType'].type.tags:
if not self.__isFirstEnemySPGMarkedById.has_key(id):
self.__isFirstEnemySPGMarkedById[id] = False
isFirstEnemySPGMarked = self.__isFirstEnemySPGMarkedById[id]
if not isFirstEnemySPGMarked:
markMarker = 'enemySPG'
self.__isFirstEnemySPGMarkedById[id] = True
self.__resetSPGMarkerTimoutCbckId = BigWorld.callback(5, partial(self.__resetSPGMarkerCallback, id))
elif not self.__isFirstEnemyNonSPGMarked and markMarker == '':
if not len(self.__enemyEntries):
markMarker = 'firstEnemy'
self.__isFirstEnemyNonSPGMarked = True
if markMarker != '':
BigWorld.player().soundNotifications.play('enemy_sighted_for_team')
self.__enemyEntries[id] = entry
if entryVehicle['vehicleType'] is not None:
tags = set(entryVehicle['vehicleType'].type.tags & VEHICLE_CLASS_TAGS)
else:
LOG_ERROR('Try to show minimap marker without vehicle info.')
return
vClass = tags.pop() if len(tags) > 0 else ''
if GUI_SETTINGS.showMinimapSuperHeavy and entryVehicle['vehicleType'].type.level == 10 and vClass == 'heavyTank':
vClass = 'super' + vClass
vName = entryVehicle['vehicleType'].type.shortUserString
self.__callEntryFlash(id, 'init', [markerType,
entryName,
vClass,
markMarker,
vName])
entry['markerType'] = markerType
entry['entryName'] = entryName
entry['vClass'] = vClass
if self.__markerScale is None:
self.__parentUI.call('minimap.entryInited', [])