Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
componententitydebug.c
Go to the documentation of this file.
1
class
ComponentEntityDebug
extends
Component
2
{
3
4
protected
Shape
m_DebugShapeBBox
;
5
protected
Shape
m_DebugShapeDirection
;
6
protected
float
m_DebugShapeDirectionDist
;
7
8
// -------------------------------------------------------------------------
9
override
Shape
DebugBBoxDraw
()
10
{
11
#ifndef DEVELOPER
12
return
null;
13
#endif
14
15
if
(
m_DebugShapeBBox
)
16
m_DebugShapeBBox
.Destroy();
17
18
vector
min_max[2];
19
20
if
(!
m_ThisEntityAI
.GetCollisionBox(min_max))
21
return
null;
22
23
m_DebugShapeBBox
=
Debug
.
DrawBox
(min_max[0], min_max[1]);
24
25
g_Game
.GetCallQueue(
CALL_CATEGORY_GUI
).CallLater(
OnDrawing
, 0,
true
);
26
27
m_ThisEntityAI
.SetEventMask(
EntityEvent
.FRAME);
28
29
return
null;
30
}
31
32
// -------------------------------------------------------------------------
33
override
void
DebugBBoxSetColor
(
int
color)
34
{
35
if
(
m_DebugShapeBBox
)
36
{
37
m_DebugShapeBBox
.SetColor(color);
38
}
39
}
40
41
// -------------------------------------------------------------------------
42
override
void
DebugBBoxDelete
()
43
{
44
#ifndef DEVELOPER
45
return
;
46
#endif
47
48
if
(
m_DebugShapeBBox
)
49
{
50
m_DebugShapeBBox
.Destroy();
51
m_DebugShapeBBox
= null;
52
}
53
54
if
( !
m_DebugShapeDirection
&& !
m_DebugShapeBBox
)
55
{
56
g_Game
.GetCallQueue(
CALL_CATEGORY_GUI
).Remove(
OnDrawing
);
57
}
58
}
59
60
// -------------------------------------------------------------------------
61
override
Shape
DebugDirectionDraw
(
float
distance = 1)
62
{
63
#ifndef DEVELOPER
64
return
null;
65
#endif
66
67
if
(
m_DebugShapeDirection
)
68
{
69
m_DebugShapeDirection
.Destroy();
70
}
71
72
vector
p1 =
"0 0 0"
;
73
vector
p2 =
m_ThisEntityAI
.GetDirection() *
m_DebugShapeDirectionDist
;
74
m_DebugShapeDirectionDist
= distance;
75
m_DebugShapeDirection
=
Debug
.
DrawArrow
(p1, p2);
76
77
g_Game
.GetCallQueue(
CALL_CATEGORY_GUI
).CallLater(
OnDrawing
, 0,
true
);
78
79
m_ThisEntityAI
.SetEventMask(
EntityEvent
.FRAME);
80
return
null;
81
}
82
83
// -------------------------------------------------------------------------
84
override
void
DebugDirectionDelete
()
85
{
86
#ifndef DEVELOPER
87
return
;
88
#endif
89
90
if
(
m_DebugShapeDirection
)
91
{
92
m_DebugShapeDirection
.Destroy();
93
m_DebugShapeDirection
= null;
94
}
95
96
if
( !
m_DebugShapeDirection
&& !
m_DebugShapeBBox
)
97
{
98
g_Game
.GetCallQueue(
CALL_CATEGORY_GUI
).Remove(
OnDrawing
);
99
}
100
}
101
102
void
OnDrawing
()
103
{
104
#ifndef DEVELOPER
105
return
;
106
#endif
107
108
if
(
m_DebugShapeBBox
||
m_DebugShapeDirection
)
109
{
110
vector
mat[4];
111
m_ThisEntityAI
.GetTransform(mat);
112
113
if
(
m_DebugShapeBBox
)
114
{
115
m_DebugShapeBBox
.SetMatrix(mat);
116
}
117
118
if
(
m_DebugShapeDirection
)
119
{
120
m_DebugShapeDirection
.SetMatrix(mat);
121
}
122
}
123
}
124
}
Component
Definition
component.c:16
Component::m_DebugShapeBBox
Shape m_DebugShapeBBox
Definition
componententitydebug.c:4
Component::DebugDirectionDraw
override Shape DebugDirectionDraw(float distance=1)
Definition
componententitydebug.c:61
Component::m_DebugShapeDirection
Shape m_DebugShapeDirection
Definition
componententitydebug.c:5
Component::m_DebugShapeDirectionDist
float m_DebugShapeDirectionDist
Definition
componententitydebug.c:6
Component::m_ThisEntityAI
EntityAI m_ThisEntityAI
Definition
component.c:24
Component::DebugBBoxSetColor
override void DebugBBoxSetColor(int color)
Definition
componententitydebug.c:33
Component::DebugBBoxDelete
override void DebugBBoxDelete()
Definition
componententitydebug.c:42
Component::DebugDirectionDelete
override void DebugDirectionDelete()
Definition
componententitydebug.c:84
Component::DebugBBoxDraw
override Shape DebugBBoxDraw()
Definition
componententitydebug.c:9
Component::OnDrawing
void OnDrawing()
Definition
componententitydebug.c:102
Debug
Definition
debug.c:2
Debug::DrawArrow
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
Definition
debug.c:483
Debug::DrawBox
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
Definition
debug.c:349
vector
Definition
enconvert.c:119
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
Shape
class DiagMenu Shape
Instance of created debug visualizer.
EntityEvent
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition
enentity.c:45
CALL_CATEGORY_GUI
const int CALL_CATEGORY_GUI
Definition
tools.c:9
Games
Dayz
scripts
3_game
tools
component
componententitydebug.c
Generated by
1.17.0