Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ResourceContainerVirtual.c
Go to the documentation of this file.
3{
4 [Attribute(defvalue: "0 0 0", uiwidget: UIWidgets.Coords, params: "inf inf purpose=coords space=entity")]
6
7 [Attribute(defvalue: "0 0 0", uiwidget: UIWidgets.Coords, params: "inf inf purpose=coords space=entity")]
9
10 //------------------------------------------------------------------------------------------------
11 override void GetBoundingVolume(inout vector mins, inout vector maxs)
12 {
15 }
16
17 override void GetAxisAlignedBoundingVolume(inout vector mins, inout vector maxs)
18 {
19 if (!m_Owner)
20 return;
21
22 vector mat[3];
23
24 m_Owner.GetWorldTransform(mat);
25
28 vector p3 = p1;
29 vector p4 = p2;
30
31 p3[2] = p3[2] + p2[2];
32 p4[2] = p4[2] + p1[2];
33
34 p1 = p1.Multiply3(mat);
35 p2 = p2.Multiply3(mat);
36 p3 = p3.Multiply3(mat);
37 p4 = p4.Multiply3(mat);
38
39 float minX = Math.Min(Math.Min(Math.Min(p1[0], p2[0]), p3[0]), p4[0]);
40 float maxX = Math.Max(Math.Max(Math.Max(p1[0], p2[0]), p3[0]), p4[0]);
41 float minZ = Math.Min(Math.Min(Math.Min(p1[2], p2[2]), p2[2]), p4[2]);
42 float maxZ = Math.Max(Math.Max(Math.Max(p1[2], p2[2]), p2[2]), p4[2]);
43
44 mins = Vector(minX, p1[1], minZ);
45 maxs = Vector(maxX, p2[1], maxZ);
46 }
47
48 //------------------------------------------------------------------------------------------------
49 override void CopyFromContainer(notnull SCR_ResourceContainer container)
50 {
51 super.CopyFromContainer(container);
52
53 SCR_ResourceContainerVirtual containerCasted = SCR_ResourceContainerVirtual.Cast(container);
54
57 }
58
59 //------------------------------------------------------------------------------------------------
60 override bool IsInRange(vector origin, float range)
61 {
62 return Math3D.IntersectionSphereAABB(origin - m_Owner.GetOrigin(), range, m_vBoundingVolumeMins, m_vBoundingVolumeMaxs);
63 }
64
65 //------------------------------------------------------------------------------------------------
66 override void DebugDraw(bool shouldShowRange = true)
67 {
68 super.DebugDraw(shouldShowRange);
69
70 if (!m_Owner)
71 return;
72
73 Color color1 = GetDebugColor();
74 Color color2 = GetDebugColor();
75 vector containerMat[4];
76
77 m_Owner.GetWorldTransform(containerMat);
78 color1.SetA(0.5);
79 color2.SetR(0.0);
80 color2.SetG(0.0);
81 color2.SetB(0.0);
82 color2.SetA(1.0);
83 Shape.Create(ShapeType.BBOX, color1.PackToInt(), ShapeFlags.ONCE | ShapeFlags.DEPTH_DITHER | ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE, m_vBoundingVolumeMins, m_vBoundingVolumeMaxs).SetMatrix(containerMat);
84 containerMat[0] = containerMat[0] * 1.05;
85 containerMat[1] = containerMat[1] * 1.05;
86 containerMat[2] = containerMat[2] * 1.05;
87 Shape.Create(ShapeType.BBOX, color2.PackToInt(), ShapeFlags.ONCE | ShapeFlags.DEPTH_DITHER | ShapeFlags.WIREFRAME, m_vBoundingVolumeMins, m_vBoundingVolumeMaxs).SetMatrix(containerMat);
88 }
89}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition Color.c:13
Definition Math.c:13
override bool IsInRange(vector origin, float range)
override void GetAxisAlignedBoundingVolume(inout vector mins, inout vector maxs)
override void CopyFromContainer(notnull SCR_ResourceContainer container)
override void DebugDraw(bool shouldShowRange=true)
override void GetBoundingVolume(inout vector mins, inout vector maxs)
Instance of created debug visualizer.
Definition Shape.c:14
ShapeType
Definition ShapeType.c:13
ShapeFlags
Definition ShapeFlags.c:13
SCR_FieldOfViewSettings Attribute
proto native vector Vector(float x, float y, float z)