-
Notifications
You must be signed in to change notification settings - Fork 7
/
Mat4.hx
500 lines (445 loc) · 15.2 KB
/
Mat4.hx
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
#if (vector_math_f32 && (cpp || hl || cs || java))
// override Float (usually f64) type with f32
@:eager private typedef Float = Single;
#end
abstract Mat4(Mat4Data) from Mat4Data to Mat4Data {
#if !macro
public inline function new(
a00: Float, a01: Float, a02: Float, a03: Float,
a10: Float, a11: Float, a12: Float, a13: Float,
a20: Float, a21: Float, a22: Float, a23: Float,
a30: Float, a31: Float, a32: Float, a33: Float
) {
this = new Mat4Data(
a00, a01, a02, a03,
a10, a11, a12, a13,
a20, a21, a22, a23,
a30, a31, a32, a33
);
}
public inline function set(
a00: Float, a01: Float, a02: Float, a03: Float,
a10: Float, a11: Float, a12: Float, a13: Float,
a20: Float, a21: Float, a22: Float, a23: Float,
a30: Float, a31: Float, a32: Float, a33: Float
) {
this.c0.set(a00, a01, a02, a03);
this.c1.set(a10, a11, a12, a13);
this.c2.set(a20, a21, a22, a23);
this.c3.set(a30, a31, a32, a33);
}
public inline function copyFrom(v: Mat4) {
var v: Mat4Data = v;
this.c0.copyFrom(v.c0);
this.c1.copyFrom(v.c1);
this.c2.copyFrom(v.c2);
this.c3.copyFrom(v.c3);
return this;
}
public inline function clone(): Mat4 {
return new Mat4(
this.c0.x, this.c0.y, this.c0.z, this.c0.w,
this.c1.x, this.c1.y, this.c1.z, this.c1.w,
this.c2.x, this.c2.y, this.c2.z, this.c2.w,
this.c3.x, this.c3.y, this.c3.z, this.c3.w
);
}
public inline function matrixCompMult(n: Mat4): Mat4 {
var m = this;
var n: Mat4Data = n;
return new Mat4(
m.c0.x * n.c0.x, m.c0.y * n.c0.y, m.c0.z * n.c0.z, m.c0.w * n.c0.w,
m.c1.x * n.c1.x, m.c1.y * n.c1.y, m.c1.z * n.c1.z, m.c1.w * n.c1.w,
m.c2.x * n.c2.x, m.c2.y * n.c2.y, m.c2.z * n.c2.z, m.c2.w * n.c2.w,
m.c3.x * n.c3.x, m.c3.y * n.c3.y, m.c3.z * n.c3.z, m.c3.w * n.c3.w
);
}
// extended methods
public inline function transpose(): Mat4 {
var m = this;
return new Mat4(
m.c0.x, m.c1.x, m.c2.x, m.c3.x,
m.c0.y, m.c1.y, m.c2.y, m.c3.y,
m.c0.z, m.c1.z, m.c2.z, m.c3.z,
m.c0.w, m.c1.w, m.c2.w, m.c3.w
);
}
public inline function determinant(): Float {
var m = this;
var b0 = m.c0.x * m.c1.y - m.c0.y * m.c1.x;
var b1 = m.c0.x * m.c1.z - m.c0.z * m.c1.x;
var b2 = m.c0.y * m.c1.z - m.c0.z * m.c1.y;
var b3 = m.c2.x * m.c3.y - m.c2.y * m.c3.x;
var b4 = m.c2.x * m.c3.z - m.c2.z * m.c3.x;
var b5 = m.c2.y * m.c3.z - m.c2.z * m.c3.y;
var b6 = m.c0.x * b5 - m.c0.y * b4 + m.c0.z * b3;
var b7 = m.c1.x * b5 - m.c1.y * b4 + m.c1.z * b3;
var b8 = m.c2.x * b2 - m.c2.y * b1 + m.c2.z * b0;
var b9 = m.c3.x * b2 - m.c3.y * b1 + m.c3.z * b0;
return m.c1.w * b6 - m.c0.w * b7 + m.c3.w * b8 - m.c2.w * b9;
}
public inline function inverse(): Mat4 {
var m = this;
var b00 = m.c0.x * m.c1.y - m.c0.y * m.c1.x;
var b01 = m.c0.x * m.c1.z - m.c0.z * m.c1.x;
var b02 = m.c0.x * m.c1.w - m.c0.w * m.c1.x;
var b03 = m.c0.y * m.c1.z - m.c0.z * m.c1.y;
var b04 = m.c0.y * m.c1.w - m.c0.w * m.c1.y;
var b05 = m.c0.z * m.c1.w - m.c0.w * m.c1.z;
var b06 = m.c2.x * m.c3.y - m.c2.y * m.c3.x;
var b07 = m.c2.x * m.c3.z - m.c2.z * m.c3.x;
var b08 = m.c2.x * m.c3.w - m.c2.w * m.c3.x;
var b09 = m.c2.y * m.c3.z - m.c2.z * m.c3.y;
var b10 = m.c2.y * m.c3.w - m.c2.w * m.c3.y;
var b11 = m.c2.z * m.c3.w - m.c2.w * m.c3.z;
// determinant
var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
var f = 1.0 / det;
return new Mat4(
(m.c1.y * b11 - m.c1.z * b10 + m.c1.w * b09) * f,
(m.c0.z * b10 - m.c0.y * b11 - m.c0.w * b09) * f,
(m.c3.y * b05 - m.c3.z * b04 + m.c3.w * b03) * f,
(m.c2.z * b04 - m.c2.y * b05 - m.c2.w * b03) * f,
(m.c1.z * b08 - m.c1.x * b11 - m.c1.w * b07) * f,
(m.c0.x * b11 - m.c0.z * b08 + m.c0.w * b07) * f,
(m.c3.z * b02 - m.c3.x * b05 - m.c3.w * b01) * f,
(m.c2.x * b05 - m.c2.z * b02 + m.c2.w * b01) * f,
(m.c1.x * b10 - m.c1.y * b08 + m.c1.w * b06) * f,
(m.c0.y * b08 - m.c0.x * b10 - m.c0.w * b06) * f,
(m.c3.x * b04 - m.c3.y * b02 + m.c3.w * b00) * f,
(m.c2.y * b02 - m.c2.x * b04 - m.c2.w * b00) * f,
(m.c1.y * b07 - m.c1.x * b09 - m.c1.z * b06) * f,
(m.c0.x * b09 - m.c0.y * b07 + m.c0.z * b06) * f,
(m.c3.y * b01 - m.c3.x * b03 - m.c3.z * b00) * f,
(m.c2.x * b03 - m.c2.y * b01 + m.c2.z * b00) * f
);
}
public inline function adjoint(): Mat4 {
var m = this;
var b00 = m.c0.x * m.c1.y - m.c0.y * m.c1.x;
var b01 = m.c0.x * m.c1.z - m.c0.z * m.c1.x;
var b02 = m.c0.x * m.c1.w - m.c0.w * m.c1.x;
var b03 = m.c0.y * m.c1.z - m.c0.z * m.c1.y;
var b04 = m.c0.y * m.c1.w - m.c0.w * m.c1.y;
var b05 = m.c0.z * m.c1.w - m.c0.w * m.c1.z;
var b06 = m.c2.x * m.c3.y - m.c2.y * m.c3.x;
var b07 = m.c2.x * m.c3.z - m.c2.z * m.c3.x;
var b08 = m.c2.x * m.c3.w - m.c2.w * m.c3.x;
var b09 = m.c2.y * m.c3.z - m.c2.z * m.c3.y;
var b10 = m.c2.y * m.c3.w - m.c2.w * m.c3.y;
var b11 = m.c2.z * m.c3.w - m.c2.w * m.c3.z;
return new Mat4(
m.c1.y * b11 - m.c1.z * b10 + m.c1.w * b09,
m.c0.z * b10 - m.c0.y * b11 - m.c0.w * b09,
m.c3.y * b05 - m.c3.z * b04 + m.c3.w * b03,
m.c2.z * b04 - m.c2.y * b05 - m.c2.w * b03,
m.c1.z * b08 - m.c1.x * b11 - m.c1.w * b07,
m.c0.x * b11 - m.c0.z * b08 + m.c0.w * b07,
m.c3.z * b02 - m.c3.x * b05 - m.c3.w * b01,
m.c2.x * b05 - m.c2.z * b02 + m.c2.w * b01,
m.c1.x * b10 - m.c1.y * b08 + m.c1.w * b06,
m.c0.y * b08 - m.c0.x * b10 - m.c0.w * b06,
m.c3.x * b04 - m.c3.y * b02 + m.c3.w * b00,
m.c2.y * b02 - m.c2.x * b04 - m.c2.w * b00,
m.c1.y * b07 - m.c1.x * b09 - m.c1.z * b06,
m.c0.x * b09 - m.c0.y * b07 + m.c0.z * b06,
m.c3.y * b01 - m.c3.x * b03 - m.c3.z * b00,
m.c2.x * b03 - m.c2.y * b01 + m.c2.z * b00
);
}
public inline function toString() {
return 'mat4(' +
'${this.c0.x}, ${this.c0.y}, ${this.c0.z}, ${this.c0.w}, ' +
'${this.c1.x}, ${this.c1.y}, ${this.c1.z}, ${this.c1.w}, ' +
'${this.c2.x}, ${this.c2.y}, ${this.c2.z}, ${this.c2.w}, ' +
'${this.c3.x}, ${this.c3.y}, ${this.c3.z}, ${this.c3.w}' +
')';
}
@:op([])
inline function arrayRead(i: Int)
return switch i {
case 0: this.c0;
case 1: this.c1;
case 2: this.c2;
case 3: this.c3;
default: null;
}
@:op([])
inline function arrayWrite(i: Int, v: Vec4)
return switch i {
case 0: this.c0.copyFrom(v);
case 1: this.c1.copyFrom(v);
case 2: this.c2.copyFrom(v);
case 3: this.c3.copyFrom(v);
default: null;
}
@:op(-a)
static inline function neg(m: Mat4) {
var m: Mat4Data = m;
return new Mat4(
-m.c0.x, -m.c0.y, -m.c0.z, -m.c0.w,
-m.c1.x, -m.c1.y, -m.c1.z, -m.c1.w,
-m.c2.x, -m.c2.y, -m.c2.z, -m.c2.w,
-m.c3.x, -m.c3.y, -m.c3.z, -m.c3.w
);
}
@:op(++a)
static inline function prefixIncrement(m: Mat4) {
var _m: Mat4Data = m;
++_m.c0; ++_m.c1; ++_m.c2; ++_m.c3;
return m.clone();
}
@:op(--a)
static inline function prefixDecrement(m: Mat4) {
var _m: Mat4Data = m;
--_m.c0; --_m.c1; --_m.c2; --_m.c3;
return m.clone();
}
@:op(a++)
static inline function postfixIncrement(m: Mat4) {
var ret = m.clone();
var m: Mat4Data = m;
++m.c0; ++m.c1; ++m.c2; ++m.c3;
return ret;
}
@:op(a--)
static inline function postfixDecrement(m: Mat4) {
var ret = m.clone();
var m: Mat4Data = m;
--m.c0; --m.c1; --m.c2; --m.c3;
return ret;
}
// assignment overload should come before other binary ops to ensure they have priority
@:op(a *= b)
static inline function mulEq(a: Mat4, b: Mat4): Mat4
return a.copyFrom(a * b);
@:op(a *= b)
static inline function mulEqScalar(a: Mat4, f: Float): Mat4
return a.copyFrom(a * f);
@:op(a /= b)
static inline function divEq(a: Mat4, b: Mat4): Mat4
return a.copyFrom(a / b);
@:op(a /= b)
static inline function divEqScalar(a: Mat4, f: Float): Mat4
return a.copyFrom(a / f);
@:op(a += b)
static inline function addEq(a: Mat4, b: Mat4): Mat4
return a.copyFrom(a + b);
@:op(a += b)
static inline function addEqScalar(a: Mat4, f: Float): Mat4
return a.copyFrom(a + f);
@:op(a -= b)
static inline function subEq(a: Mat4, b: Mat4): Mat4
return a.copyFrom(a - b);
@:op(a -= b)
static inline function subEqScalar(a: Mat4, f: Float): Mat4
return a.copyFrom(a - f);
@:op(a + b)
static inline function add(m: Mat4, n: Mat4): Mat4 {
var m: Mat4Data = m;
var n: Mat4Data = n;
return new Mat4(
m.c0.x + n.c0.x, m.c0.y + n.c0.y, m.c0.z + n.c0.z, m.c0.w + n.c0.w,
m.c1.x + n.c1.x, m.c1.y + n.c1.y, m.c1.z + n.c1.z, m.c1.w + n.c1.w,
m.c2.x + n.c2.x, m.c2.y + n.c2.y, m.c2.z + n.c2.z, m.c2.w + n.c2.w,
m.c3.x + n.c3.x, m.c3.y + n.c3.y, m.c3.z + n.c3.z, m.c3.w + n.c3.w
);
}
@:op(a + b) @:commutative
static inline function addScalar(m: Mat4, f: Float): Mat4 {
var m: Mat4Data = m;
return new Mat4(
m.c0.x + f, m.c0.y + f, m.c0.z + f, m.c0.w + f,
m.c1.x + f, m.c1.y + f, m.c1.z + f, m.c1.w + f,
m.c2.x + f, m.c2.y + f, m.c2.z + f, m.c2.w + f,
m.c3.x + f, m.c3.y + f, m.c3.z + f, m.c3.w + f
);
}
@:op(a - b)
static inline function sub(m: Mat4, n: Mat4): Mat4 {
var m: Mat4Data = m;
var n: Mat4Data = n;
return new Mat4(
m.c0.x - n.c0.x, m.c0.y - n.c0.y, m.c0.z - n.c0.z, m.c0.w - n.c0.w,
m.c1.x - n.c1.x, m.c1.y - n.c1.y, m.c1.z - n.c1.z, m.c1.w - n.c1.w,
m.c2.x - n.c2.x, m.c2.y - n.c2.y, m.c2.z - n.c2.z, m.c2.w - n.c2.w,
m.c3.x - n.c3.x, m.c3.y - n.c3.y, m.c3.z - n.c3.z, m.c3.w - n.c3.w
);
}
@:op(a - b)
static inline function subScalar(m: Mat4, f: Float): Mat4 {
var m: Mat4Data = m;
return new Mat4(
m.c0.x - f, m.c0.y - f, m.c0.z - f, m.c0.w - f,
m.c1.x - f, m.c1.y - f, m.c1.z - f, m.c1.w - f,
m.c2.x - f, m.c2.y - f, m.c2.z - f, m.c2.w - f,
m.c3.x - f, m.c3.y - f, m.c3.z - f, m.c3.w - f
);
}
@:op(a - b)
static inline function subScalarInv(f: Float, m: Mat4): Mat4 {
var m: Mat4Data = m;
return new Mat4(
f - m.c0.x, f - m.c0.y, f - m.c0.z, f - m.c0.w,
f - m.c1.x, f - m.c1.y, f - m.c1.z, f - m.c1.w,
f - m.c2.x, f - m.c2.y, f - m.c2.z, f - m.c2.w,
f - m.c3.x, f - m.c3.y, f - m.c3.z, f - m.c3.w
);
}
@:op(a * b)
static inline function mul(m: Mat4, n: Mat4): Mat4 {
var m: Mat4Data = m;
var n: Mat4Data = n;
return new Mat4(
m.c0.x * n.c0.x + m.c1.x * n.c0.y + m.c2.x * n.c0.z + m.c3.x * n.c0.w,
m.c0.y * n.c0.x + m.c1.y * n.c0.y + m.c2.y * n.c0.z + m.c3.y * n.c0.w,
m.c0.z * n.c0.x + m.c1.z * n.c0.y + m.c2.z * n.c0.z + m.c3.z * n.c0.w,
m.c0.w * n.c0.x + m.c1.w * n.c0.y + m.c2.w * n.c0.z + m.c3.w * n.c0.w,
m.c0.x * n.c1.x + m.c1.x * n.c1.y + m.c2.x * n.c1.z + m.c3.x * n.c1.w,
m.c0.y * n.c1.x + m.c1.y * n.c1.y + m.c2.y * n.c1.z + m.c3.y * n.c1.w,
m.c0.z * n.c1.x + m.c1.z * n.c1.y + m.c2.z * n.c1.z + m.c3.z * n.c1.w,
m.c0.w * n.c1.x + m.c1.w * n.c1.y + m.c2.w * n.c1.z + m.c3.w * n.c1.w,
m.c0.x * n.c2.x + m.c1.x * n.c2.y + m.c2.x * n.c2.z + m.c3.x * n.c2.w,
m.c0.y * n.c2.x + m.c1.y * n.c2.y + m.c2.y * n.c2.z + m.c3.y * n.c2.w,
m.c0.z * n.c2.x + m.c1.z * n.c2.y + m.c2.z * n.c2.z + m.c3.z * n.c2.w,
m.c0.w * n.c2.x + m.c1.w * n.c2.y + m.c2.w * n.c2.z + m.c3.w * n.c2.w,
m.c0.x * n.c3.x + m.c1.x * n.c3.y + m.c2.x * n.c3.z + m.c3.x * n.c3.w,
m.c0.y * n.c3.x + m.c1.y * n.c3.y + m.c2.y * n.c3.z + m.c3.y * n.c3.w,
m.c0.z * n.c3.x + m.c1.z * n.c3.y + m.c2.z * n.c3.z + m.c3.z * n.c3.w,
m.c0.w * n.c3.x + m.c1.w * n.c3.y + m.c2.w * n.c3.z + m.c3.w * n.c3.w
);
}
@:op(a * b)
static inline function postMulVec4(m: Mat4, v: Vec4): Vec4 {
var m: Mat4Data = m;
return new Vec4(
m.c0.x * v.x + m.c1.x * v.y + m.c2.x * v.z + m.c3.x * v.w,
m.c0.y * v.x + m.c1.y * v.y + m.c2.y * v.z + m.c3.y * v.w,
m.c0.z * v.x + m.c1.z * v.y + m.c2.z * v.z + m.c3.z * v.w,
m.c0.w * v.x + m.c1.w * v.y + m.c2.w * v.z + m.c3.w * v.w
);
}
@:op(a * b)
static inline function preMulVec4(v: Vec4, m: Mat4): Vec4 {
var m: Mat4Data = m;
return new Vec4(
v.dot(m.c0),
v.dot(m.c1),
v.dot(m.c2),
v.dot(m.c3)
);
}
@:op(a * b) @:commutative
static inline function mulScalar(m: Mat4, f: Float): Mat4 {
var m: Mat4Data = m;
return new Mat4(
m.c0.x * f, m.c0.y * f, m.c0.z * f, m.c0.w * f,
m.c1.x * f, m.c1.y * f, m.c1.z * f, m.c1.w * f,
m.c2.x * f, m.c2.y * f, m.c2.z * f, m.c2.w * f,
m.c3.x * f, m.c3.y * f, m.c3.z * f, m.c3.w * f
);
}
@:op(a / b)
static inline function div(m: Mat4, n: Mat4): Mat4
return m.matrixCompMult(1.0 / n);
@:op(a / b)
static inline function divScalar(m: Mat4, f: Float): Mat4 {
var m: Mat4Data = m;
return new Mat4(
m.c0.x / f, m.c0.y / f, m.c0.z / f, m.c0.w / f,
m.c1.x / f, m.c1.y / f, m.c1.z / f, m.c1.w / f,
m.c2.x / f, m.c2.y / f, m.c2.z / f, m.c2.w / f,
m.c3.x / f, m.c3.y / f, m.c3.z / f, m.c3.w / f
);
}
@:op(a / b)
static inline function divScalarInv(f: Float, m: Mat4): Mat4 {
var m: Mat4Data = m;
return new Mat4(
f / m.c0.x, f / m.c0.y, f / m.c0.z, f / m.c0.w,
f / m.c1.x, f / m.c1.y, f / m.c1.z, f / m.c1.w,
f / m.c2.x, f / m.c2.y, f / m.c2.z, f / m.c2.w,
f / m.c3.x, f / m.c3.y, f / m.c3.z, f / m.c3.w
);
}
@:op(a == b)
static inline function equal(m: Mat4, n: Mat4): Bool {
var m: Mat4Data = m;
var n: Mat4Data = n;
return
m.c0 == n.c0 &&
m.c1 == n.c1 &&
m.c2 == n.c2 &&
m.c3 == n.c3;
}
@:op(a != b)
static inline function notEqual(m: Mat4, n: Mat4): Bool
return !equal(m, n);
#end // !macro
/**
Copies matrix elements in column-major order into a type that supports array-write access
**/
@:overload(function<T>(arrayLike: T, index: Int): T {})
public macro function copyIntoArray(self: haxe.macro.Expr.ExprOf<Mat4>, array: haxe.macro.Expr.ExprOf<ArrayAccess<Float>>, index: haxe.macro.Expr.ExprOf<Int>) {
return macro {
var self = $self;
var array = $array;
var i: Int = $index;
self[0].copyIntoArray(array, i);
self[1].copyIntoArray(array, i + 4);
self[2].copyIntoArray(array, i + 8);
self[3].copyIntoArray(array, i + 12);
array;
}
}
/**
Copies matrix elements in column-major order from a type that supports array-read access
**/
@:overload(function<T>(arrayLike: T, index: Int): Mat4 {})
public macro function copyFromArray(self: haxe.macro.Expr.ExprOf<Mat4>, array: haxe.macro.Expr.ExprOf<ArrayAccess<Float>>, index: haxe.macro.Expr.ExprOf<Int>) {
return macro {
var self = $self;
var array = $array;
var i: Int = $index;
self[0].copyFromArray(array, i);
self[1].copyFromArray(array, i + 4);
self[2].copyFromArray(array, i + 8);
self[3].copyFromArray(array, i + 12);
self;
}
}
// static macros
@:overload(function<T>(arrayLike: T, index: Int): T {})
public static macro function fromArray(array: ExprOf<ArrayAccess<Float>>, index: ExprOf<Int>): ExprOf<Mat4> {
return macro {
var array = $array;
var i: Int = $index;
new Mat4(
array[0 + i], array[1 + i], array[2 + i], array[3 + i],
array[4 + i], array[5 + i], array[6 + i], array[7 + i],
array[8 + i], array[9 + i], array[10 + i], array[11 + i],
array[12 + i], array[13 + i], array[14 + i], array[15 + i]
);
}
}
}
@:noCompletion
class Mat4Data {
#if !macro
public var c0: Vec4;
public var c1: Vec4;
public var c2: Vec4;
public var c3: Vec4;
public inline function new(
a00: Float, a01: Float, a02: Float, a03: Float,
a10: Float, a11: Float, a12: Float, a13: Float,
a20: Float, a21: Float, a22: Float, a23: Float,
a30: Float, a31: Float, a32: Float, a33: Float
) {
c0 = new Vec4(a00, a01, a02, a03);
c1 = new Vec4(a10, a11, a12, a13);
c2 = new Vec4(a20, a21, a22, a23);
c3 = new Vec4(a30, a31, a32, a33);
}
#end
}