Skip to content

Commit d6e2e9f

Browse files
committed
Extended matrices
1 parent e326092 commit d6e2e9f

File tree

1 file changed

+10
-0
lines changed
  • common/src/main/kotlin/com/lambda/graphics/gl

1 file changed

+10
-0
lines changed

common/src/main/kotlin/com/lambda/graphics/gl/Matrices.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ object Matrices {
1515
stack.last().translate(x, y, z)
1616
}
1717

18+
fun scale(x: Double, y: Double, z: Double) {
19+
stack.last().scale(x.toFloat(), y.toFloat(), z.toFloat())
20+
}
21+
1822
fun scale(x: Float, y: Float, z: Float) {
1923
stack.last().scale(x, y, z)
2024
}
@@ -32,6 +36,12 @@ object Matrices {
3236
stack.addLast(Matrix4f(entry))
3337
}
3438

39+
fun push(block: Matrices.() -> Unit) {
40+
push()
41+
this.block()
42+
pop()
43+
}
44+
3545
fun pop() {
3646
stack.removeLast()
3747
}

0 commit comments

Comments
 (0)