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

Private Member Functions

void KuruShake (PlayerBase player, float amount)
 
void Update (float delta_time, out float pos_x, out float pos_y)
 

Private Attributes

const float RANDOM_RANGE_POINT = 1
 
const float RANDOM_RANGE_DEVIATION = 0.50
 
const float SHAKE_DURATION_PHASE1 = 0.01
 
const float SHAKE_STRENGTH_MIN = 1
 
const float SHAKE_STRENGTH_MAX = 5
 
PlayerBase m_Player
 
float m_Time
 
float m_Time2
 
float m_RelativeTime
 
float m_RelativeTime2
 
float m_ShakeStrength
 
ref array< vectorm_Curve = new array<vector>
 

Detailed Description

Definition at line 1 of file KuruShake.c.

Constructor & Destructor Documentation

◆ KuruShake()

void KuruShake::KuruShake ( PlayerBase player,
float amount )
inlineprivate

Definition at line 19 of file KuruShake.c.

20 {
21
23 int seed = Math.Randomize(player.GetRandomGeneratorSyncManager().GetRandomInRange(RandomGeneratorSyncUsage.RGSGeneric, 0, 10000));
28 pos1.Normalize();
30
34 m_Curve.Insert("0 0 0");
35 m_Curve.Insert(pos1);
36 m_Curve.Insert(pos2);
37
38 /*
39 Print("==========================");
40 for(int i = 0; i < m_Curve.Count(); i++)
41 {
42 Print(m_Curve[i]);
43 }
44 Print("==========================");
45 */
46 }
const float RANDOM_RANGE_POINT
Definition KuruShake.c:3
const float SHAKE_STRENGTH_MIN
Definition KuruShake.c:6
ref array< vector > m_Curve
Definition KuruShake.c:17
const float RANDOM_RANGE_DEVIATION
Definition KuruShake.c:4
float m_ShakeStrength
Definition KuruShake.c:14
const float SHAKE_STRENGTH_MAX
Definition KuruShake.c:7
Definition EnMath.c:7
static proto int Randomize(int seed)
Sets the seed for the random number generator.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

References Math::Lerp(), m_Curve, m_ShakeStrength, RANDOM_RANGE_DEVIATION, RANDOM_RANGE_POINT, Math::RandomFloat(), Math::Randomize(), SHAKE_STRENGTH_MAX, and SHAKE_STRENGTH_MIN.

Member Function Documentation

◆ Update()

void KuruShake::Update ( float delta_time,
out float pos_x,
out float pos_y )
inlineprivate

Definition at line 48 of file KuruShake.c.

49 {
50 if (m_RelativeTime < 0.99)
51 {
54 //m_RelativeTime = m_RelativeTime - 0.01;
57 pos_x = pos[0];
58 pos_y = pos[1];
59 }
60 else
61 {
62 m_Time2 += delta_time * 1;
66 pos_x = pos2[0];
67 pos_y = pos2[1];
68 }
69
70 if (m_Time2 >= 0.99)
71 delete this;
72 }
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition Easing.c:3
static float EaseInQuint(float t)
Definition Easing.c:78
const float SHAKE_DURATION_PHASE1
Definition KuruShake.c:5
float m_RelativeTime
Definition KuruShake.c:12
float m_Time2
Definition KuruShake.c:11
float m_RelativeTime2
Definition KuruShake.c:13
float m_Time
Definition KuruShake.c:10
ECurveType
Definition EnMath3D.c:21
static proto native vector Curve(ECurveType type, float param, notnull array< vector > points)
Computes curve.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References Math3D::Curve(), Easing::EaseInQuint(), Math::InverseLerp(), m_Curve, m_RelativeTime, m_RelativeTime2, m_Time, m_Time2, and SHAKE_DURATION_PHASE1.

Member Data Documentation

◆ m_Curve

ref array<vector> KuruShake::m_Curve = new array<vector>
private

Definition at line 17 of file KuruShake.c.

Referenced by KuruShake(), and Update().

◆ m_Player

PlayerBase KuruShake::m_Player
private

Definition at line 9 of file KuruShake.c.

◆ m_RelativeTime

float KuruShake::m_RelativeTime
private

Definition at line 12 of file KuruShake.c.

Referenced by Update().

◆ m_RelativeTime2

float KuruShake::m_RelativeTime2
private

Definition at line 13 of file KuruShake.c.

Referenced by Update().

◆ m_ShakeStrength

float KuruShake::m_ShakeStrength
private

Definition at line 14 of file KuruShake.c.

Referenced by KuruShake().

◆ m_Time

float KuruShake::m_Time
private

Definition at line 10 of file KuruShake.c.

Referenced by Update().

◆ m_Time2

float KuruShake::m_Time2
private

Definition at line 11 of file KuruShake.c.

Referenced by Update().

◆ RANDOM_RANGE_DEVIATION

const float KuruShake::RANDOM_RANGE_DEVIATION = 0.50
private

Definition at line 4 of file KuruShake.c.

Referenced by KuruShake().

◆ RANDOM_RANGE_POINT

const float KuruShake::RANDOM_RANGE_POINT = 1
private

Definition at line 3 of file KuruShake.c.

Referenced by KuruShake().

◆ SHAKE_DURATION_PHASE1

const float KuruShake::SHAKE_DURATION_PHASE1 = 0.01
private

Definition at line 5 of file KuruShake.c.

Referenced by Update().

◆ SHAKE_STRENGTH_MAX

const float KuruShake::SHAKE_STRENGTH_MAX = 5
private

Definition at line 7 of file KuruShake.c.

Referenced by KuruShake().

◆ SHAKE_STRENGTH_MIN

const float KuruShake::SHAKE_STRENGTH_MIN = 1
private

Definition at line 6 of file KuruShake.c.

Referenced by KuruShake().


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