本文整理汇总了Python中AvatarInputHandler.AimingSystems.IAimingSystem.enable方法的典型用法代码示例。如果您正苦于以下问题:Python IAimingSystem.enable方法的具体用法?Python IAimingSystem.enable怎么用?Python IAimingSystem.enable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvatarInputHandler.AimingSystems.IAimingSystem
的用法示例。
在下文中一共展示了IAimingSystem.enable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enable
# 需要导入模块: from AvatarInputHandler.AimingSystems import IAimingSystem [as 别名]
# 或者: from AvatarInputHandler.AimingSystems.IAimingSystem import enable [as 别名]
def enable(self, targetPos):
player = BigWorld.player()
self.__vehicleTypeDescriptor = player.vehicleTypeDescriptor
self.__vehicleMProv = player.getOwnVehicleStabilisedMatrix()
self.__vehiclePrevMat = Matrix(self.__vehicleMProv)
IAimingSystem.enable(self, targetPos)
self.__yawLimits = self.__vehicleTypeDescriptor.gun['turretYawLimits']
self.__pitchLimits = self.__vehicleTypeDescriptor.gun['pitchLimits']
self.__idealYaw, self.__idealPitch = AimingSystems.getTurretYawGunPitch(self.__vehicleTypeDescriptor, self.__vehicleMProv, targetPos, True)
self.__idealYaw, self.__idealPitch = self.__clampToLimits(self.__idealYaw, self.__idealPitch)
currentGunMat = AimingSystems.getPlayerGunMat(self.__idealYaw, self.__idealPitch)
self.__g_curYaw = currentGunMat.yaw
self.__g_curPitch = (targetPos - currentGunMat.translation).pitch
self._matrix.set(currentGunMat)
self.__idealYaw, self.__idealPitch = self.__worldYawPitchToTurret(self.__g_curYaw, self.__g_curPitch)
self.__idealYaw, self.__idealPitch = self.__clampToLimits(self.__idealYaw, self.__idealPitch)
self.__oscillator.reset()
self.__pitchfilter.reset(currentGunMat.pitch)
SniperAimingSystem.__activeSystem = self
vehicle = player.getVehicleAttached()
if vehicle is not None:
if not vehicle.filter.placingOnGround:
vehicle.filter.calcPlacedMatrix(True)
self.__baseMatrix = vehicle.filter.placingMatrix
else:
self.__baseMatrix = vehicle.matrix
return
示例2: enable
# 需要导入模块: from AvatarInputHandler.AimingSystems import IAimingSystem [as 别名]
# 或者: from AvatarInputHandler.AimingSystems.IAimingSystem import enable [as 别名]
def enable(self, targetPos):
player = BigWorld.player()
self.__vehicleTypeDescriptor = player.vehicleTypeDescriptor
self.__vehicleMProv = player.getOwnVehicleMatrix()
self.__vehiclePrevMat = Matrix(self.__vehicleMProv)
IAimingSystem.enable(self, targetPos)
self.__yawLimits = self.__vehicleTypeDescriptor.gun['turretYawLimits']
self.__pitchLimits = self.__vehicleTypeDescriptor.gun['pitchLimits']
self.__idealTurretYaw, self.__idealGunPitch = AimingSystems.getTurretYawGunPitch(self.__vehicleTypeDescriptor, player.getOwnVehicleMatrix(), targetPos, True)
self.__idealTurretYaw, self.__idealGunPitch = self.__clampToLimits(self.__idealTurretYaw, self.__idealGunPitch)
currentGunMat = AimingSystems.getPlayerGunMat(self.__idealTurretYaw, self.__idealGunPitch)
self.__worldYaw = currentGunMat.yaw
self.__worldPitch = (targetPos - currentGunMat.translation).pitch
self._matrix.set(currentGunMat)
self.__idealTurretYaw, self.__idealGunPitch = self.__worldYawPitchToTurret(self.__worldYaw, self.__worldPitch)
self.__idealTurretYaw, self.__idealGunPitch = self.__clampToLimits(self.__idealTurretYaw, self.__idealGunPitch)
self.__oscillator.reset()
SniperAimingSystem.__activeSystem = self
示例3: enable
# 需要导入模块: from AvatarInputHandler.AimingSystems import IAimingSystem [as 别名]
# 或者: from AvatarInputHandler.AimingSystems.IAimingSystem import enable [as 别名]
def enable(self, targetPos):
player = BigWorld.player()
self.__vehicleTypeDescriptor = player.vehicleTypeDescriptor
self.__vehicleMProv = player.getOwnVehicleMatrix()
self.__vehiclePrevMat = Matrix(self.__vehicleMProv)
IAimingSystem.enable(self, targetPos)
player = BigWorld.player()
desc = player.vehicleTypeDescriptor
self.__yawLimits = desc.gun['turretYawLimits']
self.__idealTurretYaw, self.__idealGunPitch = getShotAngles(desc, player.getOwnVehicleMatrix(), (0, 0), targetPos, False)
self.__idealTurretYaw, self.__idealGunPitch = self.__clampToLimits(self.__idealTurretYaw, self.__idealGunPitch)
currentGunMat = AimingSystems.getPlayerGunMat(self.__idealTurretYaw, self.__idealGunPitch)
self.__worldYaw = currentGunMat.yaw
self.__worldPitch = (targetPos - currentGunMat.translation).pitch
self._matrix.set(currentGunMat)
self.__idealTurretYaw, self.__idealGunPitch = self.__worldYawPitchToTurret(self.__worldYaw, self.__worldPitch)
self.__idealTurretYaw, self.__idealGunPitch = self.__clampToLimits(self.__idealTurretYaw, self.__idealGunPitch)
self.__oscillator.reset()