diff options
-rw-r--r-- | chickadee/graphics/sprite.scm | 16 | ||||
-rw-r--r-- | chickadee/math/matrix.scm | 16 | ||||
-rw-r--r-- | doc/api.texi | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/chickadee/graphics/sprite.scm b/chickadee/graphics/sprite.scm index 4f0d809..2f7c53d 100644 --- a/chickadee/graphics/sprite.scm +++ b/chickadee/graphics/sprite.scm @@ -225,14 +225,14 @@ texture may be specified via the TEXTURE-REGION argument." (miny (rect-y rect)) (maxx (+ minx (rect-width rect))) (maxy (+ miny (rect-height rect))) - (x1 (transform-x matrix minx miny)) - (y1 (transform-y matrix minx miny)) - (x2 (transform-x matrix maxx miny)) - (y2 (transform-y matrix maxx miny)) - (x3 (transform-x matrix maxx maxy)) - (y3 (transform-y matrix maxx maxy)) - (x4 (transform-x matrix minx maxy)) - (y4 (transform-y matrix minx maxy)) + (x1 (matrix4-transform-x matrix minx miny)) + (y1 (matrix4-transform-y matrix minx miny)) + (x2 (matrix4-transform-x matrix maxx miny)) + (y2 (matrix4-transform-y matrix maxx miny)) + (x3 (matrix4-transform-x matrix maxx maxy)) + (y3 (matrix4-transform-y matrix maxx maxy)) + (x4 (matrix4-transform-x matrix minx maxy)) + (y4 (matrix4-transform-y matrix minx maxy)) (texcoords (texture-gl-tex-rect (or texture-region (sprite-batch-texture batch)))) diff --git a/chickadee/math/matrix.scm b/chickadee/math/matrix.scm index 17c5f49..4616643 100644 --- a/chickadee/math/matrix.scm +++ b/chickadee/math/matrix.scm @@ -64,9 +64,9 @@ matrix4-rotate-z! matrix4-rotate-z matrix4-2d-transform! - transform-x - transform-y - transform!)) + matrix4-transform-x + matrix4-transform-y + matrix4-transform!)) ;;; @@ -690,20 +690,20 @@ happens with respect to ORIGIN, a 2D vector." (f32vector-set! bv 12 (- x (* ox q) (* oy s))) (f32vector-set! bv 13 (- y (* ox r) (* oy t))))))) -(define-inlinable (transform-x matrix x y) +(define-inlinable (matrix4-transform-x matrix x y) (let ((bv (matrix4-bv matrix))) (+ (* x (matrix4-ref bv 0 0)) (* y (matrix4-ref bv 1 0)) (matrix4-ref bv 3 0)))) -(define-inlinable (transform-y matrix x y) +(define-inlinable (matrix4-transform-y matrix x y) (let ((bv (matrix4-bv matrix))) (+ (* x (matrix4-ref bv 0 1)) (* y (matrix4-ref bv 1 1)) (matrix4-ref bv 3 1)))) -(define-inlinable (transform! matrix v) +(define-inlinable (matrix4-transform! matrix v) (let ((x (vec2-x v)) (y (vec2-y v))) - (set-vec2-x! v (transform-x matrix x y)) - (set-vec2-y! v (transform-y matrix x y)))) + (set-vec2-x! v (matrix4-transform-x matrix x y)) + (set-vec2-y! v (matrix4-transform-y matrix x y)))) diff --git a/doc/api.texi b/doc/api.texi index 17accef..86788ba 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -1227,7 +1227,7 @@ to @var{origin}, a 2D vector. If an argument is not provided, that particular transformation will not be included in the result. @end deffn -@deffn {Procedure} transform! matrix v +@deffn {Procedure} matrix4-transform! matrix v Modify the 2D vector @var{v} in-place by multiplying it by the 4x4 matrix @var{matrix}. @end deffn |