DayZ 1.24
Loading...
Searching...
No Matches
CameraShake Class Reference
Collaboration diagram for CameraShake:
[legend]

Private Member Functions

void ~CameraShake ()
 
void CameraShake (float strength_factor, float radius, float smoothness, float radius_decay_speed)
 
void Update (float delta_time, out float x_axis, out float y_axis)
 

Private Attributes

const float MIN_PLAYER_DISTANCE = 40
 
float m_Radius
 
float m_RadiusDecaySpeed
 
float m_RandomAngle
 
float m_Time
 
float m_InitLR
 
float m_InitUD
 
bool m_ToDelete
 
float m_Smoothness
 
float m_StregthFactor
 
DayZPlayerImplement m_Player
 

Detailed Description

Definition at line 1 of file CameraShake.c.

Constructor & Destructor Documentation

◆ ~CameraShake()

void CameraShake::~CameraShake ( )
inlineprivate

Definition at line 16 of file CameraShake.c.

17 {
18 if (m_Player)
19 m_Player.GetAimingModel().SetCamShakeValues(0, 0);
20
21 }
DayZPlayerImplement m_Player
Definition CameraShake.c:14

References m_Player.

◆ CameraShake()

void CameraShake::CameraShake ( float strength_factor,
float radius,
float smoothness,
float radius_decay_speed )
inlineprivate

Definition at line 23 of file CameraShake.c.

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 }
PlayerBase GetPlayer()
float m_Radius
Definition CameraShake.c:5
float m_Smoothness
Definition CameraShake.c:12
float m_StregthFactor
Definition CameraShake.c:13
float m_RadiusDecaySpeed
Definition CameraShake.c:6
proto native CGame GetGame()

References GetGame(), GetPlayer(), m_Player, m_Radius, m_RadiusDecaySpeed, m_Smoothness, and m_StregthFactor.

Member Function Documentation

◆ Update()

void CameraShake::Update ( float delta_time,
out float x_axis,
out float y_axis )
inlineprivate

Definition at line 41 of file CameraShake.c.

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 }
float m_RandomAngle
Definition CameraShake.c:7
bool m_ToDelete
Definition CameraShake.c:11
Definition EnMath.c:7
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

References m_Radius, m_RadiusDecaySpeed, m_RandomAngle, m_Smoothness, m_StregthFactor, m_ToDelete, and Math::RandomFloat().

Member Data Documentation

◆ m_InitLR

float CameraShake::m_InitLR
private

Definition at line 9 of file CameraShake.c.

◆ m_InitUD

float CameraShake::m_InitUD
private

Definition at line 10 of file CameraShake.c.

◆ m_Player

DayZPlayerImplement CameraShake::m_Player
private

Definition at line 14 of file CameraShake.c.

Referenced by CameraShake(), and ~CameraShake().

◆ m_Radius

float CameraShake::m_Radius
private

Definition at line 5 of file CameraShake.c.

Referenced by CameraShake(), and Update().

◆ m_RadiusDecaySpeed

float CameraShake::m_RadiusDecaySpeed
private

Definition at line 6 of file CameraShake.c.

Referenced by CameraShake(), and Update().

◆ m_RandomAngle

float CameraShake::m_RandomAngle
private

Definition at line 7 of file CameraShake.c.

Referenced by Update().

◆ m_Smoothness

float CameraShake::m_Smoothness
private

Definition at line 12 of file CameraShake.c.

Referenced by CameraShake(), and Update().

◆ m_StregthFactor

float CameraShake::m_StregthFactor
private

Definition at line 13 of file CameraShake.c.

Referenced by CameraShake(), and Update().

◆ m_Time

float CameraShake::m_Time
private

Definition at line 8 of file CameraShake.c.

◆ m_ToDelete

bool CameraShake::m_ToDelete
private

Definition at line 11 of file CameraShake.c.

Referenced by Update().

◆ MIN_PLAYER_DISTANCE

const float CameraShake::MIN_PLAYER_DISTANCE = 40
private

Definition at line 3 of file CameraShake.c.


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