@@ -12,165 +12,165 @@ import glm_.vec2.Vec2l.Companion.times
12
12
/* *
13
13
* Created by GBarbieri on 08.11.2016.
14
14
*/
15
- interface vec2l_operators {
15
+ open class opVec2l {
16
16
17
- fun plus (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
17
+ inline fun plus (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
18
18
res.x = a.x + bX
19
19
res.y = a.y + bY
20
20
return res
21
21
}
22
22
23
- fun plus (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
23
+ inline fun plus (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
24
24
res.x = a.x + bX
25
25
res.y = a.y + bY
26
26
return res
27
27
}
28
28
29
- fun minus (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
29
+ inline fun minus (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
30
30
res.x = a.x - bX
31
31
res.y = a.y - bY
32
32
return res
33
33
}
34
34
35
- fun minus (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
35
+ inline fun minus (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
36
36
res.x = a.x - bX
37
37
res.y = a.y - bY
38
38
return res
39
39
}
40
40
41
- fun minus (res : Vec2l , aX : Int , aY : Int , b : Vec2l ): Vec2l {
41
+ inline fun minus (res : Vec2l , aX : Int , aY : Int , b : Vec2l ): Vec2l {
42
42
res.x = aX - b.x
43
43
res.y = aY - b.y
44
44
return res
45
45
}
46
46
47
- fun minus (res : Vec2l , aX : Long , aY : Long , b : Vec2l ): Vec2l {
47
+ inline fun minus (res : Vec2l , aX : Long , aY : Long , b : Vec2l ): Vec2l {
48
48
res.x = aX - b.x
49
49
res.y = aY - b.y
50
50
return res
51
51
}
52
52
53
- fun times (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
53
+ inline fun times (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
54
54
res.x = a.x * bX
55
55
res.y = a.y * bY
56
56
return res
57
57
}
58
58
59
- fun times (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
59
+ inline fun times (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
60
60
res.x = a.x * bX
61
61
res.y = a.y * bY
62
62
return res
63
63
}
64
64
65
- fun div (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
65
+ inline fun div (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
66
66
res.x = a.x / bX
67
67
res.y = a.y / bY
68
68
return res
69
69
}
70
70
71
- fun div (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
71
+ inline fun div (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
72
72
res.x = a.x / bX
73
73
res.y = a.y / bY
74
74
return res
75
75
}
76
76
77
- fun div (res : Vec2l , aX : Int , aY : Int , b : Vec2l ): Vec2l {
77
+ inline fun div (res : Vec2l , aX : Int , aY : Int , b : Vec2l ): Vec2l {
78
78
res.x = aX / b.x
79
79
res.y = aY / b.y
80
80
return res
81
81
}
82
82
83
- fun div (res : Vec2l , aX : Long , aY : Long , b : Vec2l ): Vec2l {
83
+ inline fun div (res : Vec2l , aX : Long , aY : Long , b : Vec2l ): Vec2l {
84
84
res.x = aX / b.x
85
85
res.y = aY / b.y
86
86
return res
87
87
}
88
88
89
- fun rem (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
89
+ inline fun rem (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
90
90
res.x = a.x % bX
91
91
res.y = a.y % bY
92
92
return res
93
93
}
94
94
95
- fun rem (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
95
+ inline fun rem (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
96
96
res.x = a.x % bX
97
97
res.y = a.y % bY
98
98
return res
99
99
}
100
100
101
- fun rem (res : Vec2l , aX : Int , aY : Int , b : Vec2l ): Vec2l {
101
+ inline fun rem (res : Vec2l , aX : Int , aY : Int , b : Vec2l ): Vec2l {
102
102
res.x = aX % b.x
103
103
res.y = aY % b.y
104
104
return res
105
105
}
106
106
107
- fun rem (res : Vec2l , aX : Long , aY : Long , b : Vec2l ): Vec2l {
107
+ inline fun rem (res : Vec2l , aX : Long , aY : Long , b : Vec2l ): Vec2l {
108
108
res.x = aX % b.x
109
109
res.y = aY % b.y
110
110
return res
111
111
}
112
112
113
- fun and (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
113
+ inline fun and (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
114
114
res.x = a.x and bX
115
115
res.y = a.y and bY
116
116
return res
117
117
}
118
118
119
- fun and (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
119
+ inline fun and (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
120
120
res.x = a.x and bX
121
121
res.y = a.y and bY
122
122
return res
123
123
}
124
124
125
- fun or (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
125
+ inline fun or (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
126
126
res.x = a.x or bX
127
127
res.y = a.y or bY
128
128
return res
129
129
}
130
130
131
- fun or (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
131
+ inline fun or (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
132
132
res.x = a.x or bX
133
133
res.y = a.y or bY
134
134
return res
135
135
}
136
136
137
- fun xor (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
137
+ inline fun xor (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
138
138
res.x = a.x xor bX
139
139
res.y = a.y xor bY
140
140
return res
141
141
}
142
142
143
- fun xor (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
143
+ inline fun xor (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
144
144
res.x = a.x xor bX
145
145
res.y = a.y xor bY
146
146
return res
147
147
}
148
148
149
- fun shl (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
149
+ inline fun shl (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
150
150
res.x = a.x shl bX.i
151
151
res.y = a.y shl bY.i
152
152
return res
153
153
}
154
154
155
- fun shl (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
155
+ inline fun shl (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
156
156
res.x = a.x shl bX
157
157
res.y = a.y shl bY
158
158
return res
159
159
}
160
160
161
- fun shr (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
161
+ inline fun shr (res : Vec2l , a : Vec2l , bX : Long , bY : Long ): Vec2l {
162
162
res.x = a.x shr bX.i
163
163
res.y = a.y shr bY.i
164
164
return res
165
165
}
166
166
167
- fun shr (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
167
+ inline fun shr (res : Vec2l , a : Vec2l , bX : Int , bY : Int ): Vec2l {
168
168
res.x = a.x shr bX
169
169
res.y = a.y shr bY
170
170
return res
171
171
}
172
172
173
- fun inv (res : Vec2l , a : Vec2l ): Vec2l {
173
+ inline fun inv (res : Vec2l , a : Vec2l ): Vec2l {
174
174
res.x = a.x.inv ()
175
175
res.y = a.y.inv ()
176
176
return res
@@ -182,64 +182,64 @@ interface vec2l_operators {
182
182
183
183
infix operator fun Long.plus (b : Vec2l ) = plus(Vec2l (), b, this , this )
184
184
fun Long.plus (b : Vec2l , res : Vec2l ) = plus(res, b, this , this )
185
- infix fun Long.plus_ (b : Vec2l ) = plus(b, b, this , this )
185
+ infix fun Long.plusAssign (b : Vec2l ) = plus(b, b, this , this )
186
186
187
187
infix operator fun Long.minus (b : Vec2l ) = minus(Vec2l (), this , this , b)
188
188
fun Long.minus (b : Vec2l , res : Vec2l ) = minus(res, b, this , this )
189
- infix fun Long.minus_ (b : Vec2l ) = minus(b, this , this , b)
189
+ infix fun Long.minusAssign (b : Vec2l ) = minus(b, this , this , b)
190
190
191
191
infix operator fun Long.times (b : Vec2l ) = times(Vec2l (), b, this , this )
192
192
fun Long.times (b : Vec2l , res : Vec2l ) = times(res, b, this , this )
193
- infix fun Long.times_ (b : Vec2l ) = times(b, b, this , this )
193
+ infix fun Long.timesAssign (b : Vec2l ) = times(b, b, this , this )
194
194
195
195
infix operator fun Long.div (b : Vec2l ) = div(Vec2l (), this , this , b)
196
196
fun Long.div (b : Vec2l , res : Vec2l ) = div(res, b, this , this )
197
- infix fun Long.div_ (b : Vec2l ) = div(b, this , this , b)
197
+ infix fun Long.divAssign (b : Vec2l ) = div(b, this , this , b)
198
198
199
199
infix operator fun Long.rem (b : Vec2l ) = rem(Vec2l (), this , this , b)
200
200
fun Long.rem (b : Vec2l , res : Vec2l ) = rem(res, b, this , this )
201
- infix fun Long.rem_ (b : Vec2l ) = rem(b, this , this , b)
201
+ infix fun Long.remAssign (b : Vec2l ) = rem(b, this , this , b)
202
202
203
203
204
204
infix operator fun Int.plus (b : Vec2l ) = plus(Vec2l (), b, this , this )
205
205
fun Int.plus (b : Vec2l , res : Vec2l ) = plus(res, b, this , this )
206
- infix fun Int.plus_ (b : Vec2l ) = plus(b, b, this , this )
206
+ infix fun Int.plusAssign (b : Vec2l ) = plus(b, b, this , this )
207
207
208
208
infix operator fun Int.minus (b : Vec2l ) = minus(Vec2l (), this , this , b)
209
209
fun Int.minus (b : Vec2l , res : Vec2l ) = minus(res, b, this , this )
210
- infix fun Int.minus_ (b : Vec2l ) = minus(b, this , this , b)
210
+ infix fun Int.minusAssign (b : Vec2l ) = minus(b, this , this , b)
211
211
212
212
infix operator fun Int.times (b : Vec2l ) = times(Vec2l (), b, this , this )
213
213
fun Int.times (b : Vec2l , res : Vec2l ) = times(res, b, this , this )
214
- infix fun Int.times_ (b : Vec2l ) = times(b, b, this , this )
214
+ infix fun Int.timesAssign (b : Vec2l ) = times(b, b, this , this )
215
215
216
216
infix operator fun Int.div (b : Vec2l ) = div(Vec2l (), this , this , b)
217
217
fun Int.div (b : Vec2l , res : Vec2l ) = div(res, b, this , this )
218
- infix fun Int.div_ (b : Vec2l ) = div(b, this , this , b)
218
+ infix fun Int.divAssign (b : Vec2l ) = div(b, this , this , b)
219
219
220
220
infix operator fun Int.rem (b : Vec2l ) = rem(Vec2l (), this , this , b)
221
221
fun Int.rem (b : Vec2l , res : Vec2l ) = rem(res, b, this , this )
222
- infix fun Int.rem_ (b : Vec2l ) = rem(b, this , this , b)
222
+ infix fun Int.remAssign (b : Vec2l ) = rem(b, this , this , b)
223
223
224
224
225
225
// -- Generic binary arithmetic operators --
226
226
227
227
infix operator fun Number.plus (b : Vec2l ) = plus(Vec2l (), b, this .L , this .L )
228
228
fun Number.plus (b : Vec2l , res : Vec2l ) = plus(res, b, this .L , this .L )
229
- infix fun Number.plus_ (b : Vec2l ) = plus(b, b, this .L , this .L )
229
+ infix fun Number.plusAssign (b : Vec2l ) = plus(b, b, this .L , this .L )
230
230
231
231
infix operator fun Number.minus (b : Vec2l ) = minus(Vec2l (), this .L , this .L , b)
232
232
fun Number.minus (b : Vec2l , res : Vec2l ) = minus(res, b, this .L , this .L )
233
- infix fun Number.minus_ (b : Vec2l ) = minus(b, this .L , this .L , b)
233
+ infix fun Number.minusAssign (b : Vec2l ) = minus(b, this .L , this .L , b)
234
234
235
235
infix operator fun Number.times (b : Vec2l ) = times(Vec2l (), b, this .L , this .L )
236
236
fun Number.times (b : Vec2l , res : Vec2l ) = times(res, b, this .L , this .L )
237
- infix fun Number.times_ (b : Vec2l ) = times(b, b, this .L , this .L )
237
+ infix fun Number.timesAssign (b : Vec2l ) = times(b, b, this .L , this .L )
238
238
239
239
infix operator fun Number.div (b : Vec2l ) = div(Vec2l (), this .L , this .L , b)
240
240
fun Number.div (b : Vec2l , res : Vec2l ) = div(res, b, this .L , this .L )
241
- infix fun Number.div_ (b : Vec2l ) = div(b, this .L , this .L , b)
241
+ infix fun Number.divAssign (b : Vec2l ) = div(b, this .L , this .L , b)
242
242
243
243
infix operator fun Number.rem (b : Vec2l ) = rem(Vec2l (), this .L , this .L , b)
244
244
fun Number.rem (b : Vec2l , res : Vec2l ) = rem(res, b, this .L , this .L )
245
- infix fun Number.rem_ (b : Vec2l ) = rem(b, this .L , this .L , b)
245
+ infix fun Number.remAssign (b : Vec2l ) = rem(b, this .L , this .L , b)
0 commit comments