From a37d5a52c84b676dd42d8dc7031ae0422e625ae6 Mon Sep 17 00:00:00 2001 From: Shinmera Date: Thu, 21 Mar 2019 14:35:40 +0100 Subject: [PATCH] Add scaled-entity helper --- helpers.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helpers.lisp b/helpers.lisp index d0df031a..ca8ef2cb 100644 --- a/helpers.lisp +++ b/helpers.lisp @@ -51,6 +51,14 @@ (translate (pivot obj)) (call-next-method))) +(defclass scaled-entity (entity) + ((scaling :initarg :scaling :initform (vec 1 1 1) :accessor scaling))) + +(defmethod paint :around ((obj scaled-entity) target) + (with-pushed-matrix () + (scale (scaling obj)) + (call-next-method))) + (define-subject clocked-subject (clock) ())