From 38b33de4c2e03a6f706fced1b866d975a6296156 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 27 Jul 2022 07:41:38 -0500 Subject: [refactor] to reduce use of vec --- src/core/unit.lisp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/core/unit.lisp') diff --git a/src/core/unit.lisp b/src/core/unit.lisp index 8fe6521..1102f20 100644 --- a/src/core/unit.lisp +++ b/src/core/unit.lisp @@ -101,11 +101,13 @@ (mat:nmrotate m vec:+vz+ r) (mat:nmtranslate m (vec:v* -1.0 tr)) - (list (mat:m* m (vec:vec x y 0.0 1.0)) - (mat:m* m (vec:vec x (+ y h) 0.0 1.0)) - (mat:m* m (vec:vec (+ x w) (+ y h) 0.0 1.0)) - (mat:m* m (vec:vec (+ x w) y 0.0 1.0)) - (mat:m* m (vec:vec x y 0.0 1.0)))))))) + (loop for vec in (list (mat:m* m (vec:vec x y 0.0 1.0)) + (mat:m* m (vec:vec x (+ y h) 0.0 1.0)) + (mat:m* m (vec:vec (+ x w) (+ y h) 0.0 1.0)) + (mat:m* m (vec:vec (+ x w) y 0.0 1.0)) + (mat:m* m (vec:vec x y 0.0 1.0))) + collect (list (vec:vx vec) + (vec:vy vec)))))))) (defun units-intersect-p (au1 au2) "Returns T if the two units AU1 an AU2 intersect. Both must implement GET-RECT." -- cgit v1.2.3