diff --git a/src/com/reco1l/framework/math/Vec2.kt b/src/com/reco1l/framework/math/Vec2.kt index fe303f071..283e30167 100644 --- a/src/com/reco1l/framework/math/Vec2.kt +++ b/src/com/reco1l/framework/math/Vec2.kt @@ -2,12 +2,15 @@ package com.reco1l.framework.math data class Vec2( - val x: Float = 0f, + val x: Float, - val y: Float = 0f, + val y: Float, ) { + constructor(value: Float = 0f) : this(value, value) + + val total get() = x + y diff --git a/src/com/reco1l/framework/math/Vec4.kt b/src/com/reco1l/framework/math/Vec4.kt index 675c25b49..a4b11dade 100644 --- a/src/com/reco1l/framework/math/Vec4.kt +++ b/src/com/reco1l/framework/math/Vec4.kt @@ -2,13 +2,18 @@ package com.reco1l.framework.math data class Vec4( - val x: Float = 0f, - val y: Float = 0f, - val z: Float = 0f, - val w: Float = 0f, + val x: Float, + val y: Float, + val z: Float, + val w: Float, ) { + constructor(value: Float = 0f) : this(value, value, value, value) + + constructor(xz: Float, yw: Float) : this(xz, yw, xz, yw) + + val left: Float get() = x