2float Limit(
float pV,
float pMin,
float pMax)
4 if (pV >= pMin && pV <= pMax)
122 if ( player && player.IsNVGWorking() !=
IsCameraNV() )
144 pAngleAdd = pAngle + pAngleAdd - target;
159 float pitch = pAngle + pAngleAdd;
160 float downLimit, upLimit, leftLimit, rightLimit;
161 player.GetLookLimits(downLimit, upLimit, leftLimit, rightLimit);
163 if (pitch < (upLimit + 1) && pitch > (downLimit - 1))
171 pMin =
Math.
SmoothCD(pitch, downLimit, vel, 0.2, 1000, pDt);
172 pMax =
Math.
SmoothCD(pitch, upLimit, vel, 0.2, 1000, pDt);
185 pAngle =
Limit(pAngle, pMin, pMax);
186 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
187 return pAngle + pAngleAdd;
205 pAngleAdd = pAngle + pAngleAdd - target;
220 pAngleAdd = pAngleAdd + pAngle;
223 pAngle =
Limit(pAngle, pMin, pMax);
224 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
226 return pAngle + pAngleAdd;
229 float UpdateUDAngle(out
float pAngle, out
float pAngleAdd,
float pMin,
float pMax,
float pDt)
239 pAngleAdd = pAngle + pAngleAdd - aimingUDAngle;
240 pAngle = aimingUDAngle;
249 pAngleAdd =
Limit(pAngleAdd, pMin, pMax);
258 pAngleAdd =
Limit(pAngleAdd, pMin, pMax);
266 pAngle =
Limit(pAngle, pMin, pMax);
278 return Limit(pAngle + pAngleAdd, pMin, pMax);
288 pAngle =
Limit(pAngle, pMin, pMax);
298 pAngle =
Limit(-pAngle, pMin, pMax);
340 pOutResult.m_fShootFromCamera = 0.0;
353 Debug.
Log(
"DayZPlayerCameraBase | OnUpdate | no player!");
363 super.OnUpdate(pDt, pOutResult);
376 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_TRANSITIVE) );
394 return "DayZPlayerCameraBase";
437 PPERequesterBank.GetRequester(PPERequester_CameraADS).Stop();
484 PPERequesterBank.GetRequester(PPERequester_CameraNV).Stop();
485 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
494 case NVTypes.NV_OPTICS_KAZUAR_NIGHT:
495 case NVTypes.NV_OPTICS_STARLIGHT_NIGHT:
498 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_OPTICS) );
499 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
508 case NVTypes.NV_OPTICS_KAZUAR_DAY:
509 case NVTypes.NV_OPTICS_STARLIGHT_DAY:
511 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DAYTIME_OPTICS) );
512 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
523 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_NO_BATTERY) );
524 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
534 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_GLASSES) );
535 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
545 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_PUMPKIN) );
546 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
564 if (!player.GetCurrentPlayerCamera() || (force && player.GetCurrentPlayerCamera() !=
this))
566 player.OnCameraChanged(
this);
float UpdateLRAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
ref CameraShake m_CameraShake
float m_CurrentCameraPitch
float UpdateUDAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
void StdFovUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
@ NV_OPTICS_STARLIGHT_DAY
@ NV_OPTICS_STARLIGHT_NIGHT
float m_CurrentCameraRoll
float fixAngle_PI_PI(float pAngle)
float UpdateLRAngle(float pAngle, float pMin, float pMax, float pDt)
float GetWeaponSwayModifier()
void DayZPlayerCameraBase(DayZPlayer pPlayer, HumanInputController pInput)
constructor must be same
void SetNVPostprocess(int NVtype)
DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::Get...
void InitCameraOnPlayer(bool force=false)
void HandleShoulderCameraOverride(HumanInputController pInput)
void SetCameraPP(bool state, DayZPlayerCamera launchedFrom)
by default sets camera PP to zero, regardless of parameter. Override if needed.
float fixAngle_180_180(float pAngle)
void SetCameraNV(bool nightvision)
float m_WeaponSwayModifier
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)
HumanCommandWeapons m_CommandWeapons
void ProcessCameraShake(float delta, out float leftRight, out float upDown)
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
override void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
override ScriptCallQueue GetCallQueue(int call_category)
proto native Mission GetMission()
override void SetCameraPP(bool state, DayZPlayerCamera launchedFrom)
override void SetCameraPPDelay(DayZPlayerCamera pPrevCamera)
override string GetCameraName()
this is main camera class
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.
GameplayEffectWidgets_base GetEffectWidgets()
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 ...
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 ...
void SpawnCameraShakeProper(float strength, float radius, float smoothness, float radius_decay_speed)
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 const float RAD2DEG
static proto float AbsFloat(float f)
Returns absolute value.
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.
HumanInputControllerOverrideType