DayZ 1.24
Loading...
Searching...
No Matches
HitDirectionBase.c
Go to the documentation of this file.
1
2
4{
5 const float DURATION_COEF_MIN = 0.6;
6 const float INTENSITY_MIN = 0.6;
7
9 float m_Duration;
13
16
18
22 float m_PosX;
23 float m_PosY;
28 float m_SmoothVel[1];
29
31
33 {
34 m_Initialized = false;
35 m_PosX = 0.0;
36 m_PosY = 0.0;
37 m_AngleRad = 0.0;
38 m_SmoothVel[0] = 0.0;
39
41 m_ImageData.GetCurrentImageData(m_LayoutRoot, m_Image);
42 }
43
46 {
52 m_Scatter = Math.Clamp(m_Scatter, 0.0, 180.0);
54
56 w = w.GetChildren();
57 while (w)
58 {
59 w.Show(m_Image == w);
60 w = w.GetSibling();
61 }
62
63 m_Image.SetColor(m_Color);
64
65 m_LayoutRoot.Show(true);
66
70 m_Initialized = true;
71 }
72
74
76 {
77 m_LayoutRoot.Show(false);
78 delete m_LayoutRoot;
79 }
80
82 {
84 return true;
85 return false;
86 }
87
88 void Update(float timeslice)
89 {
90 float intensity;
91
94 else
95 {
98 }
99
101 intensity = Math.Clamp(intensity, 0, 1);
102
104 m_LayoutRoot.Show(false);
105 else
106 {
107 m_LayoutRoot.SetAlpha(intensity);
108 if (m_Mode == HitDirectionModes.DYNAMIC)
109 {
113 }
114 }
115 }
116
150
153 void SetIndicatorRotation(float timeslice = -1.0) {}
154
156 {
157 m_LayoutRoot.SetPos(m_PosX, m_PosY, true);
158 }
159
160 //-----------------------------------------------------------------------
161 //Static stuff below
162 //-----------------------------------------------------------------------
164 static int m_Mode;
165 static int m_ID;
166 static int m_Color;
167 static protected typename m_Type;
168 static float m_DurationMax;
169 static float m_BreakPointBase;
170 static float m_DistanceAdjust;
172 static float m_Scatter;
173
199
200 static typename GetCurrentType()
201 {
202 switch (m_ID)
203 {
204 case HitIndicatorType.SPLASH:
206 break;
207
208 case HitIndicatorType.SPIKE:
210 break;
211
212 case HitIndicatorType.ARROW:
214 break;
215
216 default:
217 ErrorEx("Unknown HitDirection mode, using HitIndicatorType.SPLASH", ErrorExSeverity.INFO);
219 break;
220 }
221
222 return m_Type;
223 }
224}
static bool GetHitIndicationOverrideEnabled()
static int GetHitIndicationIndicatorColor()
static int GetHitIndicationMode()
static float GetHitIndicationMaxDuration()
static int GetHitIndicationTypeID()
static float GetHitIndicationBreakPoint()
static float GetHitIndicationScatter()
ref HitDirectionImagesBase m_ImageData
void CalculateArrowPosition(float timeslice=-1.0)
void Update(float timeslice)
override HitDirectionImagesBase GetImageData()
override void FinalizePositionCalculation()
void SetIndicatorPositon(float timeslice=-1.0)
void Init(DayZPlayer player, float hit_direction, float intensity_max)
Called manually after object spawn.
static void CheckValues()
range 0..180, randomized offset of direction to make it less acurate
void SetIndicatorRotation(float timeslice=-1.0)
static float m_DistanceAdjust
range 0..1, a point where the fading starts
void FinalizePositionCalculation()
specific handling on individual indicator type
HitDirectionImagesBase GetImageData()
static bool m_ServerOverrideEnabled
override void SetIndicatorRotation(float timeslice=-1.0)
Definition EnMath.c:7
proto native CGame GetGame()
HitDirectionModes
Definition constants.c:98
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx
static const float PI2
Definition EnMath.c:13
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float ModFloat(float x, float y)
Returns the floating-point remainder of x/y rounded towards zero.
static proto float NormalizeAngle(float ang)
Normalizes the angle (0...360)
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Sin(float angle)
Returns sinus of angle in radians.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float Pow(float v, float power)
Return power of v ^ power.
static const float DEG2RAD
Definition EnMath.c:17
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.
static const float PI
Definition EnMath.c:12
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54
proto void GetScreenSize(out int x, out int y)