summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/math/matrix.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/chickadee/math/matrix.scm b/chickadee/math/matrix.scm
index 4616643..0f1e523 100644
--- a/chickadee/math/matrix.scm
+++ b/chickadee/math/matrix.scm
@@ -66,7 +66,10 @@
matrix4-2d-transform!
matrix4-transform-x
matrix4-transform-y
- matrix4-transform!))
+ matrix4-transform!
+ matrix4-x
+ matrix4-y
+ matrix4-z))
;;;
@@ -707,3 +710,12 @@ happens with respect to ORIGIN, a 2D vector."
(y (vec2-y v)))
(set-vec2-x! v (matrix4-transform-x matrix x y))
(set-vec2-y! v (matrix4-transform-y matrix x y))))
+
+(define-inlinable (matrix4-x matrix)
+ (matrix4-ref (matrix4-bv matrix) 3 0))
+
+(define-inlinable (matrix4-y matrix)
+ (matrix4-ref (matrix4-bv matrix) 3 1))
+
+(define-inlinable (matrix4-z matrix)
+ (matrix4-ref (matrix4-bv matrix) 3 2))