Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
CesiumIntVecN.cs
Go to the documentation of this file.
1using System;
2using Unity.Mathematics;
3
4namespace CesiumForUnity
5{
6
16 internal struct CesiumIntVec2
17 {
18 public CesiumMetadataComponentType componentType
19 {
20 get; private set;
21 }
22
23 public Int64 x
24 {
25 get; private set;
26 }
27 public Int64 y
28 {
29 get; private set;
30 }
31
32 public CesiumIntVec2(SByte x, SByte y)
33 {
34 this.componentType = CesiumMetadataComponentType.Int8;
35 this.x = x;
36 this.y = y;
37 }
38
39 public CesiumIntVec2(Int16 x, Int16 y)
40 {
41 this.componentType = CesiumMetadataComponentType.Int16;
42 this.x = x;
43 this.y = y;
44 }
45
46 public CesiumIntVec2(Int32 x, Int32 y)
47 {
48 this.componentType = CesiumMetadataComponentType.Int32;
49 this.x = x;
50 this.y = y;
51 }
52
53 public CesiumIntVec2(Int64 x, Int64 y)
54 {
55 this.componentType = CesiumMetadataComponentType.Int64;
56 this.x = x;
57 this.y = y;
58 }
59
60 public CesiumIntVec2(int2 unityInt2)
61 {
62 this.componentType = CesiumMetadataComponentType.Int32;
63 this.x = unityInt2.x;
64 this.y = unityInt2.y;
65 }
66
67 public Int64 this[int index]
68 {
69 get
70 {
71 switch (index)
72 {
73 case 0:
74 return x;
75 case 1:
76 return y;
77 default:
78 throw new System.IndexOutOfRangeException();
79 }
80 }
81 }
82 }
83
93 internal struct CesiumIntVec3
94 {
95 public CesiumMetadataComponentType componentType
96 {
97 get; private set;
98 }
99
100 public Int64 x
101 {
102 get; private set;
103 }
104 public Int64 y
105 {
106 get; private set;
107 }
108 public Int64 z
109 {
110 get; private set;
111 }
112
113 public CesiumIntVec3(SByte x, SByte y, SByte z)
114 {
115 this.componentType = CesiumMetadataComponentType.Int8;
116 this.x = x;
117 this.y = y;
118 this.z = z;
119 }
120
121 public CesiumIntVec3(Int16 x, Int16 y, Int16 z)
122 {
123 this.componentType = CesiumMetadataComponentType.Int16;
124 this.x = x;
125 this.y = y;
126 this.z = z;
127 }
128
129 public CesiumIntVec3(Int32 x, Int32 y, Int32 z)
130 {
131 this.componentType = CesiumMetadataComponentType.Int32;
132 this.x = x;
133 this.y = y;
134 this.z = z;
135 }
136
137 public CesiumIntVec3(Int64 x, Int64 y, Int64 z)
138 {
139 this.componentType = CesiumMetadataComponentType.Int64;
140 this.x = x;
141 this.y = y;
142 this.z = z;
143 }
144
145 public CesiumIntVec3(int3 unityInt3)
146 {
147 this.componentType = CesiumMetadataComponentType.Int32;
148 this.x = unityInt3.x;
149 this.y = unityInt3.y;
150 this.z = unityInt3.z;
151 }
152
153 public Int64 this[int index]
154 {
155 get
156 {
157 switch (index)
158 {
159 case 0:
160 return x;
161 case 1:
162 return y;
163 case 2:
164 return z;
165 default:
166 throw new System.IndexOutOfRangeException();
167 }
168 }
169 }
170 }
171
181 internal struct CesiumIntVec4
182 {
183 public CesiumMetadataComponentType componentType
184 {
185 get; private set;
186 }
187
188 public Int64 x
189 {
190 get; private set;
191 }
192 public Int64 y
193 {
194 get; private set;
195 }
196 public Int64 z
197 {
198 get; private set;
199 }
200 public Int64 w
201 {
202 get; private set;
203 }
204
205 public CesiumIntVec4(SByte x, SByte y, SByte z, SByte w)
206 {
207 this.componentType = CesiumMetadataComponentType.Int8;
208 this.x = x;
209 this.y = y;
210 this.z = z;
211 this.w = w;
212 }
213 public CesiumIntVec4(Int16 x, Int16 y, Int16 z, Int16 w)
214 {
215 this.componentType = CesiumMetadataComponentType.Int16;
216 this.x = x;
217 this.y = y;
218 this.z = z;
219 this.w = w;
220 }
221 public CesiumIntVec4(Int32 x, Int32 y, Int32 z, Int32 w)
222 {
223 this.componentType = CesiumMetadataComponentType.Int32;
224 this.x = x;
225 this.y = y;
226 this.z = z;
227 this.w = w;
228 }
229
230 public CesiumIntVec4(Int64 x, Int64 y, Int64 z, Int64 w)
231 {
232 this.componentType = CesiumMetadataComponentType.Int64;
233 this.x = x;
234 this.y = y;
235 this.z = z;
236 this.w = w;
237 }
238
239 public CesiumIntVec4(int4 unityInt4)
240 {
241 this.componentType = CesiumMetadataComponentType.Int32;
242 this.x = unityInt4.x;
243 this.y = unityInt4.y;
244 this.z = unityInt4.z;
245 this.w = unityInt4.w;
246 }
247
248 public Int64 this[int index]
249 {
250 get
251 {
252 switch (index)
253 {
254 case 0:
255 return x;
256 case 1:
257 return y;
258 case 2:
259 return z;
260 case 3:
261 return w;
262 default:
263 throw new System.IndexOutOfRangeException();
264 }
265 }
266 }
267 }
268
277 internal struct CesiumUintVec2
278 {
279 public CesiumMetadataComponentType componentType
280 {
281 get; private set;
282 }
283
284 public UInt64 x
285 {
286 get; private set;
287 }
288 public UInt64 y
289 {
290 get; private set;
291 }
292
293 public CesiumUintVec2(Byte x, Byte y)
294 {
295 this.componentType = CesiumMetadataComponentType.Uint8;
296 this.x = x;
297 this.y = y;
298 }
299
300 public CesiumUintVec2(UInt16 x, UInt16 y)
301 {
302 this.componentType = CesiumMetadataComponentType.Uint16;
303 this.x = x;
304 this.y = y;
305 }
306
307 public CesiumUintVec2(UInt32 x, UInt32 y)
308 {
309 this.componentType = CesiumMetadataComponentType.Uint32;
310 this.x = x;
311 this.y = y;
312 }
313
314 public CesiumUintVec2(UInt64 x, UInt64 y)
315 {
316 this.componentType = CesiumMetadataComponentType.Uint64;
317 this.x = x;
318 this.y = y;
319 }
320 public CesiumUintVec2(uint2 unityUint2)
321 {
322 this.componentType = CesiumMetadataComponentType.Uint32;
323 this.x = unityUint2.x;
324 this.y = unityUint2.y;
325 }
326
327 public UInt64 this[int index]
328 {
329 get
330 {
331 switch (index)
332 {
333 case 0:
334 return x;
335 case 1:
336 return y;
337 default:
338 throw new System.IndexOutOfRangeException();
339 }
340 }
341 }
342 }
343
352 internal struct CesiumUintVec3
353 {
354 public CesiumMetadataComponentType componentType
355 {
356 get; private set;
357 }
358 public UInt64 x
359 {
360 get; private set;
361 }
362 public UInt64 y
363 {
364 get; private set;
365 }
366 public UInt64 z
367 {
368 get; private set;
369 }
370
371 public CesiumUintVec3(Byte x, Byte y, Byte z)
372 {
373 this.componentType = CesiumMetadataComponentType.Uint8;
374 this.x = x;
375 this.y = y;
376 this.z = z;
377 }
378
379 public CesiumUintVec3(UInt16 x, UInt16 y, UInt16 z)
380 {
381 this.componentType = CesiumMetadataComponentType.Uint16;
382 this.x = x;
383 this.y = y;
384 this.z = z;
385 }
386
387 public CesiumUintVec3(UInt32 x, UInt32 y, UInt32 z)
388 {
389 this.componentType = CesiumMetadataComponentType.Uint32;
390 this.x = x;
391 this.y = y;
392 this.z = z;
393 }
394
395 public CesiumUintVec3(UInt64 x, UInt64 y, UInt64 z)
396 {
397 this.componentType = CesiumMetadataComponentType.Uint64;
398 this.x = x;
399 this.y = y;
400 this.z = z;
401 }
402
403 public CesiumUintVec3(uint3 unityUint3)
404 {
405 this.componentType = CesiumMetadataComponentType.Uint32;
406 this.x = unityUint3.x;
407 this.y = unityUint3.y;
408 this.z = unityUint3.z;
409 }
410 public UInt64 this[int index]
411 {
412 get
413 {
414 switch (index)
415 {
416 case 0:
417 return x;
418 case 1:
419 return y;
420 case 2:
421 return z;
422 default:
423 throw new System.IndexOutOfRangeException();
424 }
425 }
426 }
427 }
428
437 internal struct CesiumUintVec4
438 {
439 public CesiumMetadataComponentType componentType
440 {
441 get; private set;
442 }
443
444 public UInt64 x
445 {
446 get; private set;
447 }
448 public UInt64 y
449 {
450 get; private set;
451 }
452 public UInt64 z
453 {
454 get; private set;
455 }
456 public UInt64 w
457 {
458 get; private set;
459 }
460
461 public CesiumUintVec4(Byte x, Byte y, Byte z, Byte w)
462 {
463 this.componentType = CesiumMetadataComponentType.Uint8;
464 this.x = x;
465 this.y = y;
466 this.z = z;
467 this.w = w;
468 }
469
470 public CesiumUintVec4(UInt16 x, UInt16 y, UInt16 z, UInt16 w)
471 {
472 this.componentType = CesiumMetadataComponentType.Uint16;
473 this.x = x;
474 this.y = y;
475 this.z = z;
476 this.w = w;
477 }
478
479 public CesiumUintVec4(UInt32 x, UInt32 y, UInt32 z, UInt32 w)
480 {
481 this.componentType = CesiumMetadataComponentType.Uint32;
482 this.x = x;
483 this.y = y;
484 this.z = z;
485 this.w = w;
486 }
487
488 public CesiumUintVec4(UInt64 x, UInt64 y, UInt64 z, UInt64 w)
489 {
490 this.componentType = CesiumMetadataComponentType.Uint64;
491 this.x = x;
492 this.y = y;
493 this.z = z;
494 this.w = w;
495 }
496 public CesiumUintVec4(uint4 unityUint4)
497 {
498 this.componentType = CesiumMetadataComponentType.Uint32;
499 this.x = unityUint4.x;
500 this.y = unityUint4.y;
501 this.z = unityUint4.z;
502 this.w = unityUint4.w;
503 }
504
505 public UInt64 this[int index]
506 {
507 get
508 {
509 switch (index)
510 {
511 case 0:
512 return x;
513 case 1:
514 return y;
515 case 2:
516 return z;
517 case 3:
518 return w;
519 default:
520 throw new System.IndexOutOfRangeException();
521 }
522 }
523 }
524 }
525}
CesiumMetadataComponentType
Identifies the component type of a property in EXT_structural_metadata.