diff --git a/engine.lisp b/engine.lisp index 95f5260..5a92c59 100644 --- a/engine.lisp +++ b/engine.lisp @@ -22,8 +22,8 @@ ; take 2 seconds to fully fire (defmethod regen-model ((model engine-model) time) - (setf (vertices model) (generate-step-2d-array *thruster-vertices* time)) - (setf (colors model) (generate-step-2d-array *thruster-colors* time))) + (setf (vertices model) (generate-step-2d-array (template-vertices model) time)) + (setf (colors model) (generate-step-2d-array (template-colors model) time))) (defparameter *thruster-vertices* diff --git a/flight-sim.asd b/flight-sim.asd index eeec19a..4d763d9 100644 --- a/flight-sim.asd +++ b/flight-sim.asd @@ -12,5 +12,6 @@ (:file "model") (:file "physics") (:file "objects") + (:file "engine") (:file "flight-sim"))) diff --git a/flight-sim.lisp b/flight-sim.lisp index db04ecb..8aff019 100644 --- a/flight-sim.lisp +++ b/flight-sim.lisp @@ -248,9 +248,21 @@ (setf *num-frames* 0) (setf *last-time* *start-time*) (setf *controls-active* '()) - (setf *self* (make-instance 'game-object - :body (make-instance 'body :coords (vector 0 0 11)) - :model *ship-model*)) + (setf *self* + (make-instance + 'game-object + :body (make-instance 'body :coords (vector 0 0 11)) + :model *ship-model* + :attachments + (list :thruster + (make-instance 'engine-object + :model (make-instance 'engine-model + :template-vertices *thruster-vertices* + :template-colors *thruster-colors*) + :body (make-instance 'body + :coords (vector 0 0 3))))))) + + ;:engines (list :engines (list :thrust ; (make-instance 'engine-object ; :motion (make-instance 'motion :coords (vector 0 0.5 3.0)) diff --git a/objects.lisp b/objects.lisp index 06259e6..71493ad 100644 --- a/objects.lisp +++ b/objects.lisp @@ -14,7 +14,7 @@ (defmethod activate ((object game-object) sym start-time) (push sym (active-attachments object)) - (activate (getf (attachments object) sym))) + (activate (getf (attachments object) sym) start-time)) (defmethod draw :before ((object game-object) time) (gl:push-matrix)