本文整理汇总了Python中Math.Matrix.postMultiply方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.postMultiply方法的具体用法?Python Matrix.postMultiply怎么用?Python Matrix.postMultiply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Math.Matrix
的用法示例。
在下文中一共展示了Matrix.postMultiply方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __calcAimOffset
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import postMultiply [as 别名]
def __calcAimOffset(self, aimLocalTransform = None):
worldCrosshair = Matrix(self.__crosshairMatrix)
aimingSystemMatrix = self.__aimingSystem.matrix
if aimLocalTransform is not None:
worldCrosshair.postMultiply(aimLocalTransform)
worldCrosshair.postMultiply(aimingSystemMatrix)
aimOffset = cameras.projectPoint(worldCrosshair.translation)
return Vector2(mathUtils.clamp(-0.95, 0.95, aimOffset.x), mathUtils.clamp(-0.95, 0.95, aimOffset.y))
示例2: __switchBind
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import postMultiply [as 别名]
def __switchBind(self):
if self.__basisMProv.isBound:
self.__basisMProv.bind(None)
else:
self.__basisMProv.bind(*self.__entityPicker.pick())
localMat = Matrix(self.__cam.invViewMatrix)
basisInv = Matrix(self.__basisMProv.matrix)
basisInv.invert()
localMat.postMultiply(basisInv)
self.__position = localMat.translation
self.__ypr.set(localMat.yaw, localMat.pitch, localMat.roll)
示例3: __cameraUpdate
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import postMultiply [as 别名]
def __cameraUpdate(self, allowModeChange = True):
curTime = BigWorld.time()
deltaTime = curTime - self.__prevTime
self.__prevTime = curTime
if not self.__autoUpdateDxDyDz.x == self.__autoUpdateDxDyDz.y == self.__autoUpdateDxDyDz.z == 0.0:
self.__rotateAndZoom(self.__autoUpdateDxDyDz.x, self.__autoUpdateDxDyDz.y, self.__autoUpdateDxDyDz.z)
self.__aimingSystem.update(deltaTime)
localTransform, impulseTransform = self.__updateOscillators(deltaTime)
aimMatrix = cameras.getAimMatrix(*self.__defaultAimOffset)
camMat = Matrix(aimMatrix)
rodMat = mathUtils.createTranslationMatrix(-self.__dynamicCfg['pivotShift'])
antiRodMat = mathUtils.createTranslationMatrix(self.__dynamicCfg['pivotShift'])
camMat.postMultiply(rodMat)
camMat.postMultiply(localTransform)
camMat.postMultiply(antiRodMat)
camMat.postMultiply(self.__aimingSystem.matrix)
camMat.invert()
self.__cam.set(camMat)
replayCtrl = BattleReplay.g_replayCtrl
if replayCtrl.isPlaying and replayCtrl.isControllingCamera:
aimOffset = replayCtrl.getAimClipPosition()
binocularsOffset = aimOffset
else:
aimOffset = self.__calcAimOffset(impulseTransform)
binocularsOffset = self.__calcAimOffset()
if replayCtrl.isRecording:
replayCtrl.setAimClipPosition(aimOffset)
self.__aim.offset(aimOffset)
self.__binoculars.setMaskCenter(binocularsOffset.x, binocularsOffset.y)
player = BigWorld.player()
if allowModeChange and (self.__isPositionUnderwater(self.__aimingSystem.matrix.translation) or player.isGunLocked):
self.__onChangeControlMode(False)
return -1
return 0.0
示例4: __cameraUpdate
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import postMultiply [as 别名]
def __cameraUpdate(self):
curTime = BigWorld.time()
deltaTime = curTime - self.__prevTime
self.__prevTime = curTime
if not self.__autoUpdateDxDyDz.x == self.__autoUpdateDxDyDz.y == self.__autoUpdateDxDyDz.z == 0.0:
self.__rotateAndZoom(self.__autoUpdateDxDyDz.x, self.__autoUpdateDxDyDz.y, self.__autoUpdateDxDyDz.z)
self.__aimingSystem.update(deltaTime)
localTransform, impulseTransform = self.__updateOscillators(deltaTime)
ownVehicle = BigWorld.entity(BigWorld.player().playerVehicleID)
if ownVehicle is not None and ownVehicle.isStarted and ownVehicle.appearance.isUnderwater:
self.__onChangeControlMode()
return 0.0
else:
aimMatrix = cameras.getAimMatrix(*self.__defaultAimOffset)
camMat = Matrix(aimMatrix)
rodMat = mathUtils.createTranslationMatrix(-self.__dynamicCfg['pivotShift'])
antiRodMat = mathUtils.createTranslationMatrix(self.__dynamicCfg['pivotShift'])
camMat.postMultiply(rodMat)
camMat.postMultiply(localTransform)
camMat.postMultiply(antiRodMat)
camMat.postMultiply(self.__aimingSystem.matrix)
camMat.invert()
self.__cam.set(camMat)
replayCtrl = BattleReplay.g_replayCtrl
if replayCtrl.isPlaying and replayCtrl.isControllingCamera:
aimOffset = replayCtrl.getAimClipPosition()
binocularsOffset = aimOffset
else:
aimOffset = self.__calcAimOffset(impulseTransform)
binocularsOffset = self.__calcAimOffset()
if replayCtrl.isRecording:
replayCtrl.setAimClipPosition(aimOffset)
self.__aim.offset((aimOffset.x, aimOffset.y))
self.__binoculars.setMaskCenter(binocularsOffset.x, binocularsOffset.y)
return 0.0
示例5: plasmaExplode
# 需要导入模块: from Math import Matrix [as 别名]
# 或者: from Math.Matrix import postMultiply [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