Fixing bug in engine. Used arrays when tuples should have been used.
[tuple-trace.git] / ray.lisp
blob25e78d9d2af44dece270ec44a91f3e17a1a28582
2 (in-package :tuple-trace)
4 (defclass ray ()
5 ((origin :initform (new-vector3d) :initarg :origin :accessor origin-of)
6 (direction :initform (new-vector3d) :initarg :direction :accessor direction-of)))
9 (defmethod initialize-instance :after ((self ray) &key position direction)
10 (setf (origin-of self) position)
11 (setf (direction-of self) direction))
14 (defun make-ray (xo yo zo xr yr zr)
15 (let ((result
16 (make-instance 'ray
17 :origin (make-vector3d* xo yo zo)
18 :direction (make-vector3d
19 (vector3d-normal (vector3d-tuple xr yr zr))))))
20 result))