本文整理汇总了Python中AvatarInputHandler.cameras.FovExtended类的典型用法代码示例。如果您正苦于以下问题:Python FovExtended类的具体用法?Python FovExtended怎么用?Python FovExtended使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FovExtended类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __destroy
def __destroy(self):
LOG_DEBUG('Hangar successfully destroyed.')
MusicControllerWWISE.unloadCustomSounds()
if self.__cam == BigWorld.camera():
self.__cam.spaceID = 0
BigWorld.camera(None)
BigWorld.worldDrawEnabled(False)
self.__cam = None
self.__loadingStatus = 0.0
if self.__vAppearance is not None:
self.__vAppearance.destroy()
self.__vAppearance = None
self.__onLoadedCallback = None
self.__boundingRadius = None
if self.__waitCallback is not None:
BigWorld.cancelCallback(self.__waitCallback)
self.__waitCallback = None
g_keyEventHandlers.remove(self.handleKeyEvent)
g_mouseEventHandlers.remove(self.handleMouseEventGlobal)
BigWorld.SetDrawInflux(False)
MapActivities.g_mapActivities.stop()
if self.__spaceId is not None and BigWorld.isClientSpace(self.__spaceId):
if self.__spaceMappingId is not None:
BigWorld.delSpaceGeometryMapping(self.__spaceId, self.__spaceMappingId)
BigWorld.clearSpace(self.__spaceId)
BigWorld.releaseSpace(self.__spaceId)
self.__spaceMappingId = None
self.__spaceId = None
self.__vEntityId = None
BigWorld.wg_disableSpecialFPSMode()
g_postProcessing.disable()
FovExtended.instance().resetFov()
return
示例2: onEnterWorld
def onEnterWorld(self, prereqs):
if self.isPlayerVehicle:
global yaw, old_yaw, pitch, old_pitch, old_multiplier, dataHor, dataVert, turretYawLimits, scaleHor, scaleVert
global minStep, maxPitch, minPitch, currentStep, minBound, maxBound, screenHeight, screenWidth, player
global old_gunAnglesPacked, isAlive, cameraMode
player = BigWorld.player()
yaw = 0.0
pitch = 0.0
old_multiplier = 1.0
old_gunAnglesPacked = None
old_yaw = None
old_pitch = None
isAlive = self.isAlive
screenHeight = BigWorld.screenHeight()
screenWidth = BigWorld.screenWidth()
currentStep = STEP
verticalFov = FovExtended.instance().actualDefaultVerticalFov
horizontalFov = FovExtended.calcHorizontalFov(verticalFov)
scaleHor = screenWidth / horizontalFov if horizontalFov else screenWidth
scaleVert = screenHeight / verticalFov if verticalFov else screenHeight
gun = self.typeDescriptor.gun
minBound, maxBound = gun['pitchLimits']['absolute']
minStep = (maxBound - minBound) / 63
turretYawLimits = gun['turretYawLimits']
maxPitch =gun['pitchLimits']['maxPitch']
minPitch = gun['pitchLimits']['minPitch']
dataHor, dataVert = coordinate(yaw, pitch)
cameraMode = None
as_event('ON_ANGLES_AIMING')
示例3: disable
def disable(self):
self.__aimingSystem.disable()
self.stopCallback(self.__cameraUpdate)
BigWorld.camera(None)
BigWorld.player().positionControl.followCamera(False)
self.__positionOscillator.reset()
FovExtended.instance().resetFov()
FovExtended.instance().enabled = True
示例4: __cameraUpdate
def __cameraUpdate(self):
if not (self.__autoUpdateDxDyDz.x == 0.0 and self.__autoUpdateDxDyDz.y == 0.0 and self.__autoUpdateDxDyDz.z == 0.0):
self.__update(self.__autoUpdateDxDyDz.x, self.__autoUpdateDxDyDz.y, self.__autoUpdateDxDyDz.z)
inertDt = deltaTime = self.measureDeltaTime()
replayCtrl = BattleReplay.g_replayCtrl
if replayCtrl.isPlaying:
repSpeed = replayCtrl.playbackSpeed
if repSpeed == 0.0:
inertDt = 0.01
deltaTime = 0.0
else:
inertDt = deltaTime = deltaTime / repSpeed
self.__aimingSystem.update(deltaTime)
virginShotPoint = self.__aimingSystem.getThirdPersonShotPoint()
delta = self.__inputInertia.positionDelta
sign = delta.dot(Vector3(0, 0, 1))
self.__inputInertia.update(inertDt)
delta = (delta - self.__inputInertia.positionDelta).length
if delta != 0.0:
self.__cam.setScrollDelta(math.copysign(delta, sign))
FovExtended.instance().setFovByMultiplier(self.__inputInertia.fovZoomMultiplier)
unshakenPos = self.__inputInertia.calcWorldPos(self.__aimingSystem.idealMatrix if self.__adCfg['enable'] else self.__aimingSystem.matrix)
vehMatrix = Math.Matrix(self.__aimingSystem.vehicleMProv)
vehiclePos = vehMatrix.translation
fromVehicleToUnshakedPos = unshakenPos - vehiclePos
deviationBasis = mathUtils.createRotationMatrix(Vector3(self.__aimingSystem.yaw, 0, 0))
impulseDeviation, movementDeviation, oscillationsZoomMultiplier = self.__updateOscillators(deltaTime)
relCamPosMatrix = mathUtils.createTranslationMatrix(impulseDeviation + movementDeviation)
relCamPosMatrix.postMultiply(deviationBasis)
relCamPosMatrix.translation += fromVehicleToUnshakedPos
upRotMat = mathUtils.createRotationMatrix(Vector3(0, 0, -impulseDeviation.x * self.__dynamicCfg['sideImpulseToRollRatio'] - self.__noiseOscillator.deviation.z))
upRotMat.postMultiply(relCamPosMatrix)
self.__cam.up = upRotMat.applyVector(Vector3(0, 1, 0))
relTranslation = relCamPosMatrix.translation
self.__setCameraPosition(relTranslation)
shotPoint = self.__calcFocalPoint(virginShotPoint, deltaTime)
vehToShotPoint = shotPoint - vehiclePos
self.__setCameraAimPoint(vehToShotPoint)
replayCtrl = BattleReplay.g_replayCtrl
if replayCtrl.isPlaying and replayCtrl.isControllingCamera:
aimOffset = replayCtrl.getAimClipPosition()
if not BigWorld.player().isForcedGuiControlMode() and GUI.mcursor().inFocus:
GUI.mcursor().position = aimOffset
else:
aimOffset = self.__calcAimOffset(oscillationsZoomMultiplier)
if replayCtrl.isRecording:
replayCtrl.setAimClipPosition(aimOffset)
self.__cam.aimPointClipCoords = aimOffset
self.__aimOffset = aimOffset
if self.__shiftKeySensor is not None:
self.__shiftKeySensor.update(1.0)
if self.__shiftKeySensor.currentVelocity.lengthSquared > 0.0:
self.shiftCamPos(self.__shiftKeySensor.currentVelocity)
self.__shiftKeySensor.currentVelocity = Math.Vector3()
return 0.0
示例5: StrategicAimingSystem_enable
def StrategicAimingSystem_enable(self, targetPos):
global dataHor, dataVert, scaleHor, scaleVert, yHor, yVert, cameraMode
verticalFov = FovExtended.instance().actualDefaultVerticalFov
horizontalFov = FovExtended.calcHorizontalFov(verticalFov)
yHor = 0
yVert = 0
scaleHor = screenWidth / horizontalFov if horizontalFov else screenWidth
scaleVert = screenHeight / verticalFov if verticalFov else screenHeight
dataHor, dataVert = coordinate(yaw, pitch)
cameraMode = 'str'
as_event('ON_ANGLES_AIMING')
示例6: ArcadeAimingSystem_enable
def ArcadeAimingSystem_enable(self, targetPos, turretYaw=None, gunPitch=None):
global dataHor, dataVert, scaleHor, scaleVert, yHor, yVert, cameraMode
verticalFov = FovExtended.instance().actualDefaultVerticalFov
horizontalFov = FovExtended.calcHorizontalFov(verticalFov)
yHor = - screenHeight * 0.0775
yVert = yHor
scaleHor = screenWidth / horizontalFov if horizontalFov else screenWidth
scaleVert = screenHeight / verticalFov if verticalFov else screenHeight
dataHor, dataVert = coordinate(yaw, pitch)
cameraMode = 'arc'
as_event('ON_ANGLES_AIMING')
示例7: disable
def disable(self):
BigWorld.camera(None)
if self.__waitVehicleCallbackId is not None:
BigWorld.cancelCallback(self.__waitVehicleCallbackId)
self.__waitVehicleCallbackId = None
self.__showVehicle(True)
self.stopCallback(self.__cameraUpdate)
self.__aimingSystem.disable()
self.__movementOscillator.reset()
self.__impulseOscillator.reset()
self.__noiseOscillator.reset()
self.__accelerationSmoother.reset()
self.__autoUpdateDxDyDz.set(0)
FovExtended.instance().resetFov()
示例8: disable
def disable(self):
from gui import g_guiResetters
if self.__onRecreateDevice in g_guiResetters:
g_guiResetters.remove(self.__onRecreateDevice)
self.__setModelsToCollideWith([])
self.__cam.speedTreeTarget = None
BigWorld.camera(None)
if self.__shiftKeySensor is not None:
self.__shiftKeySensor.reset(Math.Vector3())
self.stopCallback(self.__cameraUpdate)
self.__movementOscillator.reset()
self.__impulseOscillator.reset()
self.__noiseOscillator.reset()
self.__accelerationSmoother.reset()
self.__autoUpdateDxDyDz.set(0)
self.__inputInertia.teleport(self.__calcRelativeDist())
FovExtended.instance().resetFov()
示例9: SniperAimingSystem_enable
def SniperAimingSystem_enable(self, targetPos, playerGunMatFunction=AimingSystems.getPlayerGunMat):
global dataHor, dataVert, scaleHor, scaleVert, yHor, yVert, cameraMode
verticalFov = BigWorld.projection().fov * 2
horizontalFov = FovExtended.calcVerticalFov(verticalFov)
yHor = 0
yVert = 0
scaleHor = screenWidth / horizontalFov if horizontalFov else screenWidth
scaleVert = screenHeight / verticalFov if verticalFov else screenHeight
dataHor, dataVert = coordinate(yaw, pitch)
cameraMode = 'sn'
as_event('ON_ANGLES_AIMING')
示例10: enable
def enable(self, targetPos, saveDist):
self.__prevTime = BigWorld.time()
self.__aimingSystem.enable(targetPos)
srcMat = mathUtils.createRotationMatrix((0.0, -math.pi * 0.499, 0.0))
self.__cam.source = srcMat
if not saveDist:
self.__camDist = self.__cfg['camDist']
self.__cam.pivotPosition = Math.Vector3(0.0, self.__camDist, 0.0)
camTarget = Math.MatrixProduct()
camTarget.b = self.__aimingSystem.matrix
self.__cam.target = camTarget
BigWorld.camera(self.__cam)
BigWorld.player().positionControl.moveTo(self.__aimingSystem.matrix.translation)
BigWorld.player().positionControl.followCamera(True)
FovExtended.instance().enabled = False
BigWorld.projection().fov = StrategicCamera.ABSOLUTE_VERTICAL_FOV
self.__cameraUpdate()
self.delayCallback(0.0, self.__cameraUpdate)
self.__needReset = 1
示例11: updateCameraByMouseMove
def updateCameraByMouseMove(self, dx, dy, dz):
if self.__selectedEmblemInfo is not None:
self.__cam.target.setTranslate(_CFG['preview_cam_start_target_pos'])
self.__cam.pivotPosition = _CFG['preview_cam_pivot_pos']
if self.__locatedOnEmbelem:
self.__cam.maxDistHalfLife = 0.0
else:
self.__cam.maxDistHalfLife = _CFG['cam_fluency']
sourceMat = Math.Matrix(self.__cam.source)
yaw = sourceMat.yaw
pitch = sourceMat.pitch
dist = self.__cam.pivotMaxDist
currentMatrix = Math.Matrix(self.__cam.invViewMatrix)
currentYaw = currentMatrix.yaw
yaw = self.__yawCameraFilter.getNextYaw(currentYaw, yaw, dx)
pitch -= dy * _CFG['cam_sens']
dist -= dz * _CFG['cam_sens']
pitch = mathUtils.clamp(math.radians(_CFG['cam_pitch_constr'][0]), math.radians(_CFG['cam_pitch_constr'][1]), pitch)
prevDist = dist
distConstr = self.__camDistConstr[1] if self.__selectedEmblemInfo is not None else self.__camDistConstr[0]
dist = mathUtils.clamp(distConstr[0], distConstr[1], dist)
if self.__boundingRadius is not None:
boundingRadius = self.__boundingRadius if self.__boundingRadius < distConstr[1] else distConstr[1]
dist = dist if dist > boundingRadius else boundingRadius
if dist > prevDist and dz > 0:
if self.__selectedEmblemInfo is not None:
self.locateCameraOnEmblem(*self.__selectedEmblemInfo)
return
self.__locatedOnEmbelem = False
mat = Math.Matrix()
mat.setRotateYPR((yaw, pitch, 0.0))
self.__cam.source = mat
self.__cam.pivotMaxDist = dist
if g_settingsCore.getSetting('dynamicFov') and abs(distConstr[1] - distConstr[0]) > 0.001:
relativeDist = (dist - distConstr[0]) / (distConstr[1] - distConstr[0])
_, minFov, maxFov = g_settingsCore.getSetting('fov')
fov = mathUtils.lerp(minFov, maxFov, relativeDist)
BigWorld.callback(0, functools.partial(FovExtended.instance().setFovByAbsoluteValue, math.radians(fov), 0.1))
return
示例12: resetFov
def resetFov(value):
FovExtended.instance().defaultHorizontalFov = value
示例13: setFov
def setFov(value, multiplier):
if self.__multiplier is not None:
self.__multiplier.setSystemValue(multiplier)
FovExtended.instance().resetFov()
FovExtended.instance().defaultHorizontalFov = value
return
示例14: init
def init(scriptConfig, engineConfig, userPreferences, loadingScreenGUI = None):
global g_replayCtrl
try:
if constants.IS_DEVELOPMENT:
autoFlushPythonLog()
LOG_DEBUG('init')
BigWorld.wg_initCustomSettings()
Settings.g_instance = Settings.Settings(scriptConfig, engineConfig, userPreferences)
CommandMapping.g_instance = CommandMapping.CommandMapping()
from helpers import DecalMap
DecalMap.g_instance = DecalMap.DecalMap(scriptConfig['decal'])
from helpers import EdgeDetectColorController
EdgeDetectColorController.g_instance = EdgeDetectColorController.EdgeDetectColorController(scriptConfig['silhouetteColors'])
import SoundGroups
SoundGroups.g_instance = SoundGroups.SoundGroups()
import BattleReplay
g_replayCtrl = BattleReplay.g_replayCtrl = BattleReplay.BattleReplay()
g_replayCtrl.registerWotReplayFileExtension()
try:
import Vibroeffects
Vibroeffects.VibroManager.g_instance = Vibroeffects.VibroManager.VibroManager()
Vibroeffects.VibroManager.g_instance.connect()
except:
LOG_CURRENT_EXCEPTION()
tutorialLoaderInit()
BigWorld.callback(0.1, asyncore_call)
MessengerEntry.g_instance.init()
import items
items.init(True, None if not constants.IS_DEVELOPMENT else {})
import ArenaType
ArenaType.init()
import dossiers1
dossiers1.init()
import dossiers2
dossiers2.init()
import fortified_regions
fortified_regions.init()
import potapov_quests
potapov_quests.init()
BigWorld.worldDrawEnabled(False)
import LcdKeyboard
LcdKeyboard.enableLcdKeyboardSpecificKeys(True)
gui_personality.init(loadingScreenGUI=loadingScreenGUI)
AreaDestructibles.init()
MusicController.init()
TriggersManager.init()
RSSDownloader.init()
g_postProcessing.init()
SoundGroups.loadLightSoundsDB()
try:
from LightFx import LightManager
LightManager.g_instance = LightManager.LightManager()
import AuxiliaryFx
AuxiliaryFx.g_instance = AuxiliaryFx.AuxiliaryFxManager()
except:
LOG_CURRENT_EXCEPTION()
from AvatarInputHandler.cameras import FovExtended
FovExtended.instance().resetFov()
SoundGroups.loadPluginDB()
except Exception:
LOG_CURRENT_EXCEPTION()
BigWorld.quit()
示例15: __calcAimMatrix
def __calcAimMatrix(self):
endMult = self.__inputInertia.endZoomMultiplier
fov = FovExtended.instance().actualDefaultVerticalFov * endMult
offset = self.__defaultAimOffset
return cameras.getAimMatrix(-offset[0], -offset[1], fov)