From cc5ebcff8824035288ef2ba846751a52520a587e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 13 Dec 2022 08:34:50 -0500 Subject: mixins: Define generic position/size accessors. --- catbird/camera.scm | 5 ++--- 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 ( projection-matrix view-matrix - width - height current-camera @@ -44,7 +42,8 @@ near-clip far-clip direction - up)) + up) + #:re-export (width height)) (define-root-class () (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 @@ - position) + position + position-x + position-y + position-y + width + height + depth) #:replace (pause)) (define-class () @@ -214,3 +220,10 @@ (define-class () (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) -- cgit v1.2.3