DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс DayZPlayerCameraBase

this is main camera class Подробнее...

Защищенные члены

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)
 

Защищенные данные

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
 

Закрытые члены

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 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
 

Подробное описание

this is main camera class

Методы

◆ AdjustCameraParameters()

void AdjustCameraParameters ( float pDt,
inout DayZPlayerCameraResult pOutResult )
inlineprotected
221 {
222 pOutResult.m_iDirectBone = m_iBoneIndex;
223 pOutResult.m_iDirectBoneMode = 4;
224
225 pOutResult.m_fFovAbsolute = HoldBreathFOVEffect(pDt);
226
227 pOutResult.m_bUpdateWhenBlendOut = false;
228 pOutResult.m_fDistance = 0;
229 pOutResult.m_fUseHeading = 0;
230 pOutResult.m_fInsideCamera = 1.0;
231 pOutResult.m_fShootFromCamera = m_fShootFromCamera;
232
233 pOutResult.m_fNearPlane = 0.04; //0.07 default
234 }
int m_iBoneIndex
main bone
Definition DayZPlayerCamera1stPerson.c:90
float HoldBreathFOVEffect(float pDt)
Definition DayZPlayerCameraIronsights.c:236
float m_fShootFromCamera
settings
Definition DayZPlayerCameraIronsights.c:346
Definition EntityAI.c:95

Перекрестные ссылки HoldBreathFOVEffect(), m_fShootFromCamera и m_iBoneIndex.

Используется в OnUpdate().

◆ DayZPlayerCamera1stPerson()

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

Перекрестные ссылки m_iBoneIndex, m_OffsetLS и Print().

◆ DayZPlayerCamera3rdPerson()

void DayZPlayerCamera3rdPerson ( DayZPlayer pPlayer,
HumanInputController pInput )
inlineprivate
13 {
14 if (pInput.Camera3rdIsRightShoulder())
15 {
17 }
18 else
19 {
21 }
22
26 m_fLeanDistance = 0.3;
28 }
float m_CurrentCameraRoll
Definition DayZPlayerCamera_Base.c:580
float m_WeaponSwayModifier
Definition DayZPlayerCamera_Base.c:575
float m_fPredictCollisionRadius
collision prediction
Definition DayZPlayerCamera3rdPerson.c:156
float m_fCameraLRShoulder
shoulder offsets
Definition DayZPlayerCamera3rdPerson.c:152
float m_fCameraLRShoulderVel[1]
Definition DayZPlayerCamera3rdPerson.c:153
float m_fLeanDistance
shift on leaning
Definition DayZPlayerCamera3rdPerson.c:142

Перекрестные ссылки m_CurrentCameraRoll, m_fCameraLRShoulder, m_fCameraLRShoulderVel, m_fLeanDistance, m_fPredictCollisionRadius и m_WeaponSwayModifier.

◆ DayZPlayerCameraIronsights()

void DayZPlayerCameraIronsights ( DayZPlayer pPlayer,
HumanInputController pInput )
inlineprotected
33 {
34 if (!temp_array)
36 m_iBoneIndex = pPlayer.GetBoneIndexByName("RightHand_Dummy");
37
38 if (m_iBoneIndex == -1)
39 {
40 Print("DayZPlayerCamera1stPerson: main bone not found");
41 }
42
45
48 m_isEntering = true;
50
56
58
59 Init();
60 }
override void Init()
Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside o...
Definition DayZPlayerCameraIronsights.c:372
Super root of all classes in Enforce script.
Definition EnScript.c:11
float m_movementAmplitudeY
Definition DayZPlayerCameraIronsights.c:27
float m_movementFrequencyX
Definition DayZPlayerCameraIronsights.c:28
void SetupSightEntities()
Definition DayZPlayerCameraIronsights.c:62
vector m_OpticsCamDir
Definition DayZPlayerCameraIronsights.c:351
float m_movementTimeAcc
Definition DayZPlayerCameraIronsights.c:25
float m_movementAmplitudeX
Definition DayZPlayerCameraIronsights.c:26
float m_dynamicsSmoothTime
Definition DayZPlayerCameraIronsights.c:22
PPERequester_CameraADS m_RequesterADS
Definition DayZPlayerCameraIronsights.c:16
vector m_OpticsCamPos
Definition DayZPlayerCameraIronsights.c:350
bool GetCurrentSightInfo(out vector camPos, out vector camDir)
Definition DayZPlayerCameraIronsights.c:111
float m_dynamicsStrength
Definition DayZPlayerCameraIronsights.c:21
ref array< float > temp_array
Definition DayZPlayerCameraIronsights.c:14
float m_movementFrequencyY
Definition DayZPlayerCameraIronsights.c:29
bool m_isEntering
Definition DayZPlayerCameraIronsights.c:12
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), GetCurrentSightInfo(), Init(), m_iBoneIndex, m_WeaponSwayModifier, Print() и SetupSightEntities().

◆ GetAdditiveAngles() [1/3]

override vector GetAdditiveAngles ( )
inlineprivate
77 {
78 vector a;
79 a[0] = m_fUpDownAngleAdd;
81 a[2] = 0;
82 return a;
83 }
float m_fLeftRightAngleAdd
left right angle in rad (in freelook only)
Definition DayZPlayerCamera1stPerson.c:96
float m_fUpDownAngleAdd
up down angle in rad
Definition DayZPlayerCamera1stPerson.c:94
Definition EnConvert.c:106

Перекрестные ссылки m_fLeftRightAngleAdd и m_fUpDownAngleAdd.

◆ GetAdditiveAngles() [2/3]

override vector GetAdditiveAngles ( )
inlineprivate
121 {
122 vector a;
123 a[0] = m_fUpDownAngleAdd;
125 a[2] = 0;
126 return a;
127 }

Перекрестные ссылки m_fLeftRightAngleAdd и m_fUpDownAngleAdd.

◆ GetAdditiveAngles() [3/3]

override vector GetAdditiveAngles ( )
inlineprotected
212 {
213 vector a;
214 a[0] = m_fUpDownAngleAdd;
216 a[2] = 0;
217 return a;
218 }

Перекрестные ссылки m_fLeftRightAngleAdd и m_fUpDownAngleAdd.

◆ GetBaseAngles() [1/3]

override vector GetBaseAngles ( )
inlineprivate
68 {
69 vector a;
70 a[0] = m_fUpDownAngle;
71 a[1] = m_fLeftRightAngle;
72 a[2] = 0;
73 return a;
74 }
float m_fLeftRightAngle
left right angle in rad (in freelook only)
Definition DayZPlayerCamera1stPerson.c:95
float m_fUpDownAngle
up down angle in rad
Definition DayZPlayerCamera1stPerson.c:93

Перекрестные ссылки m_fLeftRightAngle и m_fUpDownAngle.

◆ GetBaseAngles() [2/3]

override vector GetBaseAngles ( )
inlineprivate
112 {
113 vector a;
114 a[0] = m_fUpDownAngle;
115 a[1] = m_fLeftRightAngle;
116 a[2] = 0;
117 return a;
118 }

Перекрестные ссылки m_fLeftRightAngle и m_fUpDownAngle.

◆ GetBaseAngles() [3/3]

override vector GetBaseAngles ( )
inlineprotected
203 {
204 vector a;
205 a[0] = m_fUpDownAngle;
206 a[1] = m_fLeftRightAngle;
207 a[2] = 0;
208 return a;
209 }

Перекрестные ссылки m_fLeftRightAngle и m_fUpDownAngle.

◆ GetCameraName() [1/3]

override string GetCameraName ( )
inlineprivate
86 {
87 return "DayZPlayerCamera1stPerson";
88 }

◆ GetCameraName() [2/3]

override string GetCameraName ( )
inlineprivate
130 {
131 return "DayZPlayerCamera3rdPerson";
132 }

◆ GetCameraName() [3/3]

override string GetCameraName ( )
inlineprotected
316 {
317 return "DayZPlayerCameraIronsights";
318 }

◆ GetCurrentSightEntity()

EntityAI GetCurrentSightEntity ( )
inlineprotected
104 {
106 return m_opticsUsed;
107
108 return m_weaponUsed;
109 }
Weapon_Base m_weaponUsed
Definition DayZPlayerCamera_Base.c:73
ItemOptics m_opticsUsed
Definition DayZPlayerCamera_Base.c:74
bool m_opticsHasWeaponOverride
Definition DayZPlayerCameraIronsights.c:13

Перекрестные ссылки m_opticsUsed и m_weaponUsed.

Используется в GetCurrentSightInfo() и OnUpdate().

◆ GetCurrentSightInfo()

bool GetCurrentSightInfo ( out vector camPos,
out vector camDir )
inlineprotected
112 {
114 if (e)
115 {
116 if (e == m_weaponUsed)
117 {
118 m_weaponUsed.GetCameraPoint(m_weaponUsed.GetCurrentMuzzle(), camPos, camDir);
119 return true;
120 }
121 else if (e == m_opticsUsed)
122 {
125 return true;
126 }
127 }
128 else
129 {
130 ErrorEx("No sight entity found in " + this,ErrorExSeverity.INFO);
131 }
132 return false;
133 }
EntityAI GetCurrentSightEntity()
Definition DayZPlayerCameraIronsights.c:103
Definition Building.c:6
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

Перекрестные ссылки ErrorEx, ItemOptics::GetCameraPoint(), GetCurrentSightEntity(), m_opticsUsed, m_weaponUsed и ItemOptics::UseWeaponIronsightsOverride().

Используется в DayZPlayerCameraIronsights().

◆ HoldBreathFOVEffect()

float HoldBreathFOVEffect ( float pDt)
inlineprotected
237 {
238 if (m_pPlayer.IsHoldingBreath())
239 {
241 }
242 else if (m_isEntering) //sets FOV immediatelly to avoid "floating camera" effect
243 {
245 m_isEntering = false;
246 }
247 else
248 {
250 }
251
252 return m_fFovAbsolute;
253 }
float m_fFovAbsVel[1]
Definition DayZPlayerCamera_Base.c:572
Definition constants.c:638
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_IRONSIGHTS
Definition constants.c:934
const float DZPLAYER_CAMERA_FOV_EYEZOOM
FOV (vertical angle/2) in radians. Take care to modify also in "basicDefines.hpp".
Definition constants.c:932
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.

Перекрестные ссылки GameConstants::DZPLAYER_CAMERA_FOV_EYEZOOM, GameConstants::DZPLAYER_CAMERA_FOV_IRONSIGHTS, m_fFovAbsolute, m_fFovAbsVel, m_pPlayer и Math::SmoothCD().

Используется в AdjustCameraParameters().

◆ OnActivate() [1/3]

override void OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
inlineprivate
27 {
29
30 if (pPrevCamera)
31 {
32 vector baseAngles = pPrevCamera.GetBaseAngles();
35
36 vector addAngles = pPrevCamera.GetAdditiveAngles();
39 }
40 }

Перекрестные ссылки m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle и m_fUpDownAngleAdd.

◆ OnActivate() [2/3]

override void OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
inlineprivate
33 {
35
36 if (pPrevCamera)
37 {
38 vector baseAngles = pPrevCamera.GetBaseAngles();
41
42 vector addAngles = pPrevCamera.GetAdditiveAngles();
45 }
46 }

Перекрестные ссылки m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle и m_fUpDownAngleAdd.

◆ OnActivate() [3/3]

override void OnActivate ( DayZPlayerCamera pPrevCamera,
DayZPlayerCameraResult pPrevCameraResult )
inlineprotected
88 {
90
91 if (pPrevCamera)
92 {
93 vector baseAngles = pPrevCamera.GetBaseAngles();
96
97 vector addAngles = pPrevCamera.GetAdditiveAngles();
100 }
101 }

Перекрестные ссылки m_fLeftRightAngle, m_fLeftRightAngleAdd, m_fUpDownAngle и m_fUpDownAngleAdd.

◆ OnUpdate() [1/3]

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

update angles from input

44 {
48
51 pOutResult.m_CameraTM[3] = m_OffsetLS;
52
53 pOutResult.m_iDirectBone = m_iBoneIndex;
54 pOutResult.m_iDirectBoneMode = 1;
55 pOutResult.m_fUseHeading = 1.0;
56 pOutResult.m_fInsideCamera = 1.0;
57
58 pOutResult.m_fNearPlane = 0.04; //0.07 default
59
61
65 }
float UpdateLRAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
Definition DayZPlayerCamera_Base.c:190
float m_CurrentCameraYaw
Definition DayZPlayerCamera_Base.c:578
float m_CurrentCameraPitch
Definition DayZPlayerCamera_Base.c:579
float UpdateUDAngleUnlocked(out float pAngle, out float pAngleAdd, float pMin, float pMax, float pDt)
Definition DayZPlayerCamera_Base.c:129
void StdFovUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
Definition DayZPlayerCamera_Base.c:315
void InitCameraOnPlayer(bool force=false)
Definition DayZPlayerCamera_Base.c:561
void UpdateCameraNV(PlayerBase player)
Definition DayZPlayerCamera_Base.c:421
void ProcessCameraShake(float delta, out float leftRight, out float upDown)
Definition DayZPlayerCamera_Base.c:108
static const float CONST_UD_MAX
up limit
Definition DayZPlayerCamera1stPerson.c:7
static const float CONST_LR_MAX
up limit
Definition DayZPlayerCamera1stPerson.c:10
static const float CONST_LR_MIN
down limit
Definition DayZPlayerCamera1stPerson.c:9
static const float CONST_UD_MIN
down limit
Definition DayZPlayerCamera1stPerson.c:6
Definition EnMath3D.c:28
Definition PlayerBaseClient.c:2
vector GetCurrentOrientation()
Definition dayzplayer.c:112
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.

Перекрестные ссылки 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() и Math3D::YawPitchRollMatrix().

◆ OnUpdate() [2/3]

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

update angles from input

base bone pos

apply shoulder dist

store distance

50 {
51 m_pPlayer.GetMovementState(m_MovementState);
52
56
58
59 // update l/r offsets and set it as
61 {
63 }
64 else
65 {
67 }
68
70
73
75 if (m_iBoneIndex != -1)
76 {
77 pOutResult.m_CameraTM[3] = m_pPlayer.GetBonePositionMS(m_iBoneIndex);
78 }
79 else
80 {
81 pOutResult.m_CameraTM[3] = "0 0 0";
82 }
83
87
89 {
91 }
92 else
93 {
95 }
96
97 // ls offset + ms offset + shoulder width
98 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;
99
101 pOutResult.m_fDistance = m_fDistance;
102 pOutResult.m_fUseHeading = 1.0;
103 pOutResult.m_fInsideCamera = 0.0;
104 pOutResult.m_fPredictCollisionRadius = m_fPredictCollisionRadius;
105
109 }
vector m_CameraOffsetMS
model space offset
Definition DayZPlayerCamera3rdPerson.c:136
float m_fShoulderWidth
shoulder camera widths
Definition DayZPlayerCamera3rdPerson.c:139
float m_fDistance
distance from start
Definition DayZPlayerCamera3rdPerson.c:138
ref HumanMovementState m_MovementState
movement state
Definition DayZPlayerCamera3rdPerson.c:159
vector m_CameraOffsetLS
local space offset
Definition DayZPlayerCamera3rdPerson.c:137
bool m_bShoulderInLS
true - shoulder is in local space
Definition DayZPlayerCamera3rdPerson.c:140
proto native bool Camera3rdIsRightShoulder()
returns true if camera is on right/ false-left shoulder
HumanInputController m_pInput
human input
Definition dayzplayer.c:136

Перекрестные ссылки 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() и Math3D::YawPitchRollMatrix().

◆ OnUpdate() [3/3]

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

update angles from input

137 {
139 float min;
141 if (player && player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_RAISEDPRONE))
143 else
145
148
149 // get model space transform matrix of the gun's eye vector
150 vector matTM[4];
151 HumanItemAccessor hia = m_pPlayer.GetItemAccessor();
153 hia.WeaponGetCameraPointBoneRelative(GetCurrentSightEntity(), m_OpticsCamPos, m_OpticsCamDir, m_iBoneIndex, matTM);
154
155 // aim change based on character movement
159
160 HumanCommandMove hcm = m_pPlayer.GetCommand_Move();
161 if (hcm)
162 {
163 float speed = hcm.GetCurrentMovementSpeed();
164
165 if( speed > 0 )
167 else
169
172 }
173
176 aimChangeYPR[2] = 0;
177
178 vector dynamics[4];
180 dynamics[3] = vector.Zero;
181
182 // aiming model offsets
184 hia.WeaponGetAimingModelDirTm(aimingMatTM);
185
186 // final offset matrix
189
193
194 if(m_CameraShake)
195 {
196 float x,y;
197 m_CameraShake.Update(pDt, x, y);
198 DayZPlayerImplement.Cast(m_pPlayer).GetAimingModel().SetCamShakeValues(x, y);
199 }
200 }
ref CameraShake m_CameraShake
Definition DayZPlayerCamera_Base.c:75
Icon x
Icon y
PlayerBase GetPlayer()
Definition ModifierBase.c:51
float m_velocityYaw[1]
camera dynamics
Definition DayZPlayerCameraIronsights.c:19
void UpdateBatteryOptics(EntityAI entity)
Definition DayZPlayerCameraIronsights.c:338
static const float CONST_UD_MIN_BACK
down limit on back
Definition DayZPlayerCameraIronsights.c:7
float m_velocityPitch[1]
Definition DayZPlayerCameraIronsights.c:20
void AdjustCameraParameters(float pDt, inout DayZPlayerCameraResult pOutResult)
Definition DayZPlayerCameraIronsights.c:220
Definition ManBase.c:2
Definition human.c:434
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:602
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 const float RAD2DEG
Definition EnMath.c:16
static proto float Sin(float angle)
Returns sinus of angle in radians.
void HumanItemAccessor()
Definition humanitems.c:141

Перекрестные ссылки 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() и vector::Zero.

◆ SetCameraPP()

override void SetCameraPP ( bool state,
DayZPlayerCamera launchedFrom )
inlineprotected
257 {
258 //Print("SetCameraPP - ADS");
259 if (PlayerBase.Cast(m_pPlayer) && launchedFrom.Type() != PlayerBase.Cast(m_pPlayer).GetCurrentPlayerCamera().Type())
260 {
261 //Print("DayZPlayerCameraIronsights | SetCameraPP | skipping, wrong camera type active!");
262 return;
263 }
264
265 //if (!state || !m_weaponUsed || (PlayerBase.Cast(m_pPlayer) && launchedFrom != PlayerBase.Cast(m_pPlayer).GetCurrentPlayerCamera()))
266 if (!state || !m_weaponUsed)
267 {
268 m_RequesterADS.Stop();
269
270 if (IsCameraNV())
271 {
273 }
274 else
275 {
277 }
278 }
279 else
280 {
281 temp_array = {false, 0.0, 0.0, 0.0, 0.0, 1.0};
282
283 if (m_weaponUsed.GetWeaponDOF() || (m_opticsUsed && m_opticsUsed.GetOpticsDOF()))
284 {
285 if (m_opticsUsed && m_opticsUsed.GetOpticsDOF().Count() == 6)
286 {
288 }
289 else
290 {
291 temp_array = m_weaponUsed.GetWeaponDOF();
292 }
293 if (temp_array.Count() != 6)
294 temp_array = {false, 0.0, 0.0, 0.0, 0.0, 1.0};
295 }
296
297 m_RequesterADS.SetValuesIronsights(temp_array); //DOF only
298
299 if (IsCameraNV())
300 {
302 }
303 else
304 {
306 }
307 }
308
309 if (m_weaponUsed)
310 {
311 m_weaponUsed.HideWeaponBarrel(false);
312 }
313 }
NVTypes
Definition DayZPlayerCamera_Base.c:55
bool IsCameraNV()
Definition DayZPlayerCamera_Base.c:406
void SetNVPostprocess(int NVtype)
DayZPlayerCameraOptics handles this separately, otherwise it takes active NVType from PlayerBase::Get...
Definition DayZPlayerCamera_Base.c:477
int GetCameraNVType()
Definition DayZPlayerCamera_Base.c:416
ref array< float > GetOpticsDOF()
Definition ItemOptics.c:483

Перекрестные ссылки GetCameraNVType(), ItemOptics::GetOpticsDOF(), IsCameraNV(), m_opticsUsed, m_pPlayer, m_weaponUsed и SetNVPostprocess().

Используется в OnActivate() и UpdateCameraNV().

◆ SetCameraPPDelay()

override void SetCameraPPDelay ( DayZPlayerCamera pPrevCamera)
inlineprotected
321 {
322 if (pPrevCamera.GetCameraName() == "DayZPlayerCamera1stPerson")
323 {
324 //Print("---ironsights---DayZPlayerCamera1stPerson");
326 }
327 else if (pPrevCamera.GetCameraName() == "DayZPlayerCameraOptics")
328 {
329 m_CameraPPDelay = 0;
330 }
331 else
332 {
333 //Print("---ironsights---else");
335 }
336 }
float m_CameraPPDelay
Definition DayZPlayerCamera_Base.c:576
Definition DayZPlayerCameras.c:2
static const float TIME_CAMERACHANGE_02
Definition DayZPlayerCameras.c:28
static const float TIME_CAMERACHANGE_01
for two handed items
Definition DayZPlayerCameras.c:27

Перекрестные ссылки m_CameraPPDelay, DayZPlayerCameras::TIME_CAMERACHANGE_01 и DayZPlayerCameras::TIME_CAMERACHANGE_02.

Используется в OnActivate().

◆ SetupSightEntities()

void SetupSightEntities ( )
inlineprotected
63 {
64 EntityAI inHands = m_pPlayer.GetHumanInventory().GetEntityInHands();
65 if (inHands)
66 {
68 if( m_weaponUsed )
69 {
70 m_SightMisalignmentModifier = m_weaponUsed.GetPropertyModifierObject().m_SightMisalignment;
73 m_opticsUsed = m_weaponUsed.GetAttachedOptics();
74 if( m_opticsUsed )
75 {
77 }
78 }
79 else
80 {
82 }
83 }
84 }
vector m_SightMisalignmentModifier
Definition DayZPlayerCameraIronsights.c:23
Definition ItemOptics.c:2
proto native bool HasWeaponIronsightsOverride()
is weapon in optics mode or not
shorthand
Definition BoltActionRifle_Base.c:6

Перекрестные ссылки ItemOptics::HasWeaponIronsightsOverride(), m_opticsUsed, m_pPlayer и m_weaponUsed.

Используется в DayZPlayerCameraIronsights().

◆ UpdateBatteryOptics()

void UpdateBatteryOptics ( EntityAI entity)
inlineprotected
339 {
341 if (optics)
342 optics.UpdateOpticsReddotVisibility();
343 }

Используется в OnUpdate().

Поля

◆ CONST_LR_MAX

static const float CONST_LR_MAX = 160.0
staticprivate

up limit

◆ CONST_LR_MIN

static const float CONST_LR_MIN = -160.0
staticprivate

down limit

◆ CONST_UD_MAX

static const float CONST_UD_MAX = 85.0
staticprivate

up limit

◆ CONST_UD_MIN

static const float CONST_UD_MIN = -85.0
staticprivate

down limit

Используется в OnUpdate().

◆ CONST_UD_MIN_BACK

const float CONST_UD_MIN_BACK = -25.0
staticprivate

down limit on back

Используется в OnUpdate().

◆ m_bShoulderInLS

bool m_bShoulderInLS
protected

true - shoulder is in local space

◆ m_CameraOffsetLS

vector m_CameraOffsetLS
protected

local space offset

Используется в OnUpdate().

◆ m_CameraOffsetMS

vector m_CameraOffsetMS
protected

model space offset

Используется в OnUpdate() и OnUpdate().

◆ m_dynamicsSmoothTime

float m_dynamicsSmoothTime
protected

◆ m_dynamicsStrength

float m_dynamicsStrength
protected

◆ m_fCameraLRShoulder

float m_fCameraLRShoulder
protected

shoulder offsets

◆ m_fCameraLRShoulderVel

float m_fCameraLRShoulderVel[1]
protected

◆ m_fDistance

float m_fDistance
protected

distance from start

Используется в OnUpdate() и OnUpdate().

◆ m_fLeanDistance

float m_fLeanDistance
protected

shift on leaning

Используется в OnUpdate().

◆ m_fLeftRightAngle

float m_fLeftRightAngle
protected

left right angle in rad (in freelook only)

Используется в GetBaseAngles() и GetBaseAngles().

◆ m_fLeftRightAngleAdd

float m_fLeftRightAngleAdd
protected

left right angle in rad (in freelook only)

Используется в GetAdditiveAngles() и GetAdditiveAngles().

◆ m_fPredictCollisionRadius

float m_fPredictCollisionRadius
protected

collision prediction

Используется в OnUpdate().

◆ m_fRoll

float m_fRoll
protected

camera roll (deprecated)

◆ m_fShootFromCamera

float m_fShootFromCamera = 0.0
protected

settings

Используется в AdjustCameraParameters().

◆ m_fShoulderWidth

float m_fShoulderWidth
protected

shoulder camera widths

◆ m_fUpDownAngle

float m_fUpDownAngle
protected

up down angle in rad

runtime values

up down angle in rad

Используется в GetBaseAngles() и GetBaseAngles().

◆ m_fUpDownAngleAdd

float m_fUpDownAngleAdd
protected

up down angle in rad

Используется в GetAdditiveAngles() и GetAdditiveAngles().

◆ m_iBoneIndex

int m_iBoneIndex = -1
protected

main bone

runtime values

runtime config

main bone

right hand dummy bone index

Используется в AdjustCameraParameters().

◆ m_isEntering

bool m_isEntering = false
protected

◆ m_movementAmplitudeX

float m_movementAmplitudeX
protected

◆ m_movementAmplitudeY

float m_movementAmplitudeY
protected

◆ m_movementFrequencyX

float m_movementFrequencyX
protected

◆ m_movementFrequencyY

float m_movementFrequencyY
protected

◆ m_MovementState

ref HumanMovementState m_MovementState = new HumanMovementState()
protected

movement state

◆ m_movementTimeAcc

float m_movementTimeAcc
protected

◆ m_OffsetLS

vector m_OffsetLS
protected

position offset

◆ m_OpticsCamDir

vector m_OpticsCamDir
protected

◆ m_OpticsCamPos

vector m_OpticsCamPos
protected

◆ m_opticsHasWeaponOverride

bool m_opticsHasWeaponOverride = false
protected

◆ m_RequesterADS

PPERequester_CameraADS m_RequesterADS
protected

◆ m_SightMisalignmentModifier

vector m_SightMisalignmentModifier
protected

◆ m_velocityPitch

float m_velocityPitch[1]
protected

◆ m_velocityYaw

float m_velocityYaw[1]
protected

camera dynamics

◆ temp_array

ref array<float> temp_array
protected

Объявления и описания членов классов находятся в файлах: