aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/unit.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/unit.lisp')
-rw-r--r--src/core/unit.lisp12
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."