2float Limit(
float pV,
float pMin,
float pMax)
4 if (pV >= pMin && pV <= pMax)
115 if ( player && player.IsNVGWorking() !=
IsCameraNV() )
137 pAngleAdd = pAngle + pAngleAdd - target;
158 pAngle =
Limit(pAngle, pMin, pMax);
159 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
160 return pAngle + pAngleAdd;
178 pAngleAdd = pAngle + pAngleAdd - target;
193 pAngleAdd = pAngleAdd + pAngle;
196 pAngle =
Limit(pAngle, pMin, pMax);
197 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
199 return pAngle + pAngleAdd;
202 float UpdateUDAngle(out
float pAngle, out
float pAngleAdd,
float pMin,
float pMax,
float pDt)
212 pAngleAdd = pAngle + pAngleAdd - aimingUDAngle;
213 pAngle = aimingUDAngle;
222 pAngleAdd =
Limit(pAngleAdd, pMin, pMax);
231 pAngleAdd =
Limit(pAngleAdd, pMin, pMax);
239 pAngle =
Limit(pAngle, pMin, pMax);
251 return Limit(pAngle + pAngleAdd, pMin, pMax);
261 pAngle =
Limit(pAngle, pMin, pMax);
271 pAngle =
Limit(-pAngle, pMin, pMax);
313 pOutResult.m_fShootFromCamera = 0.0;
326 Debug.
Log(
"DayZPlayerCameraBase | OnUpdate | no player!");
336 super.OnUpdate(pDt, pOutResult);
349 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_TRANSITIVE) );
367 return "DayZPlayerCameraBase";
410 PPERequesterBank.GetRequester(PPERequester_CameraADS).Stop();
457 PPERequesterBank.GetRequester(PPERequester_CameraNV).Stop();
458 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
467 case NVTypes.NV_OPTICS_KAZUAR_NIGHT:
468 case NVTypes.NV_OPTICS_STARLIGHT_NIGHT:
471 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_OPTICS) );
472 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
481 case NVTypes.NV_OPTICS_KAZUAR_DAY:
482 case NVTypes.NV_OPTICS_STARLIGHT_DAY:
484 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DAYTIME_OPTICS) );
485 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
496 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_NO_BATTERY) );
497 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
507 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_GLASSES) );
508 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
518 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_PUMPKIN) );
519 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
538 if (!player.GetCurrentPlayerCamera() || (force && player.GetCurrentPlayerCamera() !=
this))
540 player.OnCameraChanged(
this);
protected float m_WeaponSwayModifier
float UpdateLRAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
protected int m_NightvisionType
protected float m_fUDAngleVel[1]
protected float m_fLRAngleVel[1]
protected float m_CurrentCameraPitch
protected ItemOptics m_opticsUsed
float UpdateUDAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
protected Weapon_Base m_weaponUsed
float Limit(float pV, float pMin, float pMax)
limit function
protected ref CameraShake m_CameraShake
void StdFovUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
@ NV_OPTICS_STARLIGHT_DAY
@ NV_OPTICS_STARLIGHT_NIGHT
float fixAngle_PI_PI(float pAngle)
float UpdateLRAngle(float pAngle, float pMin, float pMax, float pDt)
float GetWeaponSwayModifier()
protected float m_fFovAbsVel[1]
protected HumanCommandWeapons m_CommandWeapons
protected bool m_IsNightvision
protected bool m_bForceFreeLook
void SetNVPostprocess(int NVtype)
DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::Get...
void InitCameraOnPlayer(bool force=false)
float fixAngle_180_180(float pAngle)
protected float m_CurrentCameraYaw
void SetCameraNV(bool nightvision)
protected float m_CameraPPDelay
enum NVTypes CONST_NEARPLANE_OPTICS_MIN
void UpdateCameraNV(PlayerBase player)
void SetCameraNVType(int type)
void ForceFreelook(bool state)
float UpdateUDAngle(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
void ProcessCameraShake(float delta, out float leftRight, out float upDown)
protected float m_CurrentCameraRoll
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
override void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
proto native Mission GetMission()
override ScriptCallQueue GetCallQueue(int call_category)
void Update(float delta_time, out float x_axis, out float y_axis)
this is main camera class
override string GetCameraName()
override void SetCameraPP(bool state, DayZPlayerCamera launchedFrom)
override void SetCameraPPDelay(DayZPlayerCamera pPrevCamera)
override bool IsShootingFromCamera()
override int GetEyeZoomLevel()
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.
proto native float GetBaseAimingAngleUD()
returns base aiming angle UD - without sway/offsets/...
GameplayEffectWidgets_base GetEffectWidgets()
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
void SpawnCameraShakeProper(float strength, float radius, float smoothness, float radius_decay_speed)
protected DayZPlayer m_pPlayer
data
protected HumanInputController m_pInput
human input
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
float m_fFovAbsolute
fov absolute value override - -1.0 default, if set - overrides absolute fov setting
proto native CGame GetGame()
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.
static proto float AbsFloat(float f)
Returns absolute value.
static const float RAD2DEG
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.