本文整理汇总了Python中AvatarInputHandler.AimingSystems.IAimingSystem类的典型用法代码示例。如果您正苦于以下问题:Python IAimingSystem类的具体用法?Python IAimingSystem怎么用?Python IAimingSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IAimingSystem类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enable
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: __init__
def __init__(self, vehicleMProv, heightAboveTarget, focusRadius, aimMatrix, anglesRange, enableSmartShotPointCalc = True):
IAimingSystem.__init__(self)
self.__aimMatrix = aimMatrix
self.__vehicleMProv = vehicleMProv
self.__anglesRange = anglesRange
self.__cursor = BigWorld.ThirdPersonProvider()
self.__cursor.base = vehicleMProv
self.__cursor.heightAboveBase = heightAboveTarget
self.__cursor.focusRadius = focusRadius
self.__shotPointCalculator = ShotPointCalculatorPlanar() if enableSmartShotPointCalc else None
示例3: __init__
def __init__(self):
IAimingSystem.__init__(self)
self.__idealTurretYaw = 0.0
self.__idealGunPitch = 0.0
self.__worldYaw = 0.0
self.__worldPitch = 0.0
self.__vehicleTypeDescriptor = None
self.__vehicleMProv = None
self.__vehiclePrevMat = None
self.__yprDeviationConstraints = Vector3(math.pi * 2.1, math.pi / 2 * 0.95, 0.0)
self.__oscillator = Oscillator(1.0, Vector3(0.0, 0.0, 15.0), Vector3(0.0, 0.0, 3.5), self.__yprDeviationConstraints)
示例4: __init__
def __init__(self, dataSec):
IAimingSystem.__init__(self)
self.__idealYaw = 0.0
self.__idealPitch = 0.0
self.__g_curPitch = 0.0
self.__g_curYaw = 0.0
self.__vehicleTypeDescriptor = None
self.__vehicleMProv = None
self.__vehiclePrevMat = None
self.__yprDeviationConstraints = Vector3(math.pi * 2.1, math.pi / 2.0 * 0.95, 0.0)
self.__oscillator = Oscillator(1.0, Vector3(0.0, 0.0, 15.0), Vector3(0.0, 0.0, 3.5), self.__yprDeviationConstraints)
self.__dInputPitch = 0.0
self.__dInputYaw = 0.0
self.__pitchfilter = InputFilter()
self.reloadConfig(dataSec)
示例5: enable
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
示例6: enable
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()
示例7: destroy
def destroy(self):
IAimingSystem.destroy(self)
示例8: destroy
def destroy(self):
IAimingSystem.destroy(self)
SniperAimingSystem.__activeSystem = None
return