Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
AttachPositionTrackModifier.c
Go to the documentation of this file.
2{
3 [Attribute(defvalue:"", desc:"Entity we want be attached to")]
4 string entityToAttach;
5
6 [Attribute(defvalue:"false", desc:"If we want to rotate with parent")]
7 bool applyRotation;
8
9 vector transform[4];
10 vector originalVector[4];
11 ChimeraWorld chimeraWorld;
12
13 override void OnInit(World world)
14 {
15 chimeraWorld = world;
16 }
17
18 override vector OnApplyModifierVector(float time, vector originalValue)
19 {
20
21 IEntity entity = chimeraWorld.FindEntityByName(entityToAttach);
22
23 if (!entity)
24 return originalValue;
25
26 entity.GetTransform(transform);
27
28 if (applyRotation)
29 {
30 originalVector = { "1 0 0", "0 1 0", "0 0 1", originalValue};
31 Math3D.MatrixMultiply4(transform, originalVector, transform);
32
33 return transform[3];
34 }
35 else
36 {
37 return transform[3] + originalValue;
38 }
39 }
40};
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external void GetTransform(out vector mat[])
Definition World.c:16
SCR_FieldOfViewSettings Attribute