1 float Limit(
float pV,
float pMin,
float pMax)
4 if (pV >= pMin && pV <= pMax)
21 while (pAngle >
Math.PI)
27 while (pAngle < -
Math.PI)
122 if ( player && player.IsNVGWorking() !=
IsCameraNV() )
142 if (
Math.AbsFloat(pAngleAdd) > 0.001)
144 pAngleAdd = pAngle + pAngleAdd - target;
150 pAngleAdd +=
m_pInput.GetAimDelta(pDt)[1] *
Math.RAD2DEG;
165 pAngle =
Limit(pAngle, pMin, pMax);
166 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
167 return pAngle + pAngleAdd;
183 if (
Math.AbsFloat(pAngleAdd) > 0.001)
185 pAngleAdd = pAngle + pAngleAdd - target;
191 pAngleAdd +=
m_pInput.GetAimDelta(pDt)[0] *
Math.RAD2DEG;
200 pAngleAdd = pAngleAdd + pAngle;
203 pAngle =
Limit(pAngle, pMin, pMax);
204 pAngleAdd =
Limit(pAngle + pAngleAdd, pMin, pMax) - pAngle;
206 return pAngle + pAngleAdd;
209 float UpdateUDAngle(out
float pAngle, out
float pAngleAdd,
float pMin,
float pMax,
float pDt)
211 if (
Math.AbsFloat(pAngleAdd) > 0.001)
219 pAngleAdd = pAngle + pAngleAdd - aimingUDAngle;
220 pAngle = aimingUDAngle;
229 pAngleAdd =
Limit(pAngleAdd, pMin, pMax);
238 pAngleAdd =
Limit(pAngleAdd, pMin, pMax);
246 pAngle =
Limit(pAngle, pMin, pMax);
258 return Limit(pAngle + pAngleAdd, pMin, pMax);
268 pAngle =
Limit(pAngle, pMin, pMax);
278 pAngle =
Limit(-pAngle, pMin, pMax);
320 pOutResult.m_fShootFromCamera = 0.0;
333 Debug.Log(
"DayZPlayerCameraBase | OnUpdate | no player!");
343 super.OnUpdate(pDt, pOutResult);
352 SetCameraPPDelay(pPrevCamera);
356 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_TRANSITIVE) );
372 override string GetCameraName()
374 return "DayZPlayerCameraBase";
410 SetCameraPP(
true,
this);
417 PPERequesterBank.GetRequester(PPERequester_CameraADS).Stop();
464 PPERequesterBank.GetRequester(PPERequester_CameraNV).Stop();
465 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
467 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
468 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
474 case NVTypes.NV_OPTICS_KAZUAR_NIGHT:
475 case NVTypes.NV_OPTICS_STARLIGHT_NIGHT:
478 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_OPTICS) );
479 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
481 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
482 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
488 case NVTypes.NV_OPTICS_KAZUAR_DAY:
489 case NVTypes.NV_OPTICS_STARLIGHT_DAY:
491 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DAYTIME_OPTICS) );
492 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
494 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
495 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
503 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_NO_BATTERY) );
504 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
506 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
507 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
514 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_DEFAULT_GLASSES) );
515 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
517 GetGame().GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
518 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
525 PPERequesterBank.GetRequester(PPERequesterBank.REQ_CAMERANV).Start(
new Param1<int>(PPERequester_CameraNV.NV_PUMPKIN) );
526 if (
GetGame().GetMission() &&
GetGame().GetMission().GetEffectWidgets())
528 GetGame().GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.PUMPKIN_OCCLUDER});
529 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.NVG_OCCLUDER});
544 if (!player.GetCurrentPlayerCamera() || (force && player.GetCurrentPlayerCamera() !=
this))
546 player.OnCameraChanged(
this);