summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-01-05 14:49:27 -0500
committerDavid Thompson <dthompson2@worcester.edu>2018-01-05 14:49:27 -0500
commit9daf9fc933a22359bb546e51029282ae215256f3 (patch)
treed28ecf73baf67a8fff2b2d6d8326cffceeb8e006
parenteadc906194000b4c06570450d4ab7dd27efc2a10 (diff)
math: matrix: Allow translation by rect as if it were a vector.
* chickadee/math/matrix.scm (matrix4-translate!): Add rect support.
-rw-r--r--chickadee/math/matrix.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/chickadee/math/matrix.scm b/chickadee/math/matrix.scm
index b257069..af206f4 100644
--- a/chickadee/math/matrix.scm
+++ b/chickadee/math/matrix.scm
@@ -25,6 +25,7 @@
#:use-module (system foreign)
#:use-module (chickadee math)
#:use-module (chickadee math quaternion)
+ #:use-module (chickadee math rect)
#:use-module (chickadee math vector)
#:export (make-matrix4
make-null-matrix4
@@ -304,6 +305,12 @@ clipping plane NEAR and FAR."
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
(vec2-x v) (vec2-y v) 0.0 1.0))
+ ((rect? v)
+ (init-matrix4 matrix
+ 1.0 0.0 0.0 0.0
+ 0.0 1.0 0.0 0.0
+ 0.0 0.0 1.0 0.0
+ (rect-x v) (rect-y v) 0.0 1.0))
((vec3? v)
(init-matrix4 matrix
1.0 0.0 0.0 0.0