Skip to content

Commit 47f1525

Browse files
committed
infix Mat4* translate/scale
1 parent 451959d commit 47f1525

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

src/main/kotlin/glm_/mat4x4/Mat4.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,11 @@ data class Mat4(override var value: MutableList<Vec4>) : Mat4x4t<Vec4>(value) {
431431

432432

433433
// TODO others
434-
@JvmOverloads
435-
fun scale(scale: Vec3, res: Mat4 = Mat4()) = scale(scale.x, scale.y, scale.z, res)
434+
infix fun scale(scale: Vec3) = scale(scale.x, scale.y, scale.z, Mat4())
435+
fun scale(scale: Vec3, res: Mat4) = scale(scale.x, scale.y, scale.z, res)
436436

437-
@JvmOverloads
438-
fun scale(scale: Float, res: Mat4 = Mat4()) = scale(scale, scale, scale, res)
437+
infix fun scale(scale: Float) = scale(scale, scale, scale, Mat4())
438+
fun scale(scale: Float, res: Mat4) = scale(scale, scale, scale, res)
439439

440440
@JvmOverloads
441441
fun scale(scaleX: Float, scaleY: Float, scaleZ: Float, res: Mat4 = Mat4()) = glm.scale(res, this, scaleX, scaleY, scaleZ)
@@ -445,11 +445,11 @@ data class Mat4(override var value: MutableList<Vec4>) : Mat4x4t<Vec4>(value) {
445445
fun scaleAssign(scaleX: Float, scaleY: Float, scaleZ: Float) = glm.scale(this, this, scaleX, scaleY, scaleZ)
446446

447447

448-
@JvmOverloads
449-
fun translate(translate: Vec3, res: Mat4 = Mat4()) = translate(translate.x, translate.y, translate.z, res)
448+
infix fun translate(translate: Vec3) = translate(translate.x, translate.y, translate.z, Mat4())
449+
fun translate(translate: Vec3, res: Mat4) = translate(translate.x, translate.y, translate.z, res)
450450

451-
@JvmOverloads
452-
fun translate(translate: Float, res: Mat4 = Mat4()) = translate(translate, translate, translate, res)
451+
infix fun translate(translate: Float) = translate(translate, translate, translate, Mat4())
452+
fun translate(translate: Float, res: Mat4) = translate(translate, translate, translate, res)
453453

454454
@JvmOverloads
455455
fun translate(translateX: Float, translateY: Float, translateZ: Float, res: Mat4 = Mat4()) =

src/main/kotlin/glm_/mat4x4/Mat4d.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,11 @@ data class Mat4d(override var value: MutableList<Vec4d>) : Mat4x4t<Vec4d>(value)
419419

420420

421421
// TODO others
422-
@JvmOverloads
423-
fun scale(scale: Vec3d, res: Mat4d = Mat4d()) = scale(scale.x, scale.y, scale.z, res)
422+
infix fun scale(scale: Vec3d) = scale(scale.x, scale.y, scale.z, Mat4d())
423+
fun scale(scale: Vec3d, res: Mat4d) = scale(scale.x, scale.y, scale.z, res)
424424

425-
@JvmOverloads
426-
fun scale(scale: Double, res: Mat4d = Mat4d()) = scale(scale, scale, scale, res)
425+
infix fun scale(scale: Double) = scale(scale, scale, scale, Mat4d())
426+
fun scale(scale: Double, res: Mat4d) = scale(scale, scale, scale, res)
427427

428428
@JvmOverloads
429429
fun scale(scaleX: Double, scaleY: Double, scaleZ: Double, res: Mat4d = Mat4d()) = glm.scale(res, this, scaleX, scaleY, scaleZ)
@@ -433,11 +433,11 @@ data class Mat4d(override var value: MutableList<Vec4d>) : Mat4x4t<Vec4d>(value)
433433
fun scaleAssign(scaleX: Double, scaleY: Double, scaleZ: Double) = glm.scale(this, this, scaleX, scaleY, scaleZ)
434434

435435

436-
@JvmOverloads
437-
fun translate(translate: Vec3d, res: Mat4d = Mat4d()) = translate(translate.x, translate.y, translate.z, res)
436+
infix fun translate(translate: Vec3d) = translate(translate.x, translate.y, translate.z, Mat4d())
437+
fun translate(translate: Vec3d, res: Mat4d) = translate(translate.x, translate.y, translate.z, res)
438438

439-
@JvmOverloads
440-
fun translate(translate: Double, res: Mat4d = Mat4d()) = translate(translate, translate, translate, res)
439+
infix fun translate(translate: Double) = translate(translate, translate, translate, Mat4d())
440+
fun translate(translate: Double, res: Mat4d) = translate(translate, translate, translate, res)
441441

442442
@JvmOverloads
443443
fun translate(translateX: Double, translateY: Double, translateZ: Double, res: Mat4d = Mat4d()) =

src/test/kotlin/glm_/gtx/testGtxIntersect.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,5 @@ class testGtxIntersect : StringSpec() {
9191
}
9292
}
9393
}
94+
9495
}

0 commit comments

Comments
 (0)