Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_RotationInteriaManualCameraComponent.c
Go to the documentation of this file.
1
//#define INERTIA_DEBUG
2
4
6
[
BaseContainerProps
(), SCR_BaseManualCameraComponentTitle()]
7
class
SCR_RotationInertiaManualCameraComponent
:
SCR_BaseManualCameraComponent
8
{
9
protected
static
const
float
INERTIA_THRESHOLD
= 0.0002;
//--- Squared value
10
11
[
Attribute
(defvalue:
"0.03"
,
desc
:
"Inertia strength. Larger values mean more inertia."
)]
12
private
float
m_fInertiaStrength;
13
14
private
vector
m_vRotDelta;
15
16
//------------------------------------------------------------------------------------------------
17
override
void
EOnCameraFrame(
SCR_ManualCameraParam
param)
18
{
19
//--- Terminate when target rotation was achieved
20
if
(!param.isManualInput && m_vRotDelta.LengthSq() <
INERTIA_THRESHOLD
)
return
;
21
22
m_vRotDelta =
vector
.Lerp(m_vRotDelta, param.rotDelta,
Math
.Min(param.
timeSlice
* m_fInertiaStrength, 1));
23
24
#ifdef INERTIA_DEBUG
25
DbgUI
.Begin(
"KEK"
, 0, 0);
26
DbgUI
.Text(
"Yaw Before"
);
27
DbgUI
.PlotLive(
"YawBefore"
, 500, 100, param.rotDelta[0], 0.01, 100,
ARGBF
(1, 0.25, 0.25, 0.25));
28
DbgUI
.Text(
"Yaw After"
);
29
DbgUI
.PlotLive(
"YawAfter"
, 500, 100, m_vRotDelta[0], 0.01, 100,
ARGBF
(1, 1, 1, 1));
30
DbgUI
.Text(
"Pitch Before"
);
31
DbgUI
.PlotLive(
"PitchBefore"
, 500, 100, param.rotDelta[1], 0.01, 100,
ARGBF
(1, 0.25, 0.25, 0.25));
32
DbgUI
.Text(
"Pitch After"
);
33
DbgUI
.PlotLive(
"PitchAfter"
, 500, 100, m_vRotDelta[1], 0.01, 100,
ARGBF
(1, 1, 1, 1));
34
DbgUI
.End();
35
#endif
36
37
param.rotDelta = m_vRotDelta;
38
param.isDirty =
true
;
39
}
40
41
//------------------------------------------------------------------------------------------------
42
override
bool
EOnCameraInit
()
43
{
44
m_fInertiaStrength = 1 /
Math
.Max(m_fInertiaStrength, 0.001);
45
return
true
;
46
}
47
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
DbgUI
Definition
DbgUI.c:66
Math
Definition
Math.c:13
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition
SCR_BaseManualCameraComponent.c:6
SCR_BaseManualCameraComponent::EOnCameraInit
bool EOnCameraInit()
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition
SCR_ManualCameraParam.c:6
SCR_ManualCameraParam::timeSlice
float timeSlice
Frame time slice.
Definition
SCR_ManualCameraParam.c:9
SCR_RotationInertiaManualCameraComponent
Inertia applied on camera rotation.
Definition
SCR_RotationInteriaManualCameraComponent.c:8
SCR_RotationInertiaManualCameraComponent::INERTIA_THRESHOLD
static const float INERTIA_THRESHOLD
Definition
SCR_RotationInteriaManualCameraComponent.c:9
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ARGBF
proto int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
scripts
Game
Camera
Components
SCR_RotationInteriaManualCameraComponent.c
Generated by
1.17.0