DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerCamera1stPerson.c
Go to the documentation of this file.
1// *************************************************************************************
2// ! DayZPlayerCamera1stPerson - 1st person camera
3// *************************************************************************************
5{
6 static const float CONST_UD_MIN = -85.0;
7 static const float CONST_UD_MAX = 85.0;
8
9 static const float CONST_LR_MIN = -160.0;
10 static const float CONST_LR_MAX = 160.0;
11
12
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 }
21
22
23 //
39
40 //
64
66 {
67 vector a;
68 a[0] = m_fUpDownAngle;
69 a[1] = m_fLeftRightAngle;
70 a[2] = 0;
71 return a;
72 }
73
75 {
76 vector a;
77 a[0] = m_fUpDownAngleAdd;
79 a[2] = 0;
80 return a;
81 }
82
83 override string GetCameraName()
84 {
85 return "DayZPlayerCamera1stPerson";
86 }
87
88 protected int m_iBoneIndex;
89 protected vector m_OffsetLS;
90
91 protected float m_fUpDownAngle;
92 protected float m_fUpDownAngleAdd;
93 protected float m_fLeftRightAngle;
94 protected float m_fLeftRightAngleAdd;
95}
96
97// *************************************************************************************
98// ! DayZPlayerCamera1stPersonUnconscious - first person only unconscious
99// *************************************************************************************
101{
104 m_iBoneIndex = pPlayer.GetBoneIndexByName("Head");
105 }
108 {
109 super.OnUpdate(pDt, pOutResult);
111 pOutResult.m_iDirectBone = m_iBoneIndex;
112 pOutResult.m_iDirectBoneMode = 4;
113 pOutResult.m_fUseHeading = 0.0;
114
115 vector rot;
116 rot[0] = 0;
117 rot[1] = 90;
118 rot[2] = 0;
119
122}
int m_iBoneIndex
main bone
class DayZPlayerCamera1stPerson extends DayZPlayerCameraBase DayZPlayerCamera1stPersonUnconscious(DayZPlayer pPlayer, HumanInputController pInput)
vector m_OffsetLS
position offset
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)
float m_fLeftRightAngle
left right angle in rad
float m_fUpDownAngle
runtime values
static const float CONST_UD_MAX
up limit
float m_fLeftRightAngleAdd
left right angle in rad
float m_fUpDownAngleAdd
up down angle in rad
static const float CONST_LR_MIN
down limit
static const float CONST_LR_MAX
up limit
class DayZPlayerCamera1stPersonVehicle extends DayZPlayerCamera1stPerson CONST_UD_MIN
down limit
this is main camera class
float m_fLeftRightAngleAdd
left right angle in rad (in freelook only)
override vector GetAdditiveAngles()
override void OnActivate(DayZPlayerCamera pPrevCamera, DayZPlayerCameraResult pPrevCameraResult)
void DayZPlayerCamera1stPerson(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 m_fUpDownAngle
up down angle in rad
vector m_OffsetLS
position offset
DayZPlayer m_pPlayer
data
Definition dayzplayer.c:135
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
Definition dayzplayer.c:56
vector GetCurrentOrientation()
Definition dayzplayer.c:112
proto void Print(void var)
Prints content of variable to console/log.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
proto native void OnUpdate()
Definition tools.c:333