diff options
author | David Thompson <dthompson2@worcester.edu> | 2022-12-13 08:34:50 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2022-12-14 12:57:02 -0500 |
commit | cc5ebcff8824035288ef2ba846751a52520a587e (patch) | |
tree | 44ecbab32e4ef87f90a765a279d720eea2475858 | |
parent | 76d69b9e36a5355b5875a84f8bf2c3edde37ac1f (diff) |
mixins: Define generic position/size accessors.
-rw-r--r-- | catbird/camera.scm | 5 | ||||
-rw-r--r-- | catbird/mixins.scm | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/catbird/camera.scm b/catbird/camera.scm index 525843f..90120b7 100644 --- a/catbird/camera.scm +++ b/catbird/camera.scm @@ -30,8 +30,6 @@ #:export (<camera> projection-matrix view-matrix - width - height current-camera <camera-2d> @@ -44,7 +42,8 @@ near-clip far-clip direction - up)) + up) + #:re-export (width height)) (define-root-class <camera> () (width #:accessor width #:init-keyword #:width) diff --git a/catbird/mixins.scm b/catbird/mixins.scm index 5e93690..2443bc1 100644 --- a/catbird/mixins.scm +++ b/catbird/mixins.scm @@ -68,7 +68,13 @@ <movable-2d> <movable-3d> - position) + position + position-x + position-y + position-y + width + height + depth) #:replace (pause)) (define-class <nameable> () @@ -214,3 +220,10 @@ (define-class <movable-3d> () (position #:accessor position #:init-keyword #:position #:init-form (vec3 0.0 0.0 0.0))) + +(define-accessor position-x) +(define-accessor position-y) +(define-accessor position-z) +(define-accessor width) +(define-accessor height) +(define-accessor depth) |