Adding random dalek generation
[lambdamundo.git] / cursor.lisp
bloba5bf2f541a128f020f34020c2b265d211b24ee73
2 (in-package :lambdamundo)
4 (defclass cursor ()
5 ((orientation :initform (new-quaternion) :accessor orientation-of)
6 (location :initform (new-vertex3d) :accessor location-of)
7 (attachments :initform nil))
8 (:documentation "Object representing a graphical 3d location for manipulation"))
10 (defmethod draw ((self cursor))
11 (with-vertex3d (location-of self)
12 (ox oy oz ow)
13 (with-matrix33
14 (quaternion->matrix33 (orientation-of self))
15 (xx yx zx
16 xy yy zy
17 xz yz zz)
18 ;; TO DO -- nice fat lines?
19 (gl:with-begin gl:+lines+
20 (gl:color-3f 1.0 0.0 0.0)
21 (gl:vertex-3f ox oy oz)
22 (gl:vertex-3f xx xy xz)
23 (gl:color-3f 0.0 1.0 0.0)
24 (gl:vertex-3f ox oy oz)
25 (gl:vertex-3f yx yy yz)
26 (gl:vertex-3f 0.0 0.0 1.0)
27 (gl:vertex-3f ox oy oz)
28 (gl:vertex-3f zx zy zz)))))
30 ;; to do -- we attach things to cursors, either other cursors to create
31 ;; heirarchies or meshes to draw