Skip to content
Browse files

jet model

  • Loading branch information...
1 parent a2879d4 commit bbfd06b17c9c6f2d166b1cb74f1ab0c64d2cf5e5 @dballard committed Aug 20, 2011
Showing with 19 additions and 2 deletions.
  1. +3 −0 engine.lisp
  2. +13 −1 flight-sim.lisp
  3. +3 −1 math.lisp
View
3 engine.lisp
@@ -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
14 flight-sim.lisp
@@ -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
4 math.lisp
@@ -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

0 comments on commit bbfd06b

Please sign in to comment.
Something went wrong with that request. Please try again.