7 static const float CONST_UD_MIN_BACK = -25.0;
12 protected bool m_isEntering =
false;
13 protected bool m_opticsHasWeaponOverride =
false;
19 float m_velocityYaw[1];
20 float m_velocityPitch[1];
39 Print(
"DayZPlayerCamera1stPerson: main bone not found");
41 m_dynamicsStrength = 2;
42 m_dynamicsSmoothTime = 0.3;
49 m_movementTimeAcc = 0;
50 m_movementAmplitudeX = 1;
51 m_movementAmplitudeY = 1;
52 m_movementFrequencyX = 1;
53 m_movementFrequencyY = 2;
68 m_SightMisalignmentModifier =
m_weaponUsed.GetPropertyModifierObject().m_SightMisalignment;
69 m_dynamicsStrength = m_dynamicsStrength * m_SightMisalignmentModifier[0];
70 m_dynamicsSmoothTime = m_dynamicsSmoothTime * m_SightMisalignmentModifier[1];
99 if (m_opticsHasWeaponOverride)
155 float speed =
hcm.GetCurrentMovementSpeed();
158 m_movementTimeAcc +=
pDt;
160 m_movementTimeAcc = 0;
232 else if (m_isEntering)
235 m_isEntering =
false;
256 m_RequesterADS.Stop();
265 temp_array = {
false, 0.0, 0.0, 0.0, 0.0, 1.0};
273 if (temp_array.Count() != 6)
274 temp_array = {
false, 0.0, 0.0, 0.0, 0.0, 1.0};
277 m_RequesterADS.SetValuesIronsights(temp_array);
291 return "DayZPlayerCameraIronsights";
296 if (
pPrevCamera.GetCameraName() ==
"DayZPlayerCamera1stPerson")
301 else if (
pPrevCamera.GetCameraName() ==
"DayZPlayerCameraOptics")
314 optics.UpdateOpticsReddotVisibility();
408 else if (m_isEntering)
411 m_isEntering =
false;
438 m_RequesterADS.Stop();
453 temp_array = {
false, 0.0, 0.0, 0.0, 0.0, 1.0};
467 if (temp_array.Count() != 6)
468 temp_array = {
false, 0.0, 0.0, 0.0, 0.0, 1.0};
471 m_RequesterADS.SetValuesIronsights(temp_array);
522 return "DayZPlayerCameraOptics";
527 if (
pPrevCamera.GetCameraName() ==
"DayZPlayerCameraIronsights")
529 else if (
pPrevCamera.GetCameraName() ==
"DayZPlayerCamera1stPerson")
int m_iBoneIndex
main bone
float m_fLeftRightAngle
left right angle in rad (in freelook only)
float m_fUpDownAngle
up down angle in rad
static const float CONST_UD_MAX
up limit
float m_fLeftRightAngleAdd
left right angle in rad (in freelook only)
float m_fUpDownAngleAdd
up down angle in rad
static const float CONST_LR_MIN
down limit
static const float CONST_LR_MAX
up limit
static const float CONST_UD_MIN
down limit
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 SetNVPostprocess(int NVtype)
DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::Get...
void SetCameraPP(bool state, DayZPlayerCamera launchedFrom)
by default sets camera PP to zero, regardless of parameter. Override if needed.
void SetCameraNV(bool nightvision)
float m_WeaponSwayModifier
void UpdateCameraNV(PlayerBase player)
void SetCameraPPDelay(DayZPlayerCamera pPrevCamera)
void DayZPlayerCameraOptics(DayZPlayer pPlayer, HumanInputController pInput)
override bool GetCurrentSightInfo(out vector camPos, out vector camDir)
override float HoldBreathFOVEffect(float pDt)
override EntityAI GetCurrentSightEntity()
override void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
override void AdjustCameraParameters(float pDt, inout DayZPlayerCameraResult pOutResult)
class DayZPlayerCameraIronsights extends DayZPlayerCameraBase CONST_NEARPLANE_OPTICS
Super root of all classes in Enforce script.
this is main camera class
EntityAI GetCurrentSightEntity()
void SetupSightEntities()
float m_movementFrequencyY
float m_fLeftRightAngleAdd
left right angle in rad (in freelook only)
override void SetCameraPP(bool state, DayZPlayerCamera launchedFrom)
override void SetCameraPPDelay(DayZPlayerCamera pPrevCamera)
float m_movementFrequencyX
override vector GetAdditiveAngles()
float m_dynamicsSmoothTime
float m_movementAmplitudeY
ref array< float > temp_array
float m_fShootFromCamera
settings
static const float CONST_UD_MIN_BACK
down limit on back
PPERequester_CameraADS m_RequesterADS
override vector GetBaseAngles()
float m_movementAmplitudeX
override void OnActivate(DayZPlayerCamera pPrevCamera, DayZPlayerCameraResult pPrevCameraResult)
override string GetCameraName()
int m_iBoneIndex
main bone
void AdjustCameraParameters(float pDt, inout DayZPlayerCameraResult pOutResult)
vector m_SightMisalignmentModifier
bool GetCurrentSightInfo(out vector camPos, out vector camDir)
static const float CONST_UD_MIN
down limit
void DayZPlayerCameraIronsights(DayZPlayer pPlayer, HumanInputController pInput)
override void OnUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
float m_fUpDownAngleAdd
up down angle in rad
float m_fLeftRightAngle
left right angle in rad (in freelook only)
float HoldBreathFOVEffect(float pDt)
void UpdateBatteryOptics(EntityAI entity)
float m_fUpDownAngle
up down angle in rad
static const float TIME_CAMERACHANGE_03
static const float TIME_CAMERACHANGE_02
static const float TIME_CAMERACHANGE_01
for two handed items
override int GetEyeZoomLevel()
ref array< float > GetOpticsPPLens()
bool AllowsDOF()
returns 'true' for non-magnifying optics
ref array< float > GetOpticsPPMask()
float GetNearPlaneValue()
proto native bool UseWeaponIronsightsOverride(bool state)
switches into ironsights override settings
proto native void GetCameraPoint(out vector pos, out vector dir)
gets camera position & direction in model space of optics entity
ref array< float > GetOpticsDOF()
proto native bool HasWeaponIronsightsOverride()
is weapon in optics mode or not
DayZPlayerConstants
defined in C++
void SendRecoilOffsetZ(float offset)
m_fCamPosOffsetZ info, used to adjust near plane in DayZPlayerCameraIronsights now
HumanInputController m_pInput
human input
float m_fShootFromCamera
1(default) - uses shoot from camera (+aiming sway), 0 pure weapon shoot (ironsights == 0)
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()
proto void Print(void var)
Prints content of variable to console/log.
const float DZPLAYER_CAMERA_FOV_EYEZOOM
FOV (vertical angle/2) in radians. Take care to modify also in "basicDefines.hpp".
const float DZPLAYER_CAMERA_FOV_IRONSIGHTS
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto void MatrixMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Transforms matrix.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Sin(float angle)
Returns sinus of angle in radians.
static const float RAD2DEG
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.
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.