DayZ 1.24
Loading...
Searching...
No Matches
CameraTools.c
Go to the documentation of this file.
1#ifdef DIAG_DEVELOPER
3{
6 {
7 switch (rpc_type)
8 {
9 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
10 {
12 if (ctx.Read(p4))
13 {
14 foreach (int index, Man p : m_Subscribers)
15 {
16 if (p)
17 GetGame().RPCSingleParam(p, ERPCs.DIAG_CAMERATOOLS_CAM_DATA, p4, true, p.GetIdentity());
18 else
19 m_Subscribers.Remove(index);
20 }
21 }
22 break;
23 }
24 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
25 {
27
28 if (ctx.Read(par2))
29 {
30 bool enable = par2.param1;
31 Man player = par2.param2;
32
33 bool found = false;
34 foreach (int i, Man m : m_Subscribers)
35 {
36 if (m == player)
37 {
38 if (!enable)
39 {
40 m_Subscribers.Remove(i);
41 return;
42 }
43 found = true;
45 }
46 }
47 if (!found && enable)//not found in the array, insert it
48 m_Subscribers.Insert(player);
49 }
50 break;
51 }
52 }
53 }
54};
55
57{
59
61 {
62 if (m_DebugShape)
63 m_DebugShape.Destroy();
64 }
65
66 void DelayedDestroy()
67 {
68 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(DestroyNow, 2000);
69 }
70
71 void DestroyNow()
72 {
73 delete this;
74 }
75
77 {
78 if (m_DebugShape)
79 {
80 m_DebugShape.Destroy();
82 }
83
85 if (ctx.Read(p4))
86 {
87 vector pos = p4.param1;
88 vector dir = p4.param2;
89 float plane = p4.param3;
90 float fov = p4.param4 * Math.RAD2DEG;
91
92
94 vector mat[4];
96 mat[3] = pos;
97 m_DebugShape.SetMatrix(mat);
98
99 }
100 }
101};
102#endif
Shape m_DebugShape
void OnRPC(ParamsReadContext ctx)
ERPCs
Definition ERPCs.c:2
Definition Debug.c:14
static Shape DrawFrustum(float horizontalAngle, float verticalAngle, float length, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.WIREFRAME)
Definition Debug.c:442
Definition EnMath.c:7
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
static const vector Zero
Definition EnConvert.c:110
static const vector Up
Definition EnConvert.c:107
proto native CGame GetGame()
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
static proto void DirectionAndUpMatrix(vector dir, vector up, out vector mat[4])
Creates rotation matrix from direction and up vector.
static const float RAD2DEG
Definition EnMath.c:16
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8