DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл DayZPlayerCamera_Base.c

См. исходные тексты.

Перечисления

enum  NVTypes {
  NONE = 0 , NV_GOGGLES , NV_GOGGLES_OFF , NV_OPTICS_ON ,
  NV_OPTICS_OFF , NV_PUMPKIN , NV_OPTICS_KAZUAR_DAY , NV_OPTICS_KAZUAR_NIGHT ,
  NV_OPTICS_STARLIGHT_DAY , NV_OPTICS_STARLIGHT_NIGHT , MAX
}
 

Функции

float Limit (float pV, float pMin, float pMax)
 limit function
 
float fixAngle_PI_PI (float pAngle)
 
float fixAngle_180_180 (float pAngle)
 
void DayZPlayerCameraBase (DayZPlayer pPlayer, HumanInputController pInput)
 constructor must be same
 
void HandleShoulderCameraOverride (HumanInputController pInput)
 
void ProcessCameraShake (float delta, out float leftRight, out float upDown)
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
float UpdateUDAngleUnlocked (out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
 
float UpdateLRAngleUnlocked (out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
 
float UpdateUDAngle (out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
 
float UpdateLRAngle (float pAngle, float pMin, float pMax, float pDt)
 
void StdFovUpdate (float pDt, out DayZPlayerCameraResult pOutResult)
 
override void SpawnCameraShakeProper (float strength, float radius, float smoothness, float radius_decay_speed)
 
override void OnUpdate (float pDt, out DayZPlayerCameraResult pOutResult)
 
override void OnActivate (DayZPlayerCamera pPrevCamera, DayZPlayerCameraResult pPrevCameraResult)
 
float GetWeaponSwayModifier ()
 
override string GetCameraName ()
 
void SetCameraPPDelay (DayZPlayerCamera pPrevCamera)
 
void SetCameraNV (bool nightvision)
 
bool IsCameraNV ()
 
void SetCameraNVType (int type)
 
int GetCameraNVType ()
 
void UpdateCameraNV (PlayerBase player)
 
void SetCameraPP (bool state, DayZPlayerCamera launchedFrom)
 by default sets camera PP to zero, regardless of parameter. Override if needed.
 
override float GetCurrentYaw ()
 
override float GetCurrentPitch ()
 
override float GetCurrentRoll ()
 
void ForceFreelook (bool state)
 
void SetNVPostprocess (int NVtype)
 DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::GetCameraNVType.
 
void InitCameraOnPlayer (bool force=false)
 

Переменные

enum NVTypes CONST_NEARPLANE_OPTICS_MIN = 0.04
 
Weapon_Base m_weaponUsed
 
ItemOptics m_opticsUsed
 
ref CameraShake m_CameraShake
 
float m_fLRAngleVel [1]
 
float m_fUDAngleVel [1]
 
float m_fFovAbsVel [1]
 
float m_fFovAbsolute
 
bool m_bForceFreeLook
 
float m_WeaponSwayModifier
 
float m_CameraPPDelay
 
float m_CurrentCameraYaw
 
float m_CurrentCameraPitch
 
float m_CurrentCameraRoll
 
HumanCommandWeapons m_CommandWeapons
 
bool m_IsNightvision
 
int m_NightvisionType
 

Перечисления

◆ NVTypes

Элементы перечислений
NONE 
NV_GOGGLES 
NV_GOGGLES_OFF 
NV_OPTICS_ON 
NV_OPTICS_OFF 
NV_PUMPKIN 
NV_OPTICS_KAZUAR_DAY 
NV_OPTICS_KAZUAR_NIGHT 
NV_OPTICS_STARLIGHT_DAY 
NV_OPTICS_STARLIGHT_NIGHT 
MAX 
55{
56 NONE = 0,
66 MAX
67}
@ NV_GOGGLES_OFF
Definition DayZPlayerCamera_Base.c:58
@ NV_PUMPKIN
Definition DayZPlayerCamera_Base.c:61
@ NV_OPTICS_OFF
Definition DayZPlayerCamera_Base.c:60
@ NV_OPTICS_ON
Definition DayZPlayerCamera_Base.c:59
@ NV_OPTICS_STARLIGHT_DAY
Definition DayZPlayerCamera_Base.c:64
@ NONE
Definition DayZPlayerCamera_Base.c:56
@ NV_OPTICS_KAZUAR_DAY
Definition DayZPlayerCamera_Base.c:62
@ NV_GOGGLES
Definition DayZPlayerCamera_Base.c:57
@ MAX
Definition DayZPlayerCamera_Base.c:66
@ NV_OPTICS_STARLIGHT_NIGHT
Definition DayZPlayerCamera_Base.c:65
@ NV_OPTICS_KAZUAR_NIGHT
Definition DayZPlayerCamera_Base.c:63

Функции

◆ DayZPlayerCameraBase()

void DayZPlayerCameraBase ( DayZPlayer pPlayer,
HumanInputController pInput )
protected

constructor must be same

79 {
80 m_fLRAngleVel[0] = 0;
81 m_fUDAngleVel[0] = 0;
82 m_fFovAbsVel[0] = 0;
84
87 /*
88 {
89 int perItemCamUD = pPlayer.GetCurrentPerItemCameraUD();
90 string a = "Per Item Camera User Data: " + perItemCamUD.ToString();
91 Print(a);
92 }
93 */
95
96 m_CommandWeapons = pPlayer.GetCommandModifier_Weapons();
97 Init();
99 };
DayZGame GetDayZGame()
Definition DayZGame.c:3817
float m_fUDAngleVel[1]
Definition DayZPlayerCamera_Base.c:571
void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Definition DayZPlayerCamera_Base.c:119
float m_CameraPPDelay
Definition DayZPlayerCamera_Base.c:576
void HandleShoulderCameraOverride(HumanInputController pInput)
Definition DayZPlayerCamera_Base.c:102
float m_WeaponSwayModifier
Definition DayZPlayerCamera_Base.c:575
float m_fFovAbsVel[1]
Definition DayZPlayerCamera_Base.c:572
HumanCommandWeapons m_CommandWeapons
Definition DayZPlayerCamera_Base.c:582
float m_fFovAbsolute
Definition DayZPlayerCamera_Base.c:573
float m_fLRAngleVel[1]
Definition DayZPlayerCamera_Base.c:570
override int GetEyeZoomLevel()
Definition DayZPlayerImplement.c:291
Definition EntityAI.c:95
DayZPlayer m_pPlayer
data
Definition dayzplayer.c:135

Перекрестные ссылки GetDayZGame(), DayZPlayer::GetEyeZoomLevel(), HandleShoulderCameraOverride(), Init(), m_CameraPPDelay, m_CommandWeapons, m_fFovAbsolute, m_fFovAbsVel, m_fLRAngleVel, m_fUDAngleVel, m_pPlayer и m_WeaponSwayModifier.

◆ fixAngle_180_180()

float fixAngle_180_180 ( float pAngle)
37{
38 while (pAngle > 180)
39 {
40
41 pAngle -= 360;
42 }
43
44 while (pAngle < -180)
45 {
46
47 pAngle += 360;
48 }
49
50 return pAngle;
51}

Используется в UIScriptedMenu::SetCameraData().

◆ fixAngle_PI_PI()

float fixAngle_PI_PI ( float pAngle)
20{
21 while (pAngle > Math.PI)
22 {
23
24 pAngle -= Math.PI2;
25 }
26
27 while (pAngle < -Math.PI)
28 {
29
30 pAngle += Math.PI2;
31 }
32
33 return pAngle;
34}
Definition EnMath.c:7
static const float PI
Definition EnMath.c:12
static const float PI2
Definition EnMath.c:13

Перекрестные ссылки Math::PI и Math::PI2.

◆ ForceFreelook()

void ForceFreelook ( bool state)
protected
471 {
473 }
bool m_bForceFreeLook
Definition DayZPlayerCamera_Base.c:574

Перекрестные ссылки m_bForceFreeLook.

◆ GetCameraName()

override string GetCameraName ( )
protected
393 {
394 return "DayZPlayerCameraBase";
395 }

◆ GetCameraNVType()

int GetCameraNVType ( )
protected
417 {
418 return m_NightvisionType;
419 }
int m_NightvisionType
Definition DayZPlayerCamera_Base.c:584

Перекрестные ссылки m_NightvisionType.

Используется в SetCameraPP(), DayZPlayerCameraBase::SetCameraPP() и UpdateCameraNV().

◆ GetCurrentPitch()

override float GetCurrentPitch ( )
protected
461 {
463 }
float m_CurrentCameraPitch
Definition DayZPlayerCamera_Base.c:579

Перекрестные ссылки m_CurrentCameraPitch.

◆ GetCurrentRoll()

override float GetCurrentRoll ( )
protected
466 {
467 return m_CurrentCameraRoll;
468 }
float m_CurrentCameraRoll
Definition DayZPlayerCamera_Base.c:580

Перекрестные ссылки m_CurrentCameraRoll.

◆ GetCurrentYaw()

override float GetCurrentYaw ( )
protected
456 {
457 return m_CurrentCameraYaw;
458 }
float m_CurrentCameraYaw
Definition DayZPlayerCamera_Base.c:578

Перекрестные ссылки m_CurrentCameraYaw.

◆ GetWeaponSwayModifier()

float GetWeaponSwayModifier ( )
protected
388 {
390 }

Перекрестные ссылки m_WeaponSwayModifier.

◆ HandleShoulderCameraOverride()

void HandleShoulderCameraOverride ( HumanInputController pInput)
protected

disable override

103 {
106 }
proto native void Override3rdIsRightShoulder(HumanInputControllerOverrideType overrideType, bool value)
HumanInputController m_pInput
human input
Definition dayzplayer.c:136
HumanInputControllerOverrideType
Definition human.c:8

Перекрестные ссылки m_pInput и HumanInputController::Override3rdIsRightShoulder().

Используется в DayZPlayerCameraBase().

◆ Init()

void Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

120 {
122 if ( player && player.IsNVGWorking() != IsCameraNV() )
123 {
124 SetCameraNV(player.IsNVGWorking());
125 SetCameraNVType(player.GetNVType());
126 }
127 }
bool IsCameraNV()
Definition DayZPlayerCamera_Base.c:406
void SetCameraNV(bool nightvision)
Definition DayZPlayerCamera_Base.c:401
void SetCameraNVType(int type)
Definition DayZPlayerCamera_Base.c:411
Definition PlayerBaseClient.c:2

Перекрестные ссылки IsCameraNV(), m_pPlayer, SetCameraNV() и SetCameraNVType().

◆ InitCameraOnPlayer()

void InitCameraOnPlayer ( bool force = false)
protected
562 {
564 if (!player.GetCurrentPlayerCamera() || (force && player.GetCurrentPlayerCamera() != this))
565 {
566 player.OnCameraChanged(this);
567 }
568 }

Перекрестные ссылки m_pPlayer.

Используется в OnActivate(), DayZPlayerCameraBase::OnUpdate() и OnUpdate().

◆ IsCameraNV()

bool IsCameraNV ( )
protected
407 {
408 return m_IsNightvision;
409 }
bool m_IsNightvision
Definition DayZPlayerCamera_Base.c:583

Перекрестные ссылки m_IsNightvision.

Используется в Init(), OnActivate(), SetCameraPP(), DayZPlayerCameraBase::SetCameraPP() и UpdateCameraNV().

◆ Limit()

float Limit ( float pV,
float pMin,
float pMax )

limit function

3{
4 if (pV >= pMin && pV <= pMax)
5 {
6 return pV;
7 }
8 else if (pV < pMin)
9 {
10 return pMin;
11 }
12 else
13 {
14 return pMax;
15 }
16}

Используется в UpdateLRAngle(), UpdateLRAngleLookAt(), UpdateLRAngleUnlocked(), UpdateUDAngle() и UpdateUDAngleUnlocked().

◆ OnActivate()

override void OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
protected
370 {
371 InitCameraOnPlayer(true);
373
374 if (DayZPlayerCameraBase.Cast(pPrevCamera) && DayZPlayerCameraBase.Cast(pPrevCamera).IsCameraNV() && !IsCameraNV())
375 {
376 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start( new Param1<int>(PPERequester_CameraNV.NV_TRANSITIVE) );
377 }
378
379 GetGame().GetCallQueue(CALL_CATEGORY_GUI).CallLater(SetCameraPP,m_CameraPPDelay*1000,false,true,this); // this takes care of weapon/optics postprocessing
382 {
383 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(PlayerBase.Cast(m_pPlayer).HideClothing,null,false);
384 }
385 }
void InitCameraOnPlayer(bool force=false)
Definition DayZPlayerCamera_Base.c:561
void SetCameraPP(bool state, DayZPlayerCamera launchedFrom)
by default sets camera PP to zero, regardless of parameter. Override if needed.
Definition DayZPlayerCamera_Base.c:435
void SetCameraPPDelay(DayZPlayerCamera pPrevCamera)
Definition DayZPlayerCamera_Base.c:397
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
Definition DayZPlayerCameraIronsights.c:365
this is main camera class
Definition DayZPlayerCamera1stPerson.c:5
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
Definition dayzplayer.c:56
proto native CGame GetGame()
const int CALL_CATEGORY_GUI
Definition tools.c:9

Перекрестные ссылки CALL_CATEGORY_GUI, DayZPlayerCamera(), DayZPlayerCameraOptics(), GetGame(), InitCameraOnPlayer(), IsCameraNV(), m_CameraPPDelay, m_pPlayer, DayZPlayerCameraBase::SetCameraPP() и DayZPlayerCameraBase::SetCameraPPDelay().

◆ OnUpdate()

override void OnUpdate ( float pDt,
out DayZPlayerCameraResult pOutResult )
protected
350 {
351 if (!m_pPlayer || !PlayerBase.Cast(m_pPlayer))
352 {
353 Debug.Log("DayZPlayerCameraBase | OnUpdate | no player!");
354 return;
355 }
356
357 if (PlayerBase.Cast(m_pPlayer).GetCurrentCamera() != this)
358 {
359 //Print("DayZPlayerCameraBase | OnUpdate | unused camera! | " + this + "/" + PlayerBase.Cast(m_pPlayer).GetCurrentCamera());
360 return;
361 }
362
363 super.OnUpdate(pDt, pOutResult);
367 }
void StdFovUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
Definition DayZPlayerCamera_Base.c:315
void UpdateCameraNV(PlayerBase player)
Definition DayZPlayerCamera_Base.c:421
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136

Перекрестные ссылки InitCameraOnPlayer(), Debug::Log(), m_pPlayer, StdFovUpdate() и UpdateCameraNV().

◆ ProcessCameraShake()

void ProcessCameraShake ( float delta,
out float leftRight,
out float upDown )
protected
109 {
110 if (m_CameraShake)
111 {
112 float x,y;
113 m_CameraShake.Update(delta, x, y);
114 leftRight += x;
115 upDown += y;
116 }
117 }
ref CameraShake m_CameraShake
Definition DayZPlayerCamera_Base.c:75
Icon x
Icon y

Перекрестные ссылки m_CameraShake, x и y.

Используется в DayZPlayerCameraBase::OnUpdate().

◆ SetCameraNV()

void SetCameraNV ( bool nightvision)
protected
402 {
404 }

Перекрестные ссылки m_IsNightvision.

Используется в Init(), SetCameraPP() и UpdateCameraNV().

◆ SetCameraNVType()

void SetCameraNVType ( int type)
protected
412 {
413 m_NightvisionType = type;
414 }

Перекрестные ссылки m_NightvisionType.

Используется в Init() и UpdateCameraNV().

◆ SetCameraPP()

void SetCameraPP ( bool state,
DayZPlayerCamera launchedFrom )
protected

by default sets camera PP to zero, regardless of parameter. Override if needed.

436 {
437 PPERequesterBank.GetRequester(PPERequester_CameraADS).Stop();
438
439 if (IsCameraNV())
440 {
442 }
443 else
444 {
446 }
447
448 m_weaponUsed = Weapon_Base.Cast(m_pPlayer.GetHumanInventory().GetEntityInHands());
449 if (m_weaponUsed)
450 {
451 m_weaponUsed.HideWeaponBarrel(false);
452 }
453 }
Weapon_Base m_weaponUsed
Definition DayZPlayerCamera_Base.c:73
NVTypes
Definition DayZPlayerCamera_Base.c:55
void SetNVPostprocess(int NVtype)
DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::Get...
Definition DayZPlayerCamera_Base.c:477
int GetCameraNVType()
Definition DayZPlayerCamera_Base.c:416
shorthand
Definition BoltActionRifle_Base.c:6

Перекрестные ссылки GetCameraNVType(), IsCameraNV(), m_pPlayer, m_weaponUsed и SetNVPostprocess().

◆ SetCameraPPDelay()

void SetCameraPPDelay ( DayZPlayerCamera pPrevCamera)
protected
398 {
399 }

◆ SetNVPostprocess()

void SetNVPostprocess ( int NVtype)
protected

DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::GetCameraNVType.

478 {
479 //Print("+++Setting NV type: " + NVtype + " +++");
480 switch (NVtype)
481 {
482 case NVTypes.NONE:
483 {
484 PPERequesterBank.GetRequester(PPERequester_CameraNV).Stop();
485 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
486 {
487 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
488 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
489 }
490 }
491 break;
492
493 //night-vision modes
494 case NVTypes.NV_OPTICS_KAZUAR_NIGHT:
495 case NVTypes.NV_OPTICS_STARLIGHT_NIGHT:
496 case NVTypes.NV_OPTICS_ON:
497 {
498 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start( new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_OPTICS) );
499 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
500 {
501 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
502 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
503 }
504 }
505 break;
506
507 //daytime filter modes
508 case NVTypes.NV_OPTICS_KAZUAR_DAY:
509 case NVTypes.NV_OPTICS_STARLIGHT_DAY:
510 {
511 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start( new Param1<int>(PPERequester_CameraNV.NV_DAYTIME_OPTICS) );
512 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
513 {
514 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
515 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
516 }
517 }
518 break;
519
520 case NVTypes.NV_GOGGLES_OFF:
521 case NVTypes.NV_OPTICS_OFF:
522 {
523 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start( new Param1<int>(PPERequester_CameraNV.NV_NO_BATTERY) );
524 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
525 {
526 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
527 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
528 }
529 }
530 break;
531
532 case NVTypes.NV_GOGGLES:
533 {
534 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start( new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_GLASSES) );
535 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
536 {
537 GetGame().GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
538 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
539 }
540 }
541 break;
542
543 case NVTypes.NV_PUMPKIN:
544 {
545 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start( new Param1<int>(PPERequester_CameraNV.NV_PUMPKIN) );
546 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
547 {
548 GetGame().GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
549 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
550 }
551 }
552 break;
553 }
554
555 if (PlayerBaseClient.Cast(m_pPlayer))
556 {
557 PlayerBaseClient.Cast(m_pPlayer).SwitchPersonalLight(NVtype < 1);
558 }
559 }
Definition SurvivorBase.c:2

Перекрестные ссылки GetGame() и m_pPlayer.

Используется в SetCameraPP() и DayZPlayerCameraBase::SetCameraPP().

◆ SpawnCameraShakeProper()

override void SpawnCameraShakeProper ( float strength,
float radius,
float smoothness,
float radius_decay_speed )
protected
345 {
347 }
Definition CameraShake.c:2

Перекрестные ссылки m_CameraShake.

Используется в SpawnCameraShake() и SpawnDiagCameraShake().

◆ StdFovUpdate()

void StdFovUpdate ( float pDt,
out DayZPlayerCameraResult pOutResult )
protected

change abs FOV for naked eye zoom

switch shooting from camera to weapon (firearms)

316 {
318 switch (m_pPlayer.GetEyeZoomLevel())
319 {
320 // ordered in likelihood of occurance for perf. reasons
321 case ECameraZoomType.NONE:
322 m_fFovAbsolute = Math.SmoothCD(m_fFovAbsolute, GetDayZGame().GetFOVByZoomType(ECameraZoomType.NONE), m_fFovAbsVel, 0.1, 1000, pDt);
323 break;
324 case ECameraZoomType.NORMAL:
325 m_fFovAbsolute = Math.SmoothCD(m_fFovAbsolute, GetDayZGame().GetFOVByZoomType(ECameraZoomType.NORMAL), m_fFovAbsVel, 0.1, 1000, pDt);
326 break;
327 case ECameraZoomType.SHALLOW:
328 m_fFovAbsolute = Math.SmoothCD(m_fFovAbsolute, GetDayZGame().GetFOVByZoomType(ECameraZoomType.SHALLOW), m_fFovAbsVel, 0.1, 1000, pDt);
329 break;
330 default:
331 m_fFovAbsolute = Math.SmoothCD(m_fFovAbsolute, GetDayZGame().GetFOVByZoomType(ECameraZoomType.NONE), m_fFovAbsVel, 0.1, 1000, pDt);
332 break;
333 }
334
335 pOutResult.m_fFovAbsolute = m_fFovAbsolute;
336
339 {
340 pOutResult.m_fShootFromCamera = 0.0;
341 }
342 }
ECameraZoomType
Definition ECameraZoomType.c:2
override bool IsShootingFromCamera()
Definition DayZPlayerImplement.c:296
static proto float SmoothCD(float val, float target, inout float velocity[], float smoothTime, float maxVelocity, float dt)
Does the CD smoothing function - easy in | easy out / S shaped smoothing.

Перекрестные ссылки GetDayZGame(), DayZPlayer::GetEyeZoomLevel(), DayZPlayer::IsShootingFromCamera(), m_fFovAbsolute, m_fFovAbsVel, m_pPlayer и Math::SmoothCD().

Используется в DayZPlayerCameraBase::OnUpdate() и OnUpdate().

◆ UpdateCameraNV()

void UpdateCameraNV ( PlayerBase player)
protected
422 {
423 if ( !player )
424 return;
425
426 if ( player.IsNVGWorking() != IsCameraNV() || player.GetNVType() != GetCameraNVType() )
427 {
428 SetCameraNV(player.IsNVGWorking());
429 SetCameraNVType(player.GetNVType());
430 SetCameraPP(true, this);
431 }
432 }

Перекрестные ссылки GetCameraNVType(), IsCameraNV(), SetCameraNV(), SetCameraNVType() и DayZPlayerCameraBase::SetCameraPP().

Используется в DayZPlayerCameraBase::OnUpdate() и OnUpdate().

◆ UpdateLRAngle()

float UpdateLRAngle ( float pAngle,
float pMin,
float pMax,
float pDt )
protected

lr angle

282 {
285 {
289
290 m_fLRAngleVel[0] = 0; // reset filter
291
292 }
293 else
294 {
296 {
299
300 m_fLRAngleVel[0] = 0; // reset filter
301 }
302 else
303 {
304 // smooth value back to 0
305 pAngle = Math.SmoothCD(pAngle, 0, m_fLRAngleVel, 0.14, 1000, pDt);
306 // m_fLeftRightAngle = 0.9 * (1.0 - pDt);
307 }
308 }
309
310 return pAngle;
311 }
float Limit(float pV, float pMin, float pMax)
limit function
Definition DayZPlayerCamera_Base.c:2
proto native vector GetAimChange()
returns per tick aim change (in radians)
proto native bool CameraIsTracking()
returns if camera is tracking (using IR device)
proto native vector GetTracking()
returns absolute tracking change (in radians)
proto native bool CameraIsFreeLook()
returns true if freelook is active
static const float RAD2DEG
Definition EnMath.c:16

Перекрестные ссылки HumanInputController::CameraIsFreeLook(), HumanInputController::CameraIsTracking(), HumanInputController::GetAimChange(), HumanInputController::GetTracking(), Limit(), m_bForceFreeLook, m_fLRAngleVel, m_pInput, Math::RAD2DEG и Math::SmoothCD().

◆ UpdateLRAngleUnlocked()

float UpdateLRAngleUnlocked ( out float pAngle,
out float pAngleAdd,
float pMin,
float pMax,
float pDt )
protected
191 {
192 float target = 0;
193
195 {
197 pAngle = target;
198
199 m_fUDAngleVel[0] = 0;
200 }
201 else
202 {
203 if (Math.AbsFloat(pAngleAdd) > 0.001)
204 {
206 pAngle = target;
207 }
208
210 {
212
213 m_fLRAngleVel[0] = 0;
214 }
215 else
216 {
217 pAngleAdd = Math.SmoothCD(pAngleAdd, 0.0, m_fLRAngleVel, 0.14, 1000, pDt);
218 }
219
221 }
222
225
226 return pAngle + pAngleAdd;
227 }
proto native vector GetAimDelta(float dt)
returns aim change (in radians)
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), HumanInputController::CameraIsFreeLook(), HumanInputController::CameraIsTracking(), HumanInputController::GetAimDelta(), HumanInputController::GetTracking(), Limit(), m_bForceFreeLook, m_fLRAngleVel, m_fUDAngleVel, m_pInput, Math::RAD2DEG и Math::SmoothCD().

Используется в DayZPlayerCameraBase::OnUpdate() и OnUpdate().

◆ UpdateUDAngle()

float UpdateUDAngle ( out float pAngle,
out float pAngleAdd,
float pMin,
float pMax,
float pDt )
protected

pAngle + pAngleAdd == aimingUDAngle + aimingUDAdd now we set pAngleAdd to be the differenc from aimingAngle and we change camera angle to be the aiming angle

lr angle

update it in degrees

230 {
231 if (Math.AbsFloat(pAngleAdd) > 0.001)
232 {
234
237
238 // override actual angle
241
242 // Print("Angle: " + pAngle.ToString() + " Aim: " + actualUDAngle.ToString() );
243 }
244
247 {
250
251 m_fUDAngleVel[0] = 0;
252 }
253 else
254 {
256 {
259
260 m_fUDAngleVel[0] = 0;
261 }
262 else
263 {
267
268 pAngleAdd = Math.SmoothCD(pAngleAdd, 0, m_fUDAngleVel, 0.14, 1000, pDt);
269 }
270 }
271
272 /*{
273 float change = m_pInput.GetAimChange()[1] * Math.RAD2DEG;
274
275 Print ("Script: Camera ud angle: " + pAngle.ToString() + " change: " + change.ToString() );
276 }*/
277
278 return Limit(pAngle + pAngleAdd, pMin, pMax);
279 }
proto native float GetBaseAimingAngleUD()
returns base aiming angle UD - without sway/offsets/...

Перекрестные ссылки Math::AbsFloat(), HumanInputController::CameraIsFreeLook(), HumanInputController::CameraIsTracking(), HumanInputController::GetAimChange(), HumanCommandWeapons::GetBaseAimingAngleUD(), HumanInputController::GetTracking(), Limit(), m_CommandWeapons, m_fUDAngleVel, m_pInput, Math::RAD2DEG и Math::SmoothCD().

◆ UpdateUDAngleUnlocked()

float UpdateUDAngleUnlocked ( out float pAngle,
out float pAngleAdd,
float pMin,
float pMax,
float pDt )
protected
130 {
132
134 {
136 pAngle = target;
137
138 m_fUDAngleVel[0] = 0;
139 }
140 else
141 {
142 if (Math.AbsFloat(pAngleAdd) > 0.001)
143 {
145 pAngle = target;
146 }
147
149 {
151
152 m_fUDAngleVel[0] = 0;
153 }
154 else
155 {
157 if (player) // handle locking of camera U/D angle movement when performing an action and not in freelook
158 {
159 float pitch = pAngle + pAngleAdd;
161 player.GetLookLimits(downLimit, upLimit, leftLimit, rightLimit);
162
163 if (pitch < (upLimit + 1) && pitch > (downLimit - 1)) // stop smoothing once within sufficiently small difference
164 {
165 pMin = downLimit;
166 pMax = upLimit;
167 }
168 else // smooth camera to locked angle, avoiding snap from the angle we started the action to the limit
169 {
170 float vel[1] = m_fUDAngleVel;
171 pMin = Math.SmoothCD(pitch, downLimit, vel, 0.2, 1000, pDt);
172 pMax = Math.SmoothCD(pitch, upLimit, vel, 0.2, 1000, pDt);
173 }
174 }
175
176 pAngleAdd = Math.SmoothCD(pAngleAdd, 0.0, m_fUDAngleVel, 0.14, 1000, pDt);
177 }
178
180 {
182 }
183 }
184
187 return pAngle + pAngleAdd;
188 }

Перекрестные ссылки Math::AbsFloat(), HumanInputController::CameraIsFreeLook(), HumanInputController::CameraIsTracking(), HumanInputController::GetAimDelta(), HumanCommandWeapons::GetBaseAimingAngleUD(), HumanInputController::GetTracking(), Limit(), m_CommandWeapons, m_fUDAngleVel, m_pInput, m_pPlayer, Math::RAD2DEG и Math::SmoothCD().

Используется в DayZPlayerCameraBase::OnUpdate() и OnUpdate().

Переменные

◆ CONST_NEARPLANE_OPTICS_MIN

enum NVTypes CONST_NEARPLANE_OPTICS_MIN = 0.04

◆ m_bForceFreeLook

bool m_bForceFreeLook
protected

◆ m_CameraPPDelay

float m_CameraPPDelay
protected

◆ m_CameraShake

ref CameraShake m_CameraShake
protected

◆ m_CommandWeapons

HumanCommandWeapons m_CommandWeapons
protected

◆ m_CurrentCameraPitch

float m_CurrentCameraPitch
protected

◆ m_CurrentCameraRoll

float m_CurrentCameraRoll
protected

◆ m_CurrentCameraYaw

float m_CurrentCameraYaw
protected

◆ m_fFovAbsolute

float m_fFovAbsolute
protected

◆ m_fFovAbsVel

◆ m_fLRAngleVel

float m_fLRAngleVel[1]
protected

◆ m_fUDAngleVel

float m_fUDAngleVel[1]
protected

◆ m_IsNightvision

bool m_IsNightvision
protected

Используется в IsCameraNV() и SetCameraNV().

◆ m_NightvisionType

int m_NightvisionType
protected

Используется в GetCameraNVType() и SetCameraNVType().

◆ m_opticsUsed

◆ m_WeaponSwayModifier

◆ m_weaponUsed