Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
AttachBonePositionPlayerTrackModifier.c
Go to the documentation of this file.
1
class
AttachBonePositionPlayerTrackModifier
:
CinematicTrackModifier
2
{
3
4
[
Attribute
(defvalue:
""
,
desc
:
"Bone we want be attached to"
)]
5
string
boneToAttach;
6
7
[
Attribute
(defvalue:
"false"
,
desc
:
"If we want to rotate with parent"
)]
8
bool
applyRotation;
9
10
IEntity
player;
11
vector
transform[4];
12
vector
boneTransform[4];
13
vector
originalVector[4];
14
ChimeraWorld
chimeraWorld;
15
16
override
void
OnInit
(
World
world)
17
{
18
chimeraWorld = world;
19
20
array<int> playerIDs = {};
21
GetGame
().GetPlayerManager().GetPlayers(playerIDs);
22
foreach
(
int
playerID : playerIDs)
23
{
24
player =
GetGame
().GetPlayerManager().GetPlayerControlledEntity(playerID);
25
if
(!player)
26
continue
;
27
}
28
}
29
30
override
vector
OnApplyModifierVector(
float
time,
vector
originalValue)
31
{
32
33
if
(!player)
34
return
originalValue;
35
36
player.GetTransform(transform);
37
38
if
(boneToAttach !=
""
)
//attach to bone
39
{
40
Animation
entityAnimation = player.GetAnimation();
41
42
if
(!entityAnimation)
43
return
originalValue;
44
45
TNodeId
boneId = entityAnimation.GetBoneIndex(boneToAttach);
46
47
if
(boneId == -1)
48
return
originalValue;
49
50
entityAnimation.GetBoneMatrix(boneId, boneTransform);
51
Math3D
.MatrixMultiply4(transform, boneTransform, transform);
52
53
if
(applyRotation)
54
{
55
originalVector = {
"1 0 0"
,
"0 1 0"
,
"0 0 1"
, originalValue};
56
Math3D
.MatrixMultiply4(transform, originalVector, transform);
57
58
return
transform[3];
59
}
60
else
61
{
62
return
transform[3] + originalValue;
63
}
64
}
65
66
return
originalValue;
67
}
68
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
Animation
Definition
Animation.c:13
AttachBonePositionPlayerTrackModifier
Definition
AttachBonePositionPlayerTrackModifier.c:2
ChimeraWorld
Definition
ChimeraWorld.c:13
CinematicTrackModifier
Definition
CinematicTrackModifier.c:8
IEntity
Definition
IEntity.c:13
Math3D
Definition
Math3D.c:13
World
Definition
World.c:16
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TNodeId
int TNodeId
Node global id is a hash of name of the node.
Definition
EnEntity.c:18
OnInit
@ OnInit
Definition
SndComponentCallbacks.c:17
scripts
Game
Cinematics
AttachBonePositionPlayerTrackModifier.c
Generated by
1.17.0