1 ;;; Copyright 2009 Christoph Senjak
3 (in-package :uxul-world)
9 :documentation "The position where the moving rectangle is at
10 the point of collision")
11 (direction :initarg :direction
13 :documentation "On which side of the MOVING rectangle
14 does the collision occur?")
15 (collision-time :initarg :collision-time
16 :accessor collision-time
18 :documentation "The quotient of the length of the
19 real movement and the length of the desired
21 (desired-movement :initarg :desired-movement
22 :accessor desired-movement
24 :documentation "The full movement that was given
25 to move-about and could not be fulfilled.")))
27 (defmethod has-horizontal-direction ((obj collision))
28 "test, whether this has horizontal direction"
29 (or (eq (direction obj) :left)
30 (eq (direction obj) :right)))
32 (defmethod has-vertical-direction ((obj collision))
33 "test, whether this has vertical direction"
34 (or (eq (direction obj) :up)
35 (eq (direction obj) :down)))
37 (defmethod colliding ((object null))