jet model

This commit is contained in:
Dan Ballard 2011-08-20 15:50:49 -07:00
parent a2879d45ed
commit bbfd06b17c
3 changed files with 19 additions and 2 deletions

View File

@ -43,6 +43,9 @@
((32 64 2) (32 132 2) (32 164 2))
((0 255 2) (0 255 2) (64 255 2))))
;; jet shooting up
(defparameter *jet-vertices*
'((0 0 -0.2) (-0.2 0 0.2) (0.2 0 0.2) (0 (0 0.4 1) 0)))
(defmethod draw ((object engine-object) time)
(if (< (- time (start-time object)) (activation-time object)) ;; hack since times are in templates!!!

View File

@ -189,7 +189,19 @@
:force (make-instance 'force :newtons 10000 :direction (vector 0 0 1))
:body (make-instance 'body
:coords (vector 0 0 1.5))))))
:coords (vector 0 0 1.5)))
; yaw (starboard (right) positive)
:pos-yaw
(make-instance 'engine-object
:activation-time 2
:model (make-instance 'engine-model
:template-vertices *jet-vertices*
:template-colors *thruster-colors*
:faces (make-2d-array 4 3 '((0 1 3) (0 2 1) (0 3 2) (1 2 3)))
:face-colors (make-2d-array 4 3 '((0 1 3) (0 2 1) (0 3 2) (1 2 3))))
:body (make-instance 'body
:coords (vector
)))
;:engines (list :engines (list :thrust
; (make-instance 'engine-object
; :motion (make-instance 'motion :coords (vector 0 0.5 3.0))

View File

@ -17,7 +17,9 @@
;; function to determine value lying on start to end taking time duration at now
(defun converge (start end duration now)
(float (+ start (* (- end start) (if (eql now 0.0) 0.0 (/ (min now duration) duration))))))
(if (> now duration)
end
(float (+ start (* (- end start) (if (eql now 0.0) 0.0 (/ (min now duration) duration)))))))
;; returns a real lisp 2d array