DayZ 1.24
Loading...
Searching...
No Matches
CameraShake.c
Go to the documentation of this file.
2{
3 const float MIN_PLAYER_DISTANCE = 40;
4
5 float m_Radius;
8 float m_Time;
9 float m_InitLR;
10 float m_InitUD;
15
17 {
18 if (m_Player)
19 m_Player.GetAimingModel().SetCamShakeValues(0, 0);
20
21 }
22
23 void CameraShake(float strength_factor, float radius, float smoothness, float radius_decay_speed)
24 {
25 /*
26
27 Print("-----------ON CREATE------------");
28 Print(camera_offset);
29 Print("-----------ON CREATE END------------");
30 */
31 //m_Player = DayZPlayerImplement.Cast(player);
34 //m_InitLR = lr_angle;
35 //m_InitUD = ud_angle;
36 m_Radius = radius;
39 }
40
41 void Update(float delta_time, out float x_axis, out float y_axis)
42 {
43 if (m_ToDelete)
44 delete this;
45
46 m_Radius -= delta_time * m_RadiusDecaySpeed; //diminish radius each frame
47
48 if (m_RandomAngle >= 0)
50 else
52
55
56 //Print(x_axis);
57 //Print(y_axis);
58
59 if (m_Radius < 0.01)
60 m_ToDelete = true;
61 }
62}
63
PlayerBase GetPlayer()
float m_Time
Definition CameraShake.c:8
float m_RandomAngle
Definition CameraShake.c:7
DayZPlayerImplement m_Player
Definition CameraShake.c:14
void ~CameraShake()
Definition CameraShake.c:16
float m_Radius
Definition CameraShake.c:5
bool m_ToDelete
Definition CameraShake.c:11
float m_Smoothness
Definition CameraShake.c:12
const float MIN_PLAYER_DISTANCE
Definition CameraShake.c:3
float m_StregthFactor
Definition CameraShake.c:13
float m_InitLR
Definition CameraShake.c:9
void CameraShake(float strength_factor, float radius, float smoothness, float radius_decay_speed)
Definition CameraShake.c:23
float m_InitUD
Definition CameraShake.c:10
void Update(float delta_time, out float x_axis, out float y_axis)
Definition CameraShake.c:41
float m_RadiusDecaySpeed
Definition CameraShake.c:6
Definition EnMath.c:7
proto native CGame GetGame()
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].