def __calcAimOffset(self, oscillationsZoomMultiplier):
     fov = BigWorld.projection().fov
     aspect = cameras.getScreenAspectRatio()
     yTan = math.tan(fov * 0.5)
     xTan = yTan * aspect
     defaultX = self.__defaultAimOffset[0]
     defaultY = self.__defaultAimOffset[1]
     yawFromImpulse = self.__impulseOscillator.deviation.x * self.__dynamicCfg['sideImpulseToYawRatio']
     xImpulseDeviationTan = math.tan(-(yawFromImpulse + self.__noiseOscillator.deviation.x) * oscillationsZoomMultiplier)
     pitchFromImpulse = self.__impulseOscillator.deviation.z * self.__dynamicCfg['frontImpulseToPitchRatio']
     yImpulseDeviationTan = math.tan((pitchFromImpulse + self.__noiseOscillator.deviation.y) * oscillationsZoomMultiplier)
     totalOffset = Vector2((defaultX * xTan + xImpulseDeviationTan) / (xTan * (1 - defaultX * xTan * xImpulseDeviationTan)), (defaultY * yTan + yImpulseDeviationTan) / (yTan * (1 - defaultY * yTan * yImpulseDeviationTan)))
     return totalOffset
Exemple #2
0
 def __calcAimOffset(self, oscillationsZoomMultiplier):
     fov = BigWorld.projection().fov
     aspect = cameras.getScreenAspectRatio()
     yTan = math.tan(fov * 0.5)
     xTan = yTan * aspect
     defaultX = self.__defaultAimOffset[0]
     defaultY = self.__defaultAimOffset[1]
     yawFromImpulse = self.__impulseOscillator.deviation.x * self.__dynamicCfg['sideImpulseToYawRatio']
     xImpulseDeviationTan = math.tan(-(yawFromImpulse + self.__noiseOscillator.deviation.x) * oscillationsZoomMultiplier)
     pitchFromImpulse = self.__impulseOscillator.deviation.z * self.__dynamicCfg['frontImpulseToPitchRatio']
     yImpulseDeviationTan = math.tan((pitchFromImpulse + self.__noiseOscillator.deviation.y) * oscillationsZoomMultiplier)
     totalOffset = Vector2((defaultX * xTan + xImpulseDeviationTan) / (xTan * (1 - defaultX * xTan * xImpulseDeviationTan)), (defaultY * yTan + yImpulseDeviationTan) / (yTan * (1 - defaultY * yTan * yImpulseDeviationTan)))
     return totalOffset