Skip to content

Commit 9f5a694

Browse files
committed
working on #4
1 parent b12f181 commit 9f5a694

File tree

5 files changed

+26
-29
lines changed

5 files changed

+26
-29
lines changed

src/main/kotlin/glm_/vec1/Vec1t.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ abstract class Vec1t<T : Number>(_x: T) {
205205
// infix fun isEqual(b: Vec2t<out Number>) = glm.isEqual(this, b)
206206

207207

208-
companion object {
209-
const val length = 1
210-
}
211-
212-
213208
// component alias
214209

215210
var r
@@ -224,4 +219,10 @@ abstract class Vec1t<T : Number>(_x: T) {
224219
@JvmName("s") set(value) {
225220
x = value
226221
}
222+
223+
companion object {
224+
const val length = 1
225+
}
226+
227+
override fun toString() : String = "Vect1 [$x]"
227228
}

src/main/kotlin/glm_/vec2/Vec2.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,4 +490,5 @@ class Vec2(var ofs: Int, var array: FloatArray) : Vec2t<Float>() {
490490

491491
override fun equals(other: Any?) = other is Vec2 && this[0] == other[0] && this[1] == other[1]
492492
override fun hashCode() = 31 * x.hashCode() + y.hashCode()
493+
override fun toString() : String = "Vect2 [$x, $y]"
493494
}

src/main/kotlin/glm_/vec2/Vec2t.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,6 @@ abstract class Vec2t<T : Number> {
228228

229229
infix fun isEqual(b: Vec2t<out Number>) = glm.isEqual(this, b)
230230

231-
232-
companion object {
233-
const val length = 2
234-
}
235-
236-
237-
override fun toString() = "($x, $y)"
238-
239231
// component alias
240232

241233
var r
@@ -293,4 +285,10 @@ abstract class Vec2t<T : Number> {
293285
@JvmName("ts") get() = createInstance(t, s)
294286
@JvmName("ts") set(value) = put(value.t, value.s)
295287
val tt @JvmName("tt") get() = createInstance(t, t)
288+
289+
companion object {
290+
const val length = 2
291+
}
292+
293+
override fun toString(): String = "Vect2 [$x, $y]"
296294
}

src/main/kotlin/glm_/vec3/Vec3t.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ abstract class Vec3t<T : Number> {
229229

230230
infix fun isEqual(b: Vec3t<out Number>) = glm.isEqual(this, b)
231231

232-
233-
companion object {
234-
const val length = 3
235-
}
236-
237-
238-
override fun toString() = "($x, $y, $z)"
239-
240232
// components alias
241233
var r
242234
@JvmName("r") get() = x
@@ -357,4 +349,11 @@ abstract class Vec3t<T : Number> {
357349
val zzx @JvmName("zzx") get() = createInstance(z, z, x)
358350
val zzy @JvmName("zzy") get() = createInstance(z, z, y)
359351
val zzz @JvmName("zzz") get() = createInstance(z, z, z)
352+
353+
354+
companion object {
355+
const val length = 3
356+
}
357+
358+
override fun toString() : String = "Vect3 [$x, $y, $z]"
360359
}

src/main/kotlin/glm_/vec4/Vec4t.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,6 @@ abstract class Vec4t<T : Number> {
245245

246246
infix fun isEqual(b: Vec4t<out Number>) = glm.isEqual(this, b)
247247

248-
249-
companion object {
250-
const val length = 4
251-
}
252-
253-
254-
override fun toString() = "($x, $y, $z, $w)"
255-
256248
// components alias
257249

258250
var r
@@ -688,4 +680,10 @@ abstract class Vec4t<T : Number> {
688680
val wwwy @JvmName("wwwy") get() = createInstance(w, w, w, y)
689681
val wwwz @JvmName("wwwz") get() = createInstance(w, w, w, z)
690682
val wwww @JvmName("wwww") get() = createInstance(w, w, w, w)
683+
684+
companion object {
685+
const val length = 4
686+
}
687+
688+
override fun toString() : String = "Vect4 [$x, $y, $z, $w]"
691689
}

0 commit comments

Comments
 (0)