diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-27 07:41:38 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-27 07:41:38 -0500 |
commit | 38b33de4c2e03a6f706fced1b866d975a6296156 (patch) | |
tree | 69b18dde462d45447f52dd3a1f2b2d132d52b1ad /src/core | |
parent | b510307e505275fffcbd029f4ae437581bc916a9 (diff) |
[refactor] to reduce use of vec
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/unit.lisp | 12 |
1 files changed, 7 insertions, 5 deletions
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." |