-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.ebnf
189 lines (152 loc) · 3.65 KB
/
game.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
GameControl1 ::= tagGameControl1 Length ObjectID Time1
VarInt Time1 /* buttons state and last time state changed */
Float16 Float16 /* left stick x,y */
Float16 Float16 /* right stick x,y */
Head1 ::= tagHead1 Length ObjectID Time1 Loc2 Rot2
( tagHeadIpd Length Float16 /* IPD */ )?
Mesh1 ::= tagMesh1 Length ObjectID
( TextureUrl1 | TextureRtpPT1 )
VarUInt /* num Vertexes */
Loc1+ /* vertexes */
VarUInt /* numNormals */
Norm1* /* normals */
VarUInt /* numTextureCoord */
TextureUV1* /* textureCoord */
VarUInt /* numTrianglesIndex */
VarUInt+ /* trianglesIndex */
Mesh2::= tagMesh2 Length ObjectID
Loc2 Rot2 Scale2
MeshUrl1
( TextureUrl1 | TextureRtpPT1 )? /* Optional Texture Map */
( tagParent1 Length ObjectID )? /* Optional Parent */
Object1 ::= tagObject1 Length ObjectID Time1
Loc1
Rot1
Scale1
Boolean /* Active */
( tagParent1 Length ObjectID )? /* Optional Parent */
Object2 ::= tagObject2 Length ObjectID Time1
Loc2
Rot2
Scale2
Boolean /* Active */
( tagParent1 Length ObjectID )? /* Optional Parent */
Hand1 ::= tagHand1 Length ObjectID Time1
Boolean /* left */
Loc2 Rot2
Hand2 ::= tagHand2 Length ObjectID Time1
Boolean /* left */
Loc2 Rot2
Transform1 /* wrist */
Transform1 /* thumbTip */
Transform1 /* thumbIP */
Transform1 /* thumbMCP */
Transform1 /* thumbCMC */
Transform1 /* indexTip */
Transform1 /* indexDIP */
Transform1 /* indexPIP */
Transform1 /* indexMCP */
Transform1 /* indexCMC */
Transform1 /* middleTip */
Transform1 /* middleDIP */
Transform1 /* middlePIP */
Transform1 /* middleMCP */
Transform1 /* middleCMC */
Transform1 /* ringTip */
Transform1 /* ringDIP */
Transform1 /* ringPIP */
Transform1 /* ringMCP */
Transform1 /* ringCMC */
Transform1 /* pinkyTip */
Transform1 /* pinkyDIP */
Transform1 /* pinkyPIP */
Transform1 /* pinkyMCP */
Transform1 /* pinkyCMC */
Tag ::= VarUInt
tagInvalid ::= #x00
tagHead1 ::= #x01
tagHand1 ::= #x02
tagObject1 ::= #x03
tagParent1 ::= #x04
tagMesh1 ::= #x80 #x00
tagHand2 ::= #x80 #x01
tagHeadIpd ::= #x80 #x02
tagMesh2 ::= #x80 #x04
tagObject2 ::= #x80 #x03
ObjectID ::= VarUInt
Length ::= VarUInt
Loc1 ::=
Float32 /* x */
Float32 /* y */
Float32 /* z */
Loc2 ::=
Float32 /* x */
Float32 /* y */
Float32 /* z */
Float16 /* vx */
Float16 /* vy */
Float16 /* vz */
Scale1 ::=
Float16 /* all dimensions */
Scale2 ::=
Float32 /* x */
Float32 /* y */
Float32 /* z */
Float16 /* vx */
Float16 /* vy */
Float16 /* vz */
Norm1 ::=
Float16 /* x */
Float16 /* y */
Float16 /* z */
TextureUV1 ::=
Float32 /* u */
Float32 /* v */
Rot1 ::=
Float16 /* i */
Float16 /* j */
Float16 /* k */
/* w computed based on quaternion is normalized */
Rot2 ::=
Float16 /* s.i */
Float16 /* s.j */
Float16 /* s.k */
Float16 /* e.i */
Float16 /* e.j */
Float16 /* e.k */
Transform1 ::=
Float16 /* tx */
Float16 /* ty */
Float16 /* tz */
TextureUrl1 ::= String
MeshUrl1 ::= String
TextureRtpPT1 ::= UInt8 /* pt */
Time1 ::= UInt16 /* time in ms */
Tag ::= VarUInt
Boolean ::= #x00 | #x01
String ::= VarUInt byte*
Blob ::= VarUInt byte*
Float16 ::= byte byte
Float32 ::= byte byte byte byte
Float64 ::= byte byte byte byte byte byte byte byte
Int8 ::= byte
Int16 ::= byte byte
Int32 ::= byte byte byte byte
Int64 ::= byte byte byte byte byte byte byte byte
UInt8 ::= byte
UInt16 ::= byte byte
UInt32 ::= byte byte byte byte
UInt64 ::= byte byte byte byte byte byte byte byte
VarUInt ::=
( [#x0-#x7F] ) |
( [#x80-#x87] byte ) |
( [#x88-#x8B] byte byte ) |
( #xE1 UInt32 ) |
( #xE2 UInt64 )
VarInt ::=
( [#x0-#x7F] ) |
( [#x80-#x87] byte ) |
( [#x88-#x8B] byte byte ) |
( #xE1 Int32 ) |
( #xE2 Int64 )
byte ::= [#x00-#xFF]