DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerCameraBase Class Reference

this is main camera class More...

Collaboration diagram for DayZPlayerCameraBase:
[legend]

Protected Member Functions

void DayZPlayerCameraIronsights (DayZPlayer pPlayer, HumanInputController pInput)
 
void SetupSightEntities ()
 
override void OnActivate (DayZPlayerCamera pPrevCamera, DayZPlayerCameraResult pPrevCameraResult)
 
EntityAI GetCurrentSightEntity ()
 
bool GetCurrentSightInfo (out vector camPos, out vector camDir)
 
override void OnUpdate (float pDt, out DayZPlayerCameraResult pOutResult)
 
override vector GetBaseAngles ()
 
override vector GetAdditiveAngles ()
 
void AdjustCameraParameters (float pDt, inout DayZPlayerCameraResult pOutResult)
 
float HoldBreathFOVEffect (float pDt)
 
override void SetCameraPP (bool state, DayZPlayerCamera launchedFrom)
 
override string GetCameraName ()
 
override void SetCameraPPDelay (DayZPlayerCamera pPrevCamera)
 
void UpdateBatteryOptics (EntityAI entity)
 

Protected Attributes

int m_iBoneIndex = -1
 main bone
 
vector m_OffsetLS
 position offset
 
float m_fUpDownAngle
 up down angle in rad
 
float m_fUpDownAngleAdd
 up down angle in rad
 
float m_fLeftRightAngle
 left right angle in rad (in freelook only)
 
float m_fLeftRightAngleAdd
 left right angle in rad (in freelook only)
 
vector m_CameraOffsetMS
 model space offset
 
vector m_CameraOffsetLS
 local space offset
 
float m_fDistance
 distance from start
 
float m_fShoulderWidth
 shoulder camera widths
 
bool m_bShoulderInLS
 true - shoulder is in local space
 
float m_fRoll
 camera roll (deprecated)
 
float m_fLeanDistance
 shift on leaning
 
float m_fCameraLRShoulder
 shoulder offsets
 
float m_fCameraLRShoulderVel [1]
 
float m_fPredictCollisionRadius
 collision prediction
 
ref HumanMovementState m_MovementState = new HumanMovementState()
 movement state
 
bool m_isEntering = false
 
bool m_opticsHasWeaponOverride = false
 
ref array< floattemp_array
 
PPERequester_CameraADS m_RequesterADS
 
float m_velocityYaw [1]
 camera dynamics
 
float m_velocityPitch [1]
 
float m_dynamicsStrength
 
float m_dynamicsSmoothTime
 
vector m_SightMisalignmentModifier
 
float m_movementTimeAcc
 
float m_movementAmplitudeX
 
float m_movementAmplitudeY
 
float m_movementFrequencyX
 
float m_movementFrequencyY
 
float m_fShootFromCamera = 0.0
 settings
 
vector m_OpticsCamPos
 
vector m_OpticsCamDir
 

Private Member Functions

void DayZPlayerCamera1stPerson (DayZPlayer pPlayer, HumanInputController pInput)
 
override void OnActivate (DayZPlayerCamera pPrevCamera, DayZPlayerCameraResult pPrevCameraResult)
 
override void OnUpdate (float pDt, out DayZPlayerCameraResult pOutResult)
 
override vector GetBaseAngles ()
 
override vector GetAdditiveAngles ()
 
override string GetCameraName ()
 
void DayZPlayerCamera3rdPerson (DayZPlayer pPlayer, HumanInputController pInput)
 
override void OnActivate (DayZPlayerCamera pPrevCamera, DayZPlayerCameraResult pPrevCameraResult)
 
override void OnUpdate (float pDt, out DayZPlayerCameraResult pOutResult)
 
override vector GetBaseAngles ()
 
override vector GetAdditiveAngles ()
 
override string GetCameraName ()
 

Static Private Attributes

static const float CONST_UD_MIN = -85.0
 down limit
 
static const float CONST_UD_MAX = 85.0
 up limit
 
static const float CONST_LR_MIN = -160.0
 down limit
 
static const float CONST_LR_MAX = 160.0
 up limit
 
static const float CONST_UD_MIN_BACK = -25.0
 down limit on back
 

Detailed Description

this is main camera class

Definition at line 4 of file DayZPlayerCamera1stPerson.c.

Member Function Documentation

◆ AdjustCameraParameters()

void DayZPlayerCameraBase::AdjustCameraParameters ( float pDt,
inout DayZPlayerCameraResult pOutResult )
inlineprotected

Definition at line 212 of file DayZPlayerCameraIronsights.c.

213 {
214 pOutResult.m_iDirectBone = m_iBoneIndex;
215 pOutResult.m_iDirectBoneMode = 4;
216
217 pOutResult.m_fFovAbsolute = HoldBreathFOVEffect(pDt);
218
219 pOutResult.m_bUpdateWhenBlendOut = false;
220 pOutResult.m_fDistance = 0;
221 pOutResult.m_fUseHeading = 0;
222 pOutResult.m_fInsideCamera = 1.0;
223 pOutResult.m_fShootFromCamera = m_fShootFromCamera;
224
225 pOutResult.m_fNearPlane = 0.04; //0.07 default
226 }

References HoldBreathFOVEffect(), m_fShootFromCamera, and m_iBoneIndex.

Referenced by OnUpdate().

◆ DayZPlayerCamera1stPerson()

void DayZPlayerCameraBase::DayZPlayerCamera1stPerson ( DayZPlayer pPlayer,
HumanInputController pInput )
inlineprivate

Definition at line 13 of file DayZPlayerCamera1stPerson.c.

14 {
15 m_iBoneIndex = pPlayer.GetBoneIndexByName("Head");
16 if (m_iBoneIndex == -1)
17 Print("DayZPlayerCamera1stPerson: main bone not found");
18
19 m_OffsetLS = "0.04 0.04 0"; //x - up, y - forward
20 }
vector m_OffsetLS
position offset
proto void Print(void var)
Prints content of variable to console/log.

References m_iBoneIndex, m_OffsetLS, and Print().

◆ DayZPlayerCamera3rdPerson()

void DayZPlayerCameraBase::DayZPlayerCamera3rdPerson ( DayZPlayer pPlayer,
HumanInputController pInput )
inlineprivate

Definition at line 12 of file DayZPlayerCamera3rdPerson.c.

13 {
14 if (pInput.Camera3rdIsRightShoulder())
16 else
18
22 m_fLeanDistance = 0.3;
24 }
float m_CurrentCameraRoll
float m_WeaponSwayModifier
float m_fLeanDistance
shift on leaning
float m_fCameraLRShoulder
shoulder offsets
float m_fPredictCollisionRadius
collision prediction

References m_CurrentCameraRoll, m_fCameraLRShoulder, m_fCameraLRShoulderVel, m_fLeanDistance, m_fPredictCollisionRadius, and m_WeaponSwayModifier.

◆ DayZPlayerCameraIronsights()

void DayZPlayerCameraBase::DayZPlayerCameraIronsights ( DayZPlayer pPlayer,
HumanInputController pInput )
inlineprotected

Definition at line 32 of file DayZPlayerCameraIronsights.c.

33 {
34 if (!temp_array)
36 m_iBoneIndex = pPlayer.GetBoneIndexByName("RightHand_Dummy");
37
38 if (m_iBoneIndex == -1)
39 Print("DayZPlayerCamera1stPerson: main bone not found");
40
43
46 m_isEntering = true;
48
54
56
57 Init();
58 }
override void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Super root of all classes in Enforce script.
Definition EnScript.c:11
PPERequester_CameraADS m_RequesterADS
bool GetCurrentSightInfo(out vector camPos, out vector camDir)
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), GetCurrentSightInfo(), Init(), m_iBoneIndex, m_WeaponSwayModifier, Print(), and SetupSightEntities().

◆ GetAdditiveAngles() [1/3]

override vector DayZPlayerCameraBase::GetAdditiveAngles ( )
inlineprivate

Definition at line 74 of file DayZPlayerCamera1stPerson.c.

75 {
76 vector a;
77 a[0] = m_fUpDownAngleAdd;
79 a[2] = 0;
80 return a;
81 }
float m_fLeftRightAngleAdd
left right angle in rad (in freelook only)
float m_fUpDownAngleAdd
up down angle in rad

References m_fLeftRightAngleAdd, and m_fUpDownAngleAdd.

◆ GetAdditiveAngles() [2/3]

override vector DayZPlayerCameraBase::GetAdditiveAngles ( )
inlineprivate

Definition at line 104 of file DayZPlayerCamera3rdPerson.c.

105 {
106 vector a;
107 a[0] = m_fUpDownAngleAdd;
109 a[2] = 0;
110 return a;
111 }

References m_fLeftRightAngleAdd, and m_fUpDownAngleAdd.

◆ GetAdditiveAngles() [3/3]

override vector DayZPlayerCameraBase::GetAdditiveAngles ( )
inlineprotected

Definition at line 203 of file DayZPlayerCameraIronsights.c.

204 {
205 vector a;
206 a[0] = m_fUpDownAngleAdd;
208 a[2] = 0;
209 return a;
210 }

References m_fLeftRightAngleAdd, and m_fUpDownAngleAdd.

◆ GetBaseAngles() [1/3]

override vector DayZPlayerCameraBase::GetBaseAngles ( )
inlineprivate

Definition at line 65 of file DayZPlayerCamera1stPerson.c.

66 {
67 vector a;
68 a[0] = m_fUpDownAngle;
69 a[1] = m_fLeftRightAngle;
70 a[2] = 0;
71 return a;
72 }
float m_fLeftRightAngle
left right angle in rad (in freelook only)
float m_fUpDownAngle
up down angle in rad

References m_fLeftRightAngle, and m_fUpDownAngle.

◆ GetBaseAngles() [2/3]

override vector DayZPlayerCameraBase::GetBaseAngles ( )
inlineprivate

Definition at line 95 of file DayZPlayerCamera3rdPerson.c.

96 {
97 vector a;
98 a[0] = m_fUpDownAngle;
99 a[1] = m_fLeftRightAngle;
100 a[2] = 0;
101 return a;
102 }

References m_fLeftRightAngle, and m_fUpDownAngle.

◆ GetBaseAngles() [3/3]

override vector DayZPlayerCameraBase::GetBaseAngles ( )
inlineprotected

Definition at line 194 of file DayZPlayerCameraIronsights.c.

195 {
196 vector a;
197 a[0] = m_fUpDownAngle;
198 a[1] = m_fLeftRightAngle;
199 a[2] = 0;
200 return a;
201 }

References m_fLeftRightAngle, and m_fUpDownAngle.

◆ GetCameraName() [1/3]

override string DayZPlayerCameraBase::GetCameraName ( )
inlineprivate

Definition at line 83 of file DayZPlayerCamera1stPerson.c.

84 {
85 return "DayZPlayerCamera1stPerson";
86 }

◆ GetCameraName() [2/3]

override string DayZPlayerCameraBase::GetCameraName ( )
inlineprivate

Definition at line 113 of file DayZPlayerCamera3rdPerson.c.

114 {
115 return "DayZPlayerCamera3rdPerson";
116 }

◆ GetCameraName() [3/3]

override string DayZPlayerCameraBase::GetCameraName ( )
inlineprotected

Definition at line 289 of file DayZPlayerCameraIronsights.c.

290 {
291 return "DayZPlayerCameraIronsights";
292 }

◆ GetCurrentSightEntity()

EntityAI DayZPlayerCameraBase::GetCurrentSightEntity ( )
inlineprotected

Definition at line 97 of file DayZPlayerCameraIronsights.c.

98 {
100 return m_opticsUsed;
101
102 return m_weaponUsed;
103 }
Weapon_Base m_weaponUsed
ItemOptics m_opticsUsed

References m_opticsUsed, and m_weaponUsed.

Referenced by GetCurrentSightInfo(), and OnUpdate().

◆ GetCurrentSightInfo()

bool DayZPlayerCameraBase::GetCurrentSightInfo ( out vector camPos,
out vector camDir )
inlineprotected

Definition at line 105 of file DayZPlayerCameraIronsights.c.

106 {
108 if (e)
109 {
110 if (e == m_weaponUsed)
111 {
112 m_weaponUsed.GetCameraPoint(m_weaponUsed.GetCurrentMuzzle(), camPos, camDir);
113 return true;
114 }
115 else if (e == m_opticsUsed)
116 {
119 return true;
120 }
121 }
122 else
123 ErrorEx("No sight entity found in " + this, ErrorExSeverity.INFO);
124 return false;
125 }
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
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx

References ErrorEx, ItemOptics::GetCameraPoint(), GetCurrentSightEntity(), m_opticsUsed, m_weaponUsed, and ItemOptics::UseWeaponIronsightsOverride().

Referenced by DayZPlayerCameraIronsights().

◆ HoldBreathFOVEffect()

float DayZPlayerCameraBase::HoldBreathFOVEffect ( float pDt)
inlineprotected

Definition at line 228 of file DayZPlayerCameraIronsights.c.

229 {
230 if (m_pPlayer.IsHoldingBreath())
232 else if (m_isEntering) //sets FOV immediatelly to avoid "floating camera" effect
233 {
235 m_isEntering = false;
236 }
237 else
239
240 return m_fFovAbsolute;
241 }
float m_fFovAbsVel[1]
Definition EnMath.c:7
DayZPlayer m_pPlayer
data
Definition dayzplayer.c:135
float m_fFovAbsolute
fov absolute value override - -1.0 default, if set - overrides absolute fov setting
Definition dayzplayer.c:60
const float DZPLAYER_CAMERA_FOV_EYEZOOM
FOV (vertical angle/2) in radians. Take care to modify also in "basicDefines.hpp".
Definition constants.c:834
const float DZPLAYER_CAMERA_FOV_IRONSIGHTS
Definition constants.c:836
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.

References GameConstants::DZPLAYER_CAMERA_FOV_EYEZOOM, GameConstants::DZPLAYER_CAMERA_FOV_IRONSIGHTS, m_fFovAbsolute, m_fFovAbsVel, m_pPlayer, and Math::SmoothCD().

Referenced by AdjustCameraParameters().

◆ OnActivate() [1/3]

override void DayZPlayerCameraBase::OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
inlineprivate

Definition at line 24 of file DayZPlayerCamera1stPerson.c.

25 {
27
28 if (pPrevCamera)
29 {
30 vector baseAngles = pPrevCamera.GetBaseAngles();
33
34 vector addAngles = pPrevCamera.GetAdditiveAngles();
37 }
38 }

References m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle, and m_fUpDownAngleAdd.

◆ OnActivate() [2/3]

override void DayZPlayerCameraBase::OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
inlineprivate

Definition at line 28 of file DayZPlayerCamera3rdPerson.c.

29 {
31
32 if (pPrevCamera)
33 {
34 vector baseAngles = pPrevCamera.GetBaseAngles();
37
38 vector addAngles = pPrevCamera.GetAdditiveAngles();
41 }
42 }

References m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle, and m_fUpDownAngleAdd.

◆ OnActivate() [3/3]

override void DayZPlayerCameraBase::OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
inlineprotected

Definition at line 81 of file DayZPlayerCameraIronsights.c.

82 {
84
85 if (pPrevCamera)
86 {
87 vector baseAngles = pPrevCamera.GetBaseAngles();
90
91 vector addAngles = pPrevCamera.GetAdditiveAngles();
94 }
95 }

References m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle, and m_fUpDownAngleAdd.

◆ OnUpdate() [1/3]

override void DayZPlayerCameraBase::OnUpdate ( float pDt,
out DayZPlayerCameraResult pOutResult )
inlineprivate

update angles from input

Definition at line 41 of file DayZPlayerCamera1stPerson.c.

42 {
46
49 pOutResult.m_CameraTM[3] = m_OffsetLS;
50
51 pOutResult.m_iDirectBone = m_iBoneIndex;
52 pOutResult.m_iDirectBoneMode = 1;
53 pOutResult.m_fUseHeading = 1.0;
54 pOutResult.m_fInsideCamera = 1.0;
55
56 pOutResult.m_fNearPlane = 0.04; //0.07 default
57
59
63 }
float UpdateLRAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
float m_CurrentCameraYaw
float m_CurrentCameraPitch
float UpdateUDAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
void StdFovUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
void InitCameraOnPlayer(bool force=false)
void UpdateCameraNV(PlayerBase player)
void ProcessCameraShake(float delta, out float leftRight, out float upDown)
static const float CONST_LR_MIN
down limit
static const float CONST_UD_MAX
up limit
static const float CONST_UD_MIN
down limit
static const float CONST_LR_MAX
up limit
vector GetCurrentOrientation()
Definition dayzplayer.c:112
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.

References CONST_LR_MAX, CONST_LR_MIN, CONST_UD_MAX, CONST_UD_MIN, GetCurrentOrientation(), InitCameraOnPlayer(), m_CurrentCameraPitch, m_CurrentCameraYaw, m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle, m_fUpDownAngleAdd, m_iBoneIndex, m_OffsetLS, m_pPlayer, ProcessCameraShake(), StdFovUpdate(), UpdateCameraNV(), UpdateLRAngleUnlocked(), UpdateUDAngleUnlocked(), and Math3D::YawPitchRollMatrix().

◆ OnUpdate() [2/3]

override void DayZPlayerCameraBase::OnUpdate ( float pDt,
out DayZPlayerCameraResult pOutResult )
inlineprivate

update angles from input

base bone pos

apply shoulder dist

store distance

Definition at line 45 of file DayZPlayerCamera3rdPerson.c.

46 {
47 m_pPlayer.GetMovementState(m_MovementState);
48
52
54
55 // update l/r offsets and set it as
58 else
60
62
65
67 if (m_iBoneIndex != -1)
68 pOutResult.m_CameraTM[3] = m_pPlayer.GetBonePositionMS(m_iBoneIndex);
69 else
70 pOutResult.m_CameraTM[3] = "0 0 0";
71
75
78 else
80
81 // ls offset + ms offset + shoulder width
82 pOutResult.m_CameraTM[3] = pOutResult.m_CameraTM[3] + pOutResult.m_CameraTM[0] * lsOffset[0] + pOutResult.m_CameraTM[1] * lsOffset[1] + pOutResult.m_CameraTM[2] * lsOffset[2] + msOffset;
83
85 pOutResult.m_fDistance = m_fDistance;
86 pOutResult.m_fUseHeading = 1.0;
87 pOutResult.m_fInsideCamera = 0.0;
88 pOutResult.m_fPredictCollisionRadius = m_fPredictCollisionRadius;
89
93 }
vector m_CameraOffsetMS
model space offset
bool m_bShoulderInLS
true - shoulder is in local space
float m_fShoulderWidth
shoulder camera widths
vector m_CameraOffsetLS
local space offset
float m_fDistance
distance from start
ref HumanMovementState m_MovementState
movement state
proto native bool Camera3rdIsRightShoulder()
returns true if camera is on right/ false-left shoulder
HumanInputController m_pInput
human input
Definition dayzplayer.c:136

References HumanInputController::Camera3rdIsRightShoulder(), CONST_LR_MAX, CONST_LR_MIN, CONST_UD_MAX, CONST_UD_MIN, GetCurrentOrientation(), InitCameraOnPlayer(), m_bShoulderInLS, m_CameraOffsetLS, m_CameraOffsetMS, m_CurrentCameraPitch, m_CurrentCameraYaw, m_fCameraLRShoulder, m_fCameraLRShoulderVel, m_fDistance, m_fLeanDistance, m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fPredictCollisionRadius, m_fShoulderWidth, m_fUpDownAngle, m_fUpDownAngleAdd, m_iBoneIndex, m_MovementState, m_pInput, m_pPlayer, ProcessCameraShake(), Math::SmoothCD(), StdFovUpdate(), UpdateCameraNV(), UpdateLRAngleUnlocked(), UpdateUDAngleUnlocked(), and Math3D::YawPitchRollMatrix().

◆ OnUpdate() [3/3]

override void DayZPlayerCameraBase::OnUpdate ( float pDt,
out DayZPlayerCameraResult pOutResult )
inlineprotected

update angles from input

Definition at line 128 of file DayZPlayerCameraIronsights.c.

129 {
131 float min;
133 if (player && player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_RAISEDPRONE))
135 else
137
140
141 // get model space transform matrix of the gun's eye vector
142 vector matTM[4];
143 HumanItemAccessor hia = m_pPlayer.GetItemAccessor();
145 hia.WeaponGetCameraPointBoneRelative(GetCurrentSightEntity(), m_OpticsCamPos, m_OpticsCamDir, m_iBoneIndex, matTM);
146
147 // aim change based on character movement
151
152 HumanCommandMove hcm = m_pPlayer.GetCommand_Move();
153 if (hcm)
154 {
155 float speed = hcm.GetCurrentMovementSpeed();
156
157 if (speed > 0)
159 else
161
164 }
165
168 aimChangeYPR[2] = 0;
169
170 vector dynamics[4];
172 dynamics[3] = vector.Zero;
173
174 // aiming model offsets
176 hia.WeaponGetAimingModelDirTm(aimingMatTM);
177
178 // final offset matrix
181
185
186 if (m_CameraShake)
187 {
188 float x, y;
189 m_CameraShake.Update(pDt, x, y);
190 DayZPlayerImplement.Cast(m_pPlayer).GetAimingModel().SetCamShakeValues(x, y);
191 }
192 }
ref CameraShake m_CameraShake
Icon x
Icon y
PlayerBase GetPlayer()
static const float CONST_UD_MIN_BACK
down limit on back
void AdjustCameraParameters(float pDt, inout DayZPlayerCameraResult pOutResult)
float m_velocityYaw[1]
camera dynamics
void UpdateBatteryOptics(EntityAI entity)
proto native vector GetAimDelta(float dt)
returns aim change (in radians)
static const vector Zero
Definition EnConvert.c:110
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
static proto void MatrixMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Transforms matrix.
static const float PI2
Definition EnMath.c:13
static proto float Sin(float angle)
Returns sinus of angle in radians.
static const float RAD2DEG
Definition EnMath.c:16
void HumanItemAccessor()
Definition humanitems.c:135

References AdjustCameraParameters(), CONST_LR_MAX, CONST_LR_MIN, CONST_UD_MAX, CONST_UD_MIN, CONST_UD_MIN_BACK, HumanInputController::GetAimDelta(), GetCurrentSightEntity(), GetGame(), GetPlayer(), HumanItemAccessor(), m_CameraShake, m_CurrentCameraPitch, m_CurrentCameraYaw, m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle, m_fUpDownAngleAdd, m_iBoneIndex, m_pInput, m_pPlayer, Math3D::MatrixMultiply4(), Math::PI2, Math::RAD2DEG, Math::Sin(), Math::SmoothCD(), UpdateBatteryOptics(), UpdateCameraNV(), UpdateLRAngleUnlocked(), UpdateUDAngleUnlocked(), x, y, Math3D::YawPitchRollMatrix(), and vector::Zero.

◆ SetCameraPP()

override void DayZPlayerCameraBase::SetCameraPP ( bool state,
DayZPlayerCamera launchedFrom )
inlineprotected

Definition at line 244 of file DayZPlayerCameraIronsights.c.

245 {
246 //Print("SetCameraPP - ADS");
247 if (PlayerBase.Cast(m_pPlayer) && launchedFrom.Type() != PlayerBase.Cast(m_pPlayer).GetCurrentPlayerCamera().Type())
248 {
249 //Print("DayZPlayerCameraIronsights | SetCameraPP | skipping, wrong camera type active!");
250 return;
251 }
252
253 //if (!state || !m_weaponUsed || (PlayerBase.Cast(m_pPlayer) && launchedFrom != PlayerBase.Cast(m_pPlayer).GetCurrentPlayerCamera()))
254 if (!state || !m_weaponUsed)
255 {
256 m_RequesterADS.Stop();
257
258 if (IsCameraNV())
260 else
262 }
263 else
264 {
265 temp_array = {false, 0.0, 0.0, 0.0, 0.0, 1.0};
266
267 if (m_weaponUsed.GetWeaponDOF() || (m_opticsUsed && m_opticsUsed.GetOpticsDOF()))
268 {
269 if (m_opticsUsed && m_opticsUsed.GetOpticsDOF().Count() == 6)
271 else
272 temp_array = m_weaponUsed.GetWeaponDOF();
273 if (temp_array.Count() != 6)
274 temp_array = {false, 0.0, 0.0, 0.0, 0.0, 1.0};
275 }
276
277 m_RequesterADS.SetValuesIronsights(temp_array); //DOF only
278
279 if (IsCameraNV())
281 else
283 }
284
285 if (m_weaponUsed)
286 m_weaponUsed.HideWeaponBarrel(false);
287 }
bool IsCameraNV()
void SetNVPostprocess(int NVtype)
DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::Get...
int GetCameraNVType()
ref array< float > GetOpticsDOF()
Definition ItemOptics.c:451

References GetCameraNVType(), ItemOptics::GetOpticsDOF(), IsCameraNV(), m_opticsUsed, m_pPlayer, m_weaponUsed, and SetNVPostprocess().

Referenced by OnActivate(), and UpdateCameraNV().

◆ SetCameraPPDelay()

override void DayZPlayerCameraBase::SetCameraPPDelay ( DayZPlayerCamera pPrevCamera)
inlineprotected

Definition at line 294 of file DayZPlayerCameraIronsights.c.

295 {
296 if (pPrevCamera.GetCameraName() == "DayZPlayerCamera1stPerson")
297 {
298 //Print("---ironsights---DayZPlayerCamera1stPerson");
300 }
301 else if (pPrevCamera.GetCameraName() == "DayZPlayerCameraOptics")
302 m_CameraPPDelay = 0;
303 else
304 {
305 //Print("---ironsights---else");
307 }
308 }
float m_CameraPPDelay
static const float TIME_CAMERACHANGE_02
static const float TIME_CAMERACHANGE_01
for two handed items

References m_CameraPPDelay, DayZPlayerCameras::TIME_CAMERACHANGE_01, and DayZPlayerCameras::TIME_CAMERACHANGE_02.

Referenced by OnActivate().

◆ SetupSightEntities()

void DayZPlayerCameraBase::SetupSightEntities ( )
inlineprotected

Definition at line 60 of file DayZPlayerCameraIronsights.c.

61 {
62 EntityAI inHands = m_pPlayer.GetHumanInventory().GetEntityInHands();
63 if (inHands)
64 {
66 if (m_weaponUsed)
67 {
68 m_SightMisalignmentModifier = m_weaponUsed.GetPropertyModifierObject().m_SightMisalignment;
71 m_opticsUsed = m_weaponUsed.GetAttachedOptics();
72 if (m_opticsUsed)
74 }
75 else
77 }
78 }
proto native bool HasWeaponIronsightsOverride()
is weapon in optics mode or not

References ItemOptics::HasWeaponIronsightsOverride(), m_opticsUsed, m_pPlayer, and m_weaponUsed.

Referenced by DayZPlayerCameraIronsights().

◆ UpdateBatteryOptics()

void DayZPlayerCameraBase::UpdateBatteryOptics ( EntityAI entity)
inlineprotected

Definition at line 310 of file DayZPlayerCameraIronsights.c.

311 {
313 if (optics)
314 optics.UpdateOpticsReddotVisibility();
315 }

Referenced by OnUpdate().

Member Data Documentation

◆ CONST_LR_MAX

static const float DayZPlayerCameraBase::CONST_LR_MAX = 160.0
staticprivate

up limit

Definition at line 10 of file DayZPlayerCamera1stPerson.c.

◆ CONST_LR_MIN

static const float DayZPlayerCameraBase::CONST_LR_MIN = -160.0
staticprivate

down limit

Definition at line 9 of file DayZPlayerCamera1stPerson.c.

◆ CONST_UD_MAX

static const float DayZPlayerCameraBase::CONST_UD_MAX = 85.0
staticprivate

up limit

Definition at line 7 of file DayZPlayerCamera1stPerson.c.

◆ CONST_UD_MIN

static const float DayZPlayerCameraBase::CONST_UD_MIN = -85.0
staticprivate

down limit

Definition at line 6 of file DayZPlayerCamera1stPerson.c.

Referenced by OnUpdate().

◆ CONST_UD_MIN_BACK

const float DayZPlayerCameraBase::CONST_UD_MIN_BACK = -25.0
staticprivate

down limit on back

Definition at line 7 of file DayZPlayerCameraIronsights.c.

Referenced by OnUpdate().

◆ m_bShoulderInLS

bool DayZPlayerCameraBase::m_bShoulderInLS
protected

true - shoulder is in local space

Definition at line 124 of file DayZPlayerCamera3rdPerson.c.

◆ m_CameraOffsetLS

vector DayZPlayerCameraBase::m_CameraOffsetLS
protected

local space offset

Definition at line 121 of file DayZPlayerCamera3rdPerson.c.

Referenced by OnUpdate().

◆ m_CameraOffsetMS

vector DayZPlayerCameraBase::m_CameraOffsetMS
protected

model space offset

Definition at line 120 of file DayZPlayerCamera3rdPerson.c.

Referenced by OnUpdate(), and OnUpdate().

◆ m_dynamicsSmoothTime

float DayZPlayerCameraBase::m_dynamicsSmoothTime
protected

Definition at line 22 of file DayZPlayerCameraIronsights.c.

◆ m_dynamicsStrength

float DayZPlayerCameraBase::m_dynamicsStrength
protected

Definition at line 21 of file DayZPlayerCameraIronsights.c.

◆ m_fCameraLRShoulder

float DayZPlayerCameraBase::m_fCameraLRShoulder
protected

shoulder offsets

Definition at line 136 of file DayZPlayerCamera3rdPerson.c.

◆ m_fCameraLRShoulderVel

float DayZPlayerCameraBase::m_fCameraLRShoulderVel[1]
protected

Definition at line 137 of file DayZPlayerCamera3rdPerson.c.

◆ m_fDistance

float DayZPlayerCameraBase::m_fDistance
protected

distance from start

Definition at line 122 of file DayZPlayerCamera3rdPerson.c.

Referenced by OnUpdate(), and OnUpdate().

◆ m_fLeanDistance

float DayZPlayerCameraBase::m_fLeanDistance
protected

shift on leaning

Definition at line 126 of file DayZPlayerCamera3rdPerson.c.

Referenced by OnUpdate().

◆ m_fLeftRightAngle

float DayZPlayerCameraBase::m_fLeftRightAngle
protected

left right angle in rad (in freelook only)

Definition at line 93 of file DayZPlayerCamera1stPerson.c.

Referenced by GetBaseAngles(), and GetBaseAngles().

◆ m_fLeftRightAngleAdd

float DayZPlayerCameraBase::m_fLeftRightAngleAdd
protected

left right angle in rad (in freelook only)

Definition at line 94 of file DayZPlayerCamera1stPerson.c.

Referenced by GetAdditiveAngles(), and GetAdditiveAngles().

◆ m_fPredictCollisionRadius

float DayZPlayerCameraBase::m_fPredictCollisionRadius
protected

collision prediction

Definition at line 140 of file DayZPlayerCamera3rdPerson.c.

Referenced by OnUpdate().

◆ m_fRoll

float DayZPlayerCameraBase::m_fRoll
protected

camera roll (deprecated)

Definition at line 125 of file DayZPlayerCamera3rdPerson.c.

◆ m_fShootFromCamera

float DayZPlayerCameraBase::m_fShootFromCamera = 0.0
protected

settings

Definition at line 318 of file DayZPlayerCameraIronsights.c.

Referenced by AdjustCameraParameters().

◆ m_fShoulderWidth

float DayZPlayerCameraBase::m_fShoulderWidth
protected

shoulder camera widths

Definition at line 123 of file DayZPlayerCamera3rdPerson.c.

◆ m_fUpDownAngle

float DayZPlayerCameraBase::m_fUpDownAngle
protected

up down angle in rad

runtime values

up down angle in rad

Definition at line 91 of file DayZPlayerCamera1stPerson.c.

Referenced by GetBaseAngles(), and GetBaseAngles().

◆ m_fUpDownAngleAdd

float DayZPlayerCameraBase::m_fUpDownAngleAdd
protected

up down angle in rad

Definition at line 92 of file DayZPlayerCamera1stPerson.c.

Referenced by GetAdditiveAngles(), and GetAdditiveAngles().

◆ m_iBoneIndex

int DayZPlayerCameraBase::m_iBoneIndex = -1
protected

main bone

runtime values

runtime config

main bone

right hand dummy bone index

Definition at line 88 of file DayZPlayerCamera1stPerson.c.

Referenced by AdjustCameraParameters().

◆ m_isEntering

bool DayZPlayerCameraBase::m_isEntering = false
protected

Definition at line 12 of file DayZPlayerCameraIronsights.c.

◆ m_movementAmplitudeX

float DayZPlayerCameraBase::m_movementAmplitudeX
protected

Definition at line 26 of file DayZPlayerCameraIronsights.c.

◆ m_movementAmplitudeY

float DayZPlayerCameraBase::m_movementAmplitudeY
protected

Definition at line 27 of file DayZPlayerCameraIronsights.c.

◆ m_movementFrequencyX

float DayZPlayerCameraBase::m_movementFrequencyX
protected

Definition at line 28 of file DayZPlayerCameraIronsights.c.

◆ m_movementFrequencyY

float DayZPlayerCameraBase::m_movementFrequencyY
protected

Definition at line 29 of file DayZPlayerCameraIronsights.c.

◆ m_MovementState

ref HumanMovementState DayZPlayerCameraBase::m_MovementState = new HumanMovementState()
protected

movement state

Definition at line 143 of file DayZPlayerCamera3rdPerson.c.

◆ m_movementTimeAcc

float DayZPlayerCameraBase::m_movementTimeAcc
protected

Definition at line 25 of file DayZPlayerCameraIronsights.c.

◆ m_OffsetLS

vector DayZPlayerCameraBase::m_OffsetLS
protected

position offset

Definition at line 89 of file DayZPlayerCamera1stPerson.c.

◆ m_OpticsCamDir

vector DayZPlayerCameraBase::m_OpticsCamDir
protected

Definition at line 323 of file DayZPlayerCameraIronsights.c.

◆ m_OpticsCamPos

vector DayZPlayerCameraBase::m_OpticsCamPos
protected

Definition at line 322 of file DayZPlayerCameraIronsights.c.

◆ m_opticsHasWeaponOverride

bool DayZPlayerCameraBase::m_opticsHasWeaponOverride = false
protected

Definition at line 13 of file DayZPlayerCameraIronsights.c.

◆ m_RequesterADS

PPERequester_CameraADS DayZPlayerCameraBase::m_RequesterADS
protected

Definition at line 16 of file DayZPlayerCameraIronsights.c.

◆ m_SightMisalignmentModifier

vector DayZPlayerCameraBase::m_SightMisalignmentModifier
protected

Definition at line 23 of file DayZPlayerCameraIronsights.c.

◆ m_velocityPitch

float DayZPlayerCameraBase::m_velocityPitch[1]
protected

Definition at line 20 of file DayZPlayerCameraIronsights.c.

◆ m_velocityYaw

float DayZPlayerCameraBase::m_velocityYaw[1]
protected

camera dynamics

Definition at line 19 of file DayZPlayerCameraIronsights.c.

◆ temp_array

ref array<float> DayZPlayerCameraBase::temp_array
protected

Definition at line 14 of file DayZPlayerCameraIronsights.c.


The documentation for this class was generated from the following files: