@@ -41,11 +41,24 @@ class Mat4 private constructor(@Suppress("UNUSED_PARAMETER") dummy: Int, var arr
41
41
42
42
// -- Constructors --
43
43
44
+ /* *
45
+ * Creates a identity matrix
46
+ */
44
47
constructor () : this (1 )
45
48
49
+ /* *
50
+ * Creates a matrix with the diagonal set to [s]
51
+ */
46
52
constructor (s: Number ) : this (s, s, s, s)
47
53
54
+ /* *
55
+ * Creates a matrix with the diagonal set to [x], [y], [z] and 1.0
56
+ */
48
57
constructor (x: Number , y: Number , z: Number ) : this (x, y, z, 1f ) // TODO others
58
+
59
+ /* *
60
+ * Creates a matrix with the diagonal set to [x], [y], [z] and [w]:
61
+ */
49
62
constructor (x: Number , y: Number , z: Number , w: Number ) : this (
50
63
x, 0 , 0 , 0 ,
51
64
0 , y, 0 , 0 ,
@@ -54,16 +67,48 @@ class Mat4 private constructor(@Suppress("UNUSED_PARAMETER") dummy: Int, var arr
54
67
55
68
// TODO others
56
69
70
+ /* *
71
+ * Creates a matrix with the diagonal set to [v].x, [v].y, 0 and 1:
72
+ */
57
73
constructor (v: Vec2t <* >) : this (v.x, v.y, 0 , 1 )
74
+
75
+ /* *
76
+ * Creates a matrix with the diagonal set to [v].x, [v].y, z and 1
77
+ */
58
78
constructor (v: Vec2t <* >, z: Number ) : this (v.x, v.y, z, 1 )
79
+
80
+ /* *
81
+ * Creates a matrix with the diagonal set to [v].x, [v].y, z and w
82
+ */
59
83
constructor (v: Vec2t <* >, z: Number , w: Number ) : this (v.x, v.y, z, w)
84
+
85
+ /* *
86
+ * Creates a matrix with the diagonal set to [v].x, [v].y, [v].z and 1
87
+ */
60
88
constructor (v: Vec3t <* >) : this (v.x, v.y, v.z, 1 )
89
+
90
+ /* *
91
+ * Creates a matrix with the diagonal set to [v].x, [v].y, [v].z and w
92
+ */
61
93
constructor (v: Vec3t <* >, w: Number ) : this (v.x, v.y, v.z, w)
94
+
95
+ /* *
96
+ * Creates a matrix with the diagonal set to [v].x, [v].y, [v].z and [v].w
97
+ */
98
+ constructor (v: Vec4t <* >) : this (v.x, v.y, v.z, v.w)
99
+
100
+ /* *
101
+ * Creates a matrix with the
102
+ * first column of [a] and [aW],
103
+ * the second [b] and [bW],
104
+ * the third [c] and [cW] and
105
+ * the last [d] and [dW]
106
+ */
62
107
constructor (a: Vec3t <* >, aW: Number , b: Vec3t <* >, bW: Number , c: Vec3t <* >, cW: Number , d: Vec3t <* >, dW: Number ) : this (
63
108
a.x, a.y, a.z, aW, b.x, b.y, b.z, bW, c.x, c.y, c.z, cW, d.x, d.y, d.z, dW)
64
109
65
- constructor (v: Vec4t <* >) : this (v.x, v.y, v.z, v.w)
66
110
111
+ // TODO(wasabi): check, either the variable names a chosen badly or the order passed to the array is wrong
67
112
constructor (x0: Number , y0: Number , z0: Number , w0: Number ,
68
113
x1: Number , y1: Number , z1: Number , w1: Number ,
69
114
x2: Number , y2: Number , z2: Number , w2: Number ,
0 commit comments