fixed ship not drawing issue
This commit is contained in:
parent
bd0ef45971
commit
9fac5b54a0
|
@ -10,7 +10,7 @@
|
||||||
(:file "math")
|
(:file "math")
|
||||||
(:file "graphics")
|
(:file "graphics")
|
||||||
(:file "model")
|
(:file "model")
|
||||||
(:file "phsyics")
|
(:file "physics")
|
||||||
(:file "objects")
|
(:file "objects")
|
||||||
(:file "flight-sim")))
|
(:file "flight-sim")))
|
||||||
|
|
||||||
|
|
|
@ -116,17 +116,19 @@
|
||||||
;; clear the buffer
|
;; clear the buffer
|
||||||
(gl:clear :color-buffer-bit :depth-buffer-bit)
|
(gl:clear :color-buffer-bit :depth-buffer-bit)
|
||||||
;; move to eye position
|
;; move to eye position
|
||||||
;;(object-draw (make-instance 'powered-object :motion (make-instance 'motion :coords (vector 0 0 -3)) :model *ship-model* :engine (engine *self*)))
|
;;draw (make-instance 'powered-object :motion (make-instance 'motion :coords (vector 0 0 -3)) :model *ship-model* :engine (engine *self*)))
|
||||||
(format t "draw self~%")
|
(let ((orig-coords (coords (body *self*))))
|
||||||
(draw *self*)
|
(setf (coords (body *self*)) (vector 0 0 -3))
|
||||||
(format t "move to coords~%")
|
(draw *self*)
|
||||||
|
(setf (coords (body *self*)) orig-coords))
|
||||||
|
|
||||||
(gl:translate (- (aref (coords (body *self*)) 0)) (- (aref (coords (body *self*)) 1)) (- (aref (coords (body *self*)) 2))) ;; eye
|
(gl:translate (- (aref (coords (body *self*)) 0)) (- (aref (coords (body *self*)) 1)) (- (aref (coords (body *self*)) 2))) ;; eye
|
||||||
(format t "draw all else~%")
|
|
||||||
(loop for entity across *world* do
|
(loop for entity across *world* do
|
||||||
; only draw if its infront of me
|
; only draw if its infront of me
|
||||||
(if (< (aref (coords (body entity)) 2) (+ 10 (aref (coords (body *self*)) 2)))
|
(if (< (aref (coords (body entity)) 2) (+ 10 (aref (coords (body *self*)) 2)))
|
||||||
(draw entity)))
|
(draw entity)))
|
||||||
(format t "look at~%")
|
|
||||||
(gl:matrix-mode :modelview)
|
(gl:matrix-mode :modelview)
|
||||||
(gl:load-identity)
|
(gl:load-identity)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue