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_SpeedByHeightManualCameraComponent.c
Go to the documentation of this file.
1
//#define CURVE_APPLIED
2
4
6
[
BaseContainerProps
(), SCR_BaseManualCameraComponentTitle()]
7
class
SCR_SpeedByHeightManualCameraComponent
:
SCR_BaseManualCameraComponent
8
{
9
[
Attribute
(
"0.06"
)]
10
float
m_fSpeedCoef;
11
12
[
Attribute
(defvalue:
"0.15"
)]
13
float
m_fMinSpeed;
14
15
[
Attribute
(defvalue:
"400"
)]
16
float
m_fMaxHeight;
17
18
[
Attribute
(
"50.0"
)]
19
float
m_fUnderwaterSpeedHeight;
// When underwater, the camera will move at the speed it would if it was at this height
20
21
[
Attribute
(
"0 0 1 1"
,
UIWidgets
.CurveDialog,
params
:
"1 1 0 0"
)]
22
private
ref
Curve
m_fHeightCoef;
23
24
//------------------------------------------------------------------------------------------------
25
override
void
EOnCameraFrame(
SCR_ManualCameraParam
param)
26
{
27
vector
pos =
CoordFromCamera
(param.transform[3]);
28
float
surfaceY = param.
world
.GetSurfaceY(pos[0], pos[2]);
29
30
#ifdef CURVE_APPLIED
31
float
height =
LegacyCurve
.Curve(
ECurveType
.CurveProperty2D, (pos[1] - surfaceY) / m_fMaxHeight, m_fHeightCoef)[1];
32
param.multiplier *=
Math
.Max(height * m_fMaxHeight * m_fSpeedCoef, m_fMinSpeed);
33
#else
34
surfaceY =
Math
.Max(surfaceY, 0);
// this is so when you go off the MpTest terrain, you dont instantly switch speed to mach 10
35
float
height =
Math
.AbsFloat(pos[1] - surfaceY);
36
if
(pos[1] < 0)
// When below water level maintain a constant speed no matter the depth
37
height = m_fUnderwaterSpeedHeight;
38
39
param.multiplier *=
Math
.Max(height * m_fSpeedCoef, m_fMinSpeed);
40
#endif
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
bool
EOnCameraInit
()
45
{
46
return
true
;
47
}
48
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
Curve
Definition
Math.c:22
LegacyCurve
Definition
LegacyCurve.c:13
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_BaseManualCameraComponent::CoordFromCamera
vector CoordFromCamera(vector pos)
Definition
SCR_BaseManualCameraComponent.c:85
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition
SCR_ManualCameraParam.c:6
SCR_ManualCameraParam::world
BaseWorld world
World in which the camera exists.
Definition
SCR_ManualCameraParam.c:10
SCR_SpeedByHeightManualCameraComponent
Camera speed based on height from terrain.
Definition
SCR_SpeedByHeightManualCameraComponent.c:8
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ECurveType
ECurveType
Definition
ECurveType.c:13
scripts
Game
Camera
Components
SCR_SpeedByHeightManualCameraComponent.c
Generated by
1.17.0