Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BasePreviewEntry.c
Go to the documentation of this file.
2class SCR_BasePreviewEntry
3{
4 [Attribute()]
5 int m_iParentID;
6
7 [Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail, params: "xob et")]
8 ResourceName m_Mesh;
9
10 [Attribute(uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(EPreviewEntityFlag))]
11 EPreviewEntityFlag m_Flags;
12
13 [Attribute(uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EPreviewEntityShape))]
14 EPreviewEntityShape m_Shape;
15
16 [Attribute("-1")]
17 string m_iPivotID;
18
19 [Attribute(defvalue: "1 1 1")]
20 vector m_vScale;
21
22 [Attribute()]
23 vector m_vPosition;
24
25 [Attribute()]
26 vector m_vAngles;
27
28 float m_fQuat[4]; //--- Optional quaternion, used only in run-time, i.e., not on prefab
29 vector m_vAnglesTerrain;
30 float m_fHeightTerrain;
31 IEntity m_Entity;
32 IEntitySource m_EntitySource;
33 ref Resource m_Resource;
34
39 void SetScale(float scale)
40 {
41 m_vScale = Vector(scale, scale, scale);
42 }
43
49 float GetScale()
50 {
51 return m_vScale[0];
52 }
53
58 void SaveTransform(vector transform[4])
59 {
60 m_vAngles = Math3D.MatrixToAngles(transform);
61 Math3D.MatrixToQuat(transform, m_fQuat);
62 m_vPosition = transform[3];
63 }
68 void LoadTransform(vector outTransform[4])
69 {
70 if (m_fQuat[0] != 0 || m_fQuat[1] != 0 || m_fQuat[2] != 0 || m_fQuat[3] != 0)
71 Math3D.QuatToMatrix(m_fQuat, outTransform);
72 else
73 Math3D.AnglesToMatrix(Vector(m_vAngles[1], m_vAngles[0], m_vAngles[2]), outTransform); //--- Convert XYZ to XZY
74
75 outTransform[3] = m_vPosition;
76 }
77
78 void Log(int index)
79 {
80 string mesh = m_Mesh;
81 mesh = string.Format("%1: %2", typename.EnumToString(EPreviewEntityShape, m_Shape), mesh);
82 string flagNames = SCR_Enum.FlagsToString(EPreviewEntityFlag, m_Flags);
83 string text = string.Format("prt: %1 | pvt: '%2' | scl: %3 | pos: %4 | ang: %5 | angT: %6 | hT: %7 | flg: %8 | shape: '%9'", m_iParentID, m_iPivotID, m_vScale, m_vPosition, m_vAngles, m_vAnglesTerrain, m_fHeightTerrain, flagNames, mesh);
84 PrintFormat("%1: %2", index, text);
85 }
86 void CopyFrom(SCR_BasePreviewEntry from)
87 {
88 m_iParentID = from.m_iParentID;
89 m_Mesh = from.m_Mesh;
90 m_Flags = from.m_Flags;
91 m_Shape = from.m_Shape;
92 m_iPivotID = from.m_iPivotID;
93 m_vScale = from.m_vScale;
94 m_vPosition = from.m_vPosition;
95 m_fQuat = from.m_fQuat;
96 m_vAngles = from.m_vAngles;
97 m_vAnglesTerrain = from.m_vAnglesTerrain;
98 m_fHeightTerrain = from.m_fHeightTerrain;
99 m_Entity = from.m_Entity;
100 m_EntitySource = from.m_EntitySource;
101 }
102 void SCR_BasePreviewEntry(bool init = false)
103 {
104 if (init)
105 {
106 SetScale(1);
107 }
108 }
109#ifdef WORKBENCH
110 void SaveToContainer(WorldEditorAPI api, IEntitySource entitySource, array<ref ContainerIdPathEntry> entryPath)
111 {
112 api.SetVariableValue(entitySource, entryPath, "m_iParentID", m_iParentID.ToString());
113 api.SetVariableValue(entitySource, entryPath, "m_Mesh", m_Mesh);
114 api.SetVariableValue(entitySource, entryPath, "m_Shape", m_Shape.ToString());
115 api.SetVariableValue(entitySource, entryPath, "m_iPivotID", m_iPivotID);
116 api.SetVariableValue(entitySource, entryPath, "m_vScale", m_vScale.ToString(false));
117 api.SetVariableValue(entitySource, entryPath, "m_vPosition", m_vPosition.ToString(false));
118 api.SetVariableValue(entitySource, entryPath, "m_vAngles", m_vAngles.ToString(false));
119 api.SetVariableValue(entitySource, entryPath, "m_Flags", m_Flags.ToString());
120 }
121#endif
122};
vector scale
EPreviewEntityFlag
EPreviewEntityShape
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
override void Log()
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute
proto native vector Vector(float x, float y, float z)