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_GenericBoxEntity.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/Shapes"
, description:
"Procedural box"
, color:
"255 0 0 255"
, style:
"box"
, dynamicBox:
true
)]
2
class
SCR_GenericBoxEntityClass
: GenericEntityClass
3
{
4
};
5
9
class
SCR_GenericBoxEntity :
GenericEntity
10
{
11
[
Attribute
(
"1 1 1"
,
desc
:
"Size of the box"
,
category
:
"Generic Box"
)]
12
private
vector
m_vSize;
13
14
[
Attribute
(
desc
:
"Material mapped on outside and inside of the mesh. Inside mapping is mirrored."
, uiwidget:
UIWidgets
.ResourcePickerThumbnail,
params
:
"emat"
,
category
:
"Generic Box"
)]
15
private
ResourceName
m_Material;
16
17
void
Generate
(
vector
size
,
ResourceName
material)
18
{
19
private
float
vX =
size
[0] / 2;
20
private
float
vY =
size
[1] / 2;
21
private
float
vZ =
size
[2] / 2;
22
23
/*
24
7 - 6
25
/| /|
26
4 - 5
27
/ /
28
3 - 2
29
| |
30
0 - 1
31
*/
32
vector
vert0 =
Vector
(-vX, -vY, -vZ);
33
vector
vert1 =
Vector
( vX, -vY, -vZ);
34
vector
vert2 =
Vector
( vX, -vY, vZ);
35
vector
vert3 =
Vector
(-vX, -vY, vZ);
36
vector
vert4 =
Vector
(-vX, vY, -vZ);
37
vector
vert5 =
Vector
( vX, vY, -vZ);
38
vector
vert6 =
Vector
( vX, vY, vZ);
39
vector
vert7 =
Vector
(-vX, vY, vZ);
40
41
vector
verts[] =
42
{
43
vert2, vert3, vert0, vert1,
//--- Bottom: 0, 1, 2, 3
44
vert7, vert6, vert5, vert4,
//--- Top: 4, 5, 6, 7
45
vert4, vert5, vert1, vert0,
//--- Front: 8, 9, 10, 11
46
vert6, vert7, vert3, vert2,
//--- Back: 12, 13, 14, 15
47
vert7, vert4, vert0, vert3,
//--- Left: 16, 17, 18, 19
48
vert5, vert6, vert2, vert1,
//--- Right: 20, 21, 22, 23
49
};
50
51
int
indices[] =
52
{
53
0, 1, 2, 2, 3, 0,
//--- Bottom
54
4, 5, 6, 6, 7, 4,
//--- Top
55
8, 9, 10, 10, 11, 8,
//--- Front
56
12, 13, 14, 14, 15, 12,
//--- Back
57
16, 17, 18, 18, 19, 16,
//--- Left
58
20, 21, 22, 22, 23, 20,
//--- Right
59
};
60
float
uvs[] =
61
{
62
0,0, 1,0, 1,1, 0,1,
63
0,0, 1,0, 1,1, 0,1,
64
0,0, 1,0, 1,1, 0,1,
65
0,0, 1,0, 1,1, 0,1,
66
0,0, 1,0, 1,1, 0,1,
67
0,0, 1,0, 1,1, 0,1
68
};
69
70
int
numVertices[] = {24};
71
int
numIndices[] = {36};
72
string
materials[1] = {material};
73
74
Resource
res =
MeshObject
.Create(1, numVertices, numIndices, materials, 0);
75
MeshObject
meshObject = res.GetResource().ToMeshObject();
76
meshObject.UpdateVerts(0, verts, uvs);
77
meshObject.UpdateIndices(0, indices);
78
if
(meshObject) SetObject(meshObject,
""
);
79
}
80
81
void
SCR_GenericBoxEntity(
IEntitySource
src,
IEntity
parent)
82
{
83
Generate
(m_vSize, m_Material);
84
}
85
86
#ifdef WORKBENCH
87
override
void
_WB_GetBoundBox
(inout
vector
min, inout
vector
max,
IEntitySource
src)
88
{
89
min = -m_vSize / 2;
90
max = m_vSize / 2;
91
}
92
#endif
93
};
size
int size
Definition
PrefabImporter.c:35
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
Generate
void Generate()
Definition
SCR_ImageSetGenerator.c:205
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
GenericEntity
Definition
GenericEntity.c:16
GenericEntity::_WB_GetBoundBox
event void _WB_GetBoundBox(inout vector min, inout vector max, IEntitySource src)
Editor needs to know a bound box of entity (For ray-casting, visualizers etc.). You can return any cu...
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntitySource
Definition
IEntitySource.c:13
MeshObject
MeshObject.
Definition
MeshObject.c:34
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_GenericBoxEntityClass
Definition
SCR_GenericBoxEntity.c:3
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
Vector
proto native vector Vector(float x, float y, float z)
scripts
Game
Entities
SCR_GenericBoxEntity.c
Generated by
1.17.0