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_2DPiPScopeZeroingGenerator.c
Go to the documentation of this file.
1
class
SCR_2DPiPScopeZeroingGenerator
:
ScriptedBaseZeroingGenerator
2
{
3
[
Attribute
(
""
,
UIWidgets
.ResourcePickerThumbnail,
"Reference projectile"
,
params
:
"et"
)]
4
protected
ResourceName
m_sReferenceProjectile
;
5
6
protected
SCR_2DPIPSightsComponent
m_SightsComponent
;
7
protected
float
m_fFovZoomed
;
8
9
//------------------------------------------------------------------------------------------------
10
override
bool
WB_InitGenerator
()
11
{
12
SetPointInfoGeneration(
false
);
13
SetProjectileResource(
m_sReferenceProjectile
);
14
15
BaseSightsComponent
bsc = GetSights();
16
m_SightsComponent
= SCR_2DPIPSightsComponent.Cast(bsc);
17
if
(
m_SightsComponent
)
18
{
19
float
magnification =
m_SightsComponent
.GetMagnification();
20
const
float
s_fReferenceFOV = 38;
// Hardcoded, depends on player settings but this should work here
21
m_fFovZoomed
=
Math
.RAD2DEG * 2 *
Math
.Atan2(
Math
.Tan(
Math
.DEG2RAD * (s_fReferenceFOV / 2)), magnification);
22
return
true
;
23
}
24
else
25
{
26
return
false
;
27
}
28
}
29
30
//------------------------------------------------------------------------------------------------
31
override
bool
WB_GetZeroingData
(
float
weaponAngle,
float
distance
, out
vector
offset, out
vector
angles
)
32
{
33
angles
[0] = weaponAngle;
34
return
true
;
35
}
36
37
//------------------------------------------------------------------------------------------------
38
override
float
WB_CalculateWeaponZeroingAnimationValue
(
float
pitch,
float
distance
, out
vector
offset, out
vector
angles
)
39
{
40
SCR_2DOpticsComponentClass
data
=
SCR_2DOpticsComponentClass
.Cast(
m_SightsComponent
.GetComponentData(
m_SightsComponent
.GetOwner()));
41
if
(!
data
)
42
return
0;
43
44
if
(
data
.GetZeroType() == SCR_EPIPZeroingType.EPZ_CAMERA_TURN)
45
{
46
return
angles
[0];
47
}
48
else
49
{
50
// Unsupported at this point.
51
Print
(
"The Reticle Offset zeroing method is currently unsupported pending Refactor of scopes"
,
LogLevel
.ERROR);
52
return
0;
53
}
54
}
55
}
angles
ref array< string > angles
Definition
PrefabImporter.c:22
distance
float distance
Definition
SCR_DestructibleTreeV2.c:29
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
BaseSightsComponent
Definition
BaseSightsComponent.c:13
Math
Definition
Math.c:13
ResourceName
Definition
ResourceName.c:13
SCR_2DOpticsComponentClass
Definition
SCR_2DOpticsComponent.c:3
SCR_2DPiPScopeZeroingGenerator
Definition
SCR_2DPiPScopeZeroingGenerator.c:2
SCR_2DPiPScopeZeroingGenerator::WB_CalculateWeaponZeroingAnimationValue
override float WB_CalculateWeaponZeroingAnimationValue(float pitch, float distance, out vector offset, out vector angles)
Definition
SCR_2DPiPScopeZeroingGenerator.c:38
SCR_2DPiPScopeZeroingGenerator::m_SightsComponent
SCR_2DPIPSightsComponent m_SightsComponent
Definition
SCR_2DPiPScopeZeroingGenerator.c:6
SCR_2DPiPScopeZeroingGenerator::WB_InitGenerator
override bool WB_InitGenerator()
Definition
SCR_2DPiPScopeZeroingGenerator.c:10
SCR_2DPiPScopeZeroingGenerator::m_sReferenceProjectile
ResourceName m_sReferenceProjectile
Definition
SCR_2DPiPScopeZeroingGenerator.c:4
SCR_2DPiPScopeZeroingGenerator::WB_GetZeroingData
override bool WB_GetZeroingData(float weaponAngle, float distance, out vector offset, out vector angles)
Definition
SCR_2DPiPScopeZeroingGenerator.c:31
SCR_2DPiPScopeZeroingGenerator::m_fFovZoomed
float m_fFovZoomed
Definition
SCR_2DPiPScopeZeroingGenerator.c:7
ScriptedBaseZeroingGenerator
Definition
ScriptedBaseZeroingGenerator.c:8
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Weapon
Sights
ZeroingGenerators
SCR_2DPiPScopeZeroingGenerator.c
Generated by
1.17.0