DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerCameraVehicles.c
Go to the documentation of this file.
1// *************************************************************************************
2// ! DayZPlayerCamera1stPersonVehicle - first person in vehicle
3// *************************************************************************************
5{
7 {
8 super.OnUpdate(pDt, pOutResult);
9
10 pOutResult.m_fUseHeading = 0.0;
11 pOutResult.m_bUpdateEveryFrame = GetGame().IsPhysicsExtrapolationEnabled();
12 }
13}
14
15// *************************************************************************************
16// ! DayZPlayerCamera3rdPersonVehicle - 3rd person in vehicle (generic)
17// *************************************************************************************
19{
20 static const float CONST_UD_MIN = -85.0;
21 static const float CONST_UD_MAX = 85.0;
22
23 static const float CONST_LR_MIN = -160.0;
24 static const float CONST_LR_MAX = 160.0;
25
26 const float CONST_LINEAR_VELOCITY_STRENGTH = 0.025;
28
32
34 {
35 //Print("new camera: DayZPlayerCamera3rdPersonVehicle");
36
37 m_fDistance = 4.0;
38 m_CameraOffsetMS = "0.0 1.3 0.0";
39
40 HumanCommandVehicle vehicleCommand = pPlayer.GetCommand_Vehicle();
42 {
43 Transport transport = vehicleCommand.GetTransport();
44 if (transport)
45 {
47 m_fDistance = transport.GetTransportCameraDistance();
48 m_CameraOffsetMS = transport.GetTransportCameraOffset();
49 }
50 }
51 }
52
71
73 {
76 m_pPlayer.GetTransform(playerTransformWS);
77
80 pOutResult.m_CollisionIgnoreEntity = vehicle;
81
84 if (vehicle)
85 {
86 vector vehiclePositionWS = vehicle.GetOrigin();
89 }
90
95
99
100 if (vehicle)
101 {
103 posDiffLS = posDiffWS.InvMultiply3(playerTransformWS);
104
106 rotDiffLS = rotDiffWS.InvMultiply3(playerTransformWS);
107 }
108
113
117
119 vector rot;
123
125
128
130 pOutResult.m_fDistance = m_fDistance;
131 pOutResult.m_fUseHeading = 0.0;
132 pOutResult.m_fInsideCamera = 0.0;
133 pOutResult.m_fIgnoreParentRoll = 1.0;
134 pOutResult.m_bUpdateEveryFrame = GetGame().IsPhysicsExtrapolationEnabled();
135
137
138 super.OnUpdate(pDt, pOutResult);
139 }
140
142 {
143 vector a;
144 a[0] = m_fUpDownAngle;
145 a[1] = m_fLeftRightAngle;
146 a[2] = 0;
147 return a;
148 }
149
151 {
152 vector a;
153 a[0] = m_fUpDownAngleAdd;
155 a[2] = 0;
156 return a;
157 }
158
161 protected float m_fDistance;
162
164 protected float m_fUpDownAngle;
165 protected float m_fUpDownAngleAdd;
166 protected float m_fLeftRightAngle;
167 protected float m_fLeftRightAngleAdd;
168
172 protected float m_fLagOffsetVelocityX[1];
173 protected float m_fLagOffsetVelocityY[1];
174 protected float m_fLagOffsetVelocityZ[1];
175 protected float m_fLagOffsetVelocityYaw[1];
176 protected float m_fLagOffsetVelocityPitch[1];
177 protected float m_fLagOffsetVelocityRoll[1];
178
181}
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
vector m_CameraOffsetMS
model space 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)
float m_CurrentCameraRoll
vector m_LagOffsetOrientation
void DayZPlayerCamera3rdPersonVehicle(DayZPlayer pPlayer, HumanInputController pInput)
const float CONST_ANGULAR_LAG_ROLL_STRENGTH
const float CONST_ANGULAR_VELOCITY_STRENGTH
float m_fLagOffsetVelocityYaw[1]
const float CONST_ANGULAR_LAG_PITCH_STRENGTH
vector m_LagOffsetPosition
lag offsets
float m_fLagOffsetVelocityPitch[1]
float m_fLagOffsetVelocityY[1]
float m_fLagOffsetVelocityRoll[1]
float m_fLagOffsetVelocityX[1]
const float CONST_ANGULAR_LAG_YAW_STRENGTH
Transport m_Transport
cache
float m_fLagOffsetVelocityZ[1]
const float CONST_LINEAR_VELOCITY_STRENGTH
override void OnUpdate(float pDt, out DayZPlayerCameraResult pOutResult)
this is main camera class
vector m_CameraOffsetMS
model space offset
float m_fLeftRightAngleAdd
left right angle in rad (in freelook only)
override vector GetAdditiveAngles()
float m_fDistance
distance from start
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
Definition EnMath.c:7
Base native class for all motorized wheeled vehicles.
Definition Car.c:75
static const vector Zero
Definition EnConvert.c:110
float m_fDistance
camera distance (external cameras only)
Definition dayzplayer.c:63
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 native CGame GetGame()
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static const float RAD2DEG
Definition EnMath.c:16
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.
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto vector dBodyGetAngularVelocity(notnull IEntity body)
Gets angular velocity for a rigidbody.
proto native void OnUpdate()
Definition tools.c:333
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1167