Mercurial > cortex
view org/integration.org @ 513:4c4d45f6f30b
accept/reject changes
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 30 Mar 2014 10:41:18 -0400 |
parents | ee977613c244 |
children |
line wrap: on
line source
1 #+title: Integration2 #+author: Robert McIntyre3 #+email: rlm@mit.edu4 #+description:5 #+keywords: simulation, jMonkeyEngine3, clojure6 #+SETUPFILE: ../../aurellem/org/setup.org7 #+INCLUDE: ../../aurellem/org/level-0.org9 * Integration11 This is the ultimate test which features all of the senses that I've12 made so far. The blender file for the creature serves as an example of13 a fully equipped creature in terms of senses. You can find it [[../assets/Models/test-creature/hand.blend][here]].16 #+begin_html17 <div class="figure">18 <video controls="controls" width="755">19 <source src="../video/hand.ogg" type="video/ogg"20 preload="none" poster="../images/aurellem-1280x480.png" />21 </video>22 <br> <a href="http://youtu.be/ZgkWFIoHNuU"> YouTube </a>23 <p>Simulated Senses in a Virtual Environment</p>24 </div>25 #+end_html27 * Generating the Video29 #+name: integration30 #+begin_src clojure31 (ns cortex.test.integration32 "let's play!"33 {:author "Robert McIntyre"}34 (:use (cortex world util import body sense35 hearing touch vision proprioception movement))36 (:import (com.jme3.math ColorRGBA Vector3f))37 (:import java.io.File)38 (:import com.jme3.audio.AudioNode)39 (:import com.aurellem.capture.RatchetTimer))41 (dorun (cortex.import/mega-import-jme3))42 ;;(rlm.rlm-commands/help)44 (def hand "Models/test-creature/hand.blend")46 (def output-base (File. "/home/r/proj/cortex/render/hand"))47 #+end_src49 For this demonstration I have to manually drive the muscles of the50 hand. I do this by creating a little mini-language to describe51 simulated muscle contraction.53 #+name: integration-254 #+begin_src clojure55 (defn motor-control-program56 "Create a function which will execute the motor script"57 [muscle-positions58 script]59 (let [current-frame (atom -1)60 keyed-script (group-by first script)61 current-forces (atom {}) ]62 (fn [effectors]63 (let [indexed-effectors (vec effectors)]64 (dorun65 (for [[_ part force] (keyed-script (swap! current-frame inc))]66 (swap! current-forces (fn [m] (assoc m part force)))))67 (doall (map (fn [effector power]68 (effector (int power)))69 effectors70 (map #(@current-forces % 0) muscle-positions)))))))72 (def muscle-positions73 [:pointer-2-e74 :pointer-2-f75 :thumb-176 :thumb-177 :pointer-1-e78 :pointer-1-f79 :thumb-2-e80 :thumb-2-f81 :middle-1-e82 :middle-1-f83 :pointer-3-f84 :pointer-3-e85 :middle-2-e86 :middle-2-f87 :middle-3-f88 :middle-3-e89 :pinky-2-e90 :pinky-2-f91 :pinky-3-f92 :pinky-3-e93 :ring-3-e94 :ring-3-f95 :ring-2-f96 :ring-2-e97 :ring-1-e98 :ring-1-f99 :thumb-1-e100 :thumb-1-f101 :pinky-1-f102 :pinky-1-e])104 (def full 9001)107 ;; Choreography:109 ;; Let the hand fall palm-up111 ;; it curls its phalanges, starting with the pinky.113 ;; it lets its phalanges fall back down.115 ;; block falls down onto the hand, accompanied by a sound. The block116 ;; can be seen by the hand's eye.118 ;; hand FORCEFULLY catapults the block so that it hits the camera.121 ;; the syntax here is [keyframe body-part force]122 (def move-fingers123 [[300 :pinky-3-f 50]124 [320 :pinky-2-f 80]125 [340 :pinky-1-f 100]127 [310 :ring-3-f 100]128 [330 :ring-2-f 120]129 [350 :ring-1-f 140]131 [330 :middle-3-f 120]132 [340 :middle-2-f 120]133 [360 :middle-1-f 30]135 [350 :pointer-3-f 120]136 [360 :pointer-2-f 120]137 [380 :pointer-1-f 30]139 [800 :pinky-3-f 0]140 [800 :pinky-2-f 0]141 [800 :pinky-1-f 0]143 [800 :ring-3-f 0]144 [800 :ring-2-f 0]145 [800 :ring-1-f 0]147 [800 :middle-3-f 0]148 [800 :middle-2-f 0]149 [800 :middle-1-f 0]151 [800 :pointer-3-f 0]152 [800 :pointer-2-f 0]153 [800 :pointer-1-f 0]156 [800 :pinky-3-e 50]157 [800 :pinky-2-e 80]158 [800 :pinky-1-e 100]160 [800 :ring-3-e 100]161 [800 :ring-2-e 120]162 [800 :ring-1-e 140]164 [800 :middle-3-e 120]165 [800 :middle-2-e 120]166 [800 :middle-1-e 30]168 [800 :pointer-3-e 120]169 [800 :pointer-2-e 120]170 [800 :pointer-1-e 30]172 [870 :pinky-3-e 0]173 [870 :pinky-2-e 0]174 [870 :pinky-1-e 0]176 [870 :ring-3-e 0]177 [870 :ring-2-e 0]178 [870 :ring-1-e 0]180 [870 :middle-3-e 0]181 [870 :middle-2-e 0]182 [870 :middle-1-e 0]184 [870 :pointer-3-e 0]185 [870 :pointer-2-e 0]186 [870 :pointer-1-e 0]188 [1500 :pointer-1-f full]189 [1500 :pointer-2-f full]190 [1500 :pointer-3-f full]192 [1500 :middle-1-f full]193 [1500 :middle-2-f full]194 [1500 :middle-3-f full]196 [1510 :pointer-1-f 0]197 [1510 :pointer-2-f 0]198 [1510 :pointer-3-f 0]200 [1510 :middle-1-f 0]201 [1510 :middle-2-f 0]202 [1510 :middle-3-f 0]203 ])205 (defn gen-summon-ball [debug?]206 (let [wait (atom 1100)]207 (fn [world]208 (if (= 0 (swap! wait dec))209 (let [brick210 (box 0.8 0.8 0.8 :mass 0.05211 :position (Vector3f. -0.5 0 0.5)212 :color (ColorRGBA/Red))213 bell (AudioNode. (asset-manager)214 "Sounds/pure.wav" false)]215 (.play bell)216 (if debug?217 (.addControl218 brick219 (proxy [AbstractControl] []220 (controlUpdate [tpf]221 (println-repl (.getWorldTranslation brick)))222 (controlRender [_ _]))))223 (add-element world brick))))))225 (import com.aurellem.capture.Capture)227 (defn test-integration228 "Testing Everything!230 You will see an articulated hand fall onto the table. It has all231 senses including:232 - Vision, 4 channels233 - Hearing234 - Touch235 - Proprioceptoin236 - Muscle Tension238 Keys:239 <space> : fire ball"240 ([] (test-integration false))241 ([record?]242 (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false)244 base (File. "/home/r/proj/cortex/render/hand")247 creature (doto (load-blender-model hand)248 (body!))250 summon-ball (gen-summon-ball false)251 ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;;252 touch (touch! creature)253 touch-display (view-touch)255 vision (vision! creature)256 vision-display (view-vision)258 hearing (hearing! creature)259 hearing-display (view-hearing)261 prop (proprioception! creature)262 prop-display (view-proprioception)264 control-script (motor-control-program265 muscle-positions move-fingers)266 muscles (movement! creature)267 muscle-display (view-movement)268 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;270 fix-display (gen-fix-display)]271 (world272 (nodify [creature273 (box 10 2 10 :position (Vector3f. 0 -9 0)274 :color ColorRGBA/Gray :mass 0)275 me])276 standard-debug-controls278 (fn [world]279 (.setTimer world (RatchetTimer. 60))280 (position-camera281 world (Vector3f. -0.13217318, 5.816415, -5.3089414)282 (Quaternion. 0.55685693, 0.0042774677, -0.0028673497, 0.83059245))284 (light-up-everything world)285 (enable-debug world)286 (add-camera! world287 (add-eye! creature288 (.getChild289 (.getChild creature "eyes") "eye"))290 (comp (view-image) BufferedImage!))292 (if record?293 (Capture/captureVideo294 world (File. base "main")))295 (if record?296 (Capture/captureAudio297 world (File. base "main.wav"))))298 (fn [world tpf]299 (prop-display300 (prop)301 (if record? (File. base "proprio")))302 (touch-display303 (map #(% (.getRootNode world)) touch)304 (if record? (File. base "touch")))305 (vision-display306 (map #(% world) vision)307 (if record? (File. base "vision")))308 (hearing-display309 (map #(% world) hearing)310 (if record? (File. base "hearing")))311 (muscle-display312 (control-script muscles)313 (if record? (File. base "muscle")))315 (summon-ball world)317 (.setLocalTranslation me (.getLocation (.getCamera world)))318 (fix-display world))))))319 #+end_src321 ** ImageMagick / ffmpeg323 Just a bunch of calls to imagemagick to arrange the data that324 =test-everything!= produces.326 #+name: magick-8327 #+begin_src clojure328 (ns cortex.video.magick8329 (:import java.io.File)330 (:use clojure.java.shell))332 (comment333 ;; list of touch targets334 0 middle-11335 1 middle-21336 2 middle-31337 3 pinky-11338 4 pinky-21339 5 pinky-31340 6 pointer-11341 7 pointer-21342 8 pointer-31343 9 ring-11344 10 ring-21345 11 ring-31346 12 thumb-11347 13 thumb-2.0011350 ;; list of vision targets351 0 :all352 1 :green353 2 :blue354 3 :red356 ;; list of proprio targets357 0 middle-11 -> middle-21358 1 middle-21 -> middle-31359 2 thumb-11 -> thumb-2.0011360 3 pointer-11 -> pointer-21361 4 pointer-21 -> pointer-31362 5 ring-21 -> ring-31363 6 ring-11 -> ring-21364 7 pinky-21 -> pinky-31365 8 pinky-11 -> pinky-21366 9 middle-11 -> palm1367 10 pinky-11 -> palm1368 11 palm1 -> pointer-11369 12 palm1 -> ring-11370 13 palm1 -> thumb-11373 ;; list of muscle targets374 0 :pointer-2-e375 1 :pointer-2-f376 2 :thumb-1377 3 :thumb-1378 4 :pointer-1-e379 5 :pointer-1-f380 6 :thumb-2-e381 7 :thumb-2-f382 8 :middle-1-e383 9 :middle-1-f384 10 :pointer-3-f385 11 :pointer-3-e386 12 :middle-2-e387 13 :middle-2-f388 14 :middle-3-f389 15 :middle-3-e390 16 :pinky-2-e391 17 :pinky-2-f392 18 :pinky-3-f393 19 :pinky-3-e394 20 :ring-3-e395 21 :ring-3-f396 22 :ring-2-f397 23 :ring-2-e398 24 :ring-1-e399 25 :ring-1-f400 26 :thumb-1-e401 27 :thumb-1-f402 28 :pinky-1-f403 29 :pinky-1-e404 )406 (def base (File. "/home/r/proj/cortex/render/hand"))408 (defn prepare-muscle [muscle]409 ["(" muscle "-rotate" "90" "-scale" "15x60!" ")"])411 (defn prepare-touch [touch]412 ["(" touch "-rotate" "180" ")"])414 (defn generate-top-finger [tip-flexor tip-extensor tip415 joint-2-3416 mid-flexor mid-extensor mid417 joint-1-2]418 ["("419 "-size" "113x357" "xc:transparent"420 (prepare-muscle tip-flexor) "-geometry" "+0+7" "-composite"421 (prepare-muscle tip-extensor) "-geometry" "+98+7" "-composite"422 (prepare-touch tip) "-geometry" "+18+0" "-composite"424 joint-2-3 "-geometry" "+32+79" "-composite"426 (prepare-muscle mid-flexor) "-geometry" "+19+131" "-composite"427 (prepare-muscle mid-extensor) "-geometry" "+80+131" "-composite"428 (prepare-touch mid) "-geometry" "+39+133" "-composite"430 joint-1-2 "-geometry" "+32+193" "-composite"431 ")"])433 (defn file-names [#^File dir]434 (map #(.getCanonicalPath %) (next (sort (file-seq dir)))))436 (defn file-groups [& paths]437 (apply (partial map list )438 (map (comp file-names #(File. base %))439 paths)))441 (defn pinky []442 (file-groups443 "muscle/18"444 "muscle/19"445 "touch/5"446 "proprio/7"448 "muscle/17"449 "muscle/16"450 "touch/4"451 "proprio/8"453 "muscle/28"454 "muscle/29"455 "touch/3"456 "proprio/10"))458 (defn ring []459 (file-groups460 "muscle/21"461 "muscle/20"462 "touch/11"463 "proprio/5"465 "muscle/22"466 "muscle/23"467 "touch/10"468 "proprio/6"470 "muscle/25"471 "muscle/24"472 "touch/9"473 "proprio/12"))475 (defn middle []476 (file-groups477 "muscle/14"478 "muscle/15"479 "touch/2"480 "proprio/1"482 "muscle/13"483 "muscle/12"484 "touch/1"485 "proprio/0"487 "muscle/9"488 "muscle/8"489 "touch/0"490 "proprio/9"))492 (defn pointer []493 (file-groups494 "muscle/10"495 "muscle/11"496 "touch/8"497 "proprio/4"499 "muscle/1"500 "muscle/0"501 "touch/7"502 "proprio/3"504 "muscle/5"505 "muscle/4"506 "touch/6"507 "proprio/11"))509 (defn thumb []510 (file-groups511 "muscle/7"512 "muscle/6"513 "touch/13"514 "proprio/2"516 "muscle/27"517 "muscle/26"518 "muscle/3"519 "muscle/2"520 "touch/12"521 "proprio/13"))523 (defn generate-finger524 [tip-flexor tip-extensor tip525 joint-2-3526 mid-flexor mid-extensor mid527 joint-1-2528 base-flexor base-extensor base529 joint-palm-1]530 ["("531 "-size" "113x357" "xc:transparent"532 (generate-top-finger533 tip-flexor tip-extensor tip534 joint-2-3535 mid-flexor mid-extensor mid536 joint-1-2) "-geometry" "+0+0" "-composite"537 (prepare-muscle base-flexor) "-geometry" "+19+245" "-composite"538 (prepare-muscle base-extensor) "-geometry" "+80+245" "-composite"539 (prepare-touch base) "-geometry" "+39+247" "-composite"540 joint-palm-1 "-geometry" "+32+307" "-composite"541 ")"])543 (defn generate-thumb544 [tip-flexor tip-extensor tip545 joint-1-2546 mid-flexor mid-extensor mid-flexor-2 mid-extensor-2 mid547 joint-palm-1]548 ["("549 "-size" "113x357" "xc:transparent"550 (generate-top-finger551 tip-flexor tip-extensor tip552 joint-1-2553 mid-flexor mid-extensor mid554 joint-palm-1) "-geometry" "+0+0" "-composite"555 (prepare-muscle mid-flexor-2) "-geometry" "+2+131" "-composite"556 (prepare-muscle mid-extensor-2) "-geometry" "+100+131" "-composite"557 ")"])559 (defn generate-hand560 [pinky-pieces561 ring-pieces562 middle-pieces563 pointer-pieces564 thumb-pieces]565 ["("566 "-size" "688x769" "xc:transparent"567 (apply generate-finger pinky-pieces)568 "-geometry" "+0+195" "-composite"569 (apply generate-finger ring-pieces)570 "-geometry" "+111+100" "-composite"571 (apply generate-finger middle-pieces)572 "-geometry" "+228+0" "-composite"573 "(" (apply generate-thumb thumb-pieces) "-background" "#00000000"574 "-rotate" "45" ")"575 "-geometry" "+300+420" "-composite"576 (apply generate-finger pointer-pieces)577 "-geometry" "+350+96" "-composite"578 ")"])580 (defn generate-vision581 [all green blue red]582 ["("583 "-size" "204x192" "xc:transparent"584 all "-geometry" "+0+0" "-composite"585 green "-geometry" "+113+0" "-composite"586 blue "-geometry" "+0+105" "-composite"587 red "-geometry" "+113+105" "-composite"588 ")"])590 (def test-muscle (File. base "muscle/0/0000000.png"))591 (def test-proprio (File. base "proprio/0/0000000.png"))592 (def test-tip (File. base "touch/2/0000000.png"))593 (def test-mid (File. base "touch/0/0000000.png"))594 (def test-vision (File. base "vision/0/0000000.png"))595 (def test-hearing (File. base "hearing/0/0000000.png"))596 (def test-main (File. base "main/0000000.png"))598 (def test-target (File. base "output.png"))600 (def background (File. base "background.png"))602 (use 'clojure.java.shell)604 (defn vision []605 (file-groups606 "vision/0"607 "vision/1"608 "vision/2"609 "vision/3"))611 (defn hearing []612 (file-names (File. base "hearing/0")))614 (defn main []615 (file-names (File. base "main")))617 (defn targets [dest max]618 (map619 (comp #(.getCanonicalPath %)620 #(File. (str base dest (format "%07d.png" %))))621 (range max)))624 (defn final-image [main [all red green blue] hearing625 pinky ring middle pointer thumb target]626 (println target)627 (apply628 sh629 (flatten630 ["convert"631 (.getCanonicalPath background)633 (generate-hand pinky ring middle pointer thumb)634 "-geometry" "+809+22" "-composite"636 (generate-vision all red green blue)637 "-geometry" "+974+599" "-composite"639 hearing640 "-geometry" "+784+819" "-composite"642 main643 "-geometry" "+78+202" "-composite"645 target])))647 (defn combine-files []648 (dorun649 (pmap final-image650 (main)651 (vision)652 (hearing)653 (pinky)654 (ring)655 (middle)656 (pointer)657 (thumb)658 (targets "/out/" (count (main))))))660 (defn subtitles []661 (file-names (File. base "subs")))663 (defn outs []664 (file-names (File. base "out")))667 (defn mix-subtitles []668 (let [subs (subtitles)669 targets (targets "/out-subs/" (count subs))670 overlay (.getCanonicalPath (File. base "output.png"))]671 (dorun672 (pmap673 (fn [sub target]674 (sh675 "convert"676 overlay677 sub "-geometry" "+0+0" "-composite"678 target))679 subs targets))))681 (defn out-subtitles []682 (file-names (File. base "out-subs")))685 (defn insert-subtitles []686 (let [subtitles (out-subtitles)687 outs (outs)688 targets (targets689 "/final/"690 (+ (count outs) (count subtitles)))]691 (dorun692 (pmap693 #(sh "cp" %1 %2)694 (concat subtitles outs) targets))))696 (defn generate-final []697 (combine-files)698 (mix-subtitles)699 (insert-subtitles))700 #+end_src702 #+begin_src sh :results silent703 cd /home/r/proj/cortex/render/hand705 sox --ignore-length main.wav main-delayed.wav delay 24707 mogrify -resize 755x final/*708 #+end_src710 #+begin_src sh :results silent711 cd /home/r/proj/cortex/render/hand713 ffmpeg -r 60 -i final/%07d.png -i main-delayed.wav -b:a 128k \714 -b:v 9000k -c:a libvorbis -c:v libtheora hand.ogg715 #+end_src717 * Source Listing718 - [[../src/cortex/test/integration.clj][cortex.test.integration]]719 - [[../src/cortex/video/magick8.clj][cortex.video.magick8]]720 - [[../assets/Models/subtitles/hand.blend][subtitles/hand.blend]]721 #+html: <ul> <li> <a href="../org/integration.org">This org file</a> </li> </ul>722 - [[http://hg.bortreb.com ][source-repository]]725 * COMMENT purgatory726 #+begin_src clojure727 (defn bullet-trans* []728 (let [obj-a (box 1.5 0.5 0.5 :color ColorRGBA/Red729 :position (Vector3f. 5 0 0)730 :mass 90)731 obj-b (sphere 0.5 :color ColorRGBA/Blue732 :position (Vector3f. -5 0 0)733 :mass 0)734 control-a (.getControl obj-a RigidBodyControl)735 control-b (.getControl obj-b RigidBodyControl)736 move-up? (atom nil)737 move-down? (atom nil)738 move-left? (atom nil)739 move-right? (atom nil)740 roll-left? (atom nil)741 roll-right? (atom nil)742 force 100743 swivel744 (.toRotationMatrix745 (doto (Quaternion.)746 (.fromAngleAxis (/ Math/PI 2)747 Vector3f/UNIT_X)))748 x-move749 (doto (Matrix3f.)750 (.fromStartEndVectors Vector3f/UNIT_X751 (.normalize (Vector3f. 1 1 0))))753 timer (atom 0)]754 (doto755 (ConeJoint.756 control-a control-b757 (Vector3f. -8 0 0)758 (Vector3f. 2 0 0)759 ;;swivel swivel760 ;;Matrix3f/IDENTITY Matrix3f/IDENTITY761 x-move Matrix3f/IDENTITY762 )763 (.setCollisionBetweenLinkedBodys false)764 (.setLimit (* 1 (/ Math/PI 4)) ;; twist765 (* 1 (/ Math/PI 4)) ;; swing span in X-Y plane766 (* 0 (/ Math/PI 4)))) ;; swing span in Y-Z plane767 (world (nodify768 [obj-a obj-b])769 (merge standard-debug-controls770 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))771 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))772 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))773 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))774 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))775 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})777 (fn [world]778 (enable-debug world)779 (set-gravity world Vector3f/ZERO)780 )782 (fn [world _]784 (if @move-up?785 (.applyForce control-a786 (Vector3f. force 0 0)787 (Vector3f. 0 0 0)))788 (if @move-down?789 (.applyForce control-a790 (Vector3f. (- force) 0 0)791 (Vector3f. 0 0 0)))792 (if @move-left?793 (.applyForce control-a794 (Vector3f. 0 force 0)795 (Vector3f. 0 0 0)))796 (if @move-right?797 (.applyForce control-a798 (Vector3f. 0 (- force) 0)799 (Vector3f. 0 0 0)))801 (if @roll-left?802 (.applyForce control-a803 (Vector3f. 0 0 force)804 (Vector3f. 0 0 0)))805 (if @roll-right?806 (.applyForce control-a807 (Vector3f. 0 0 (- force))808 (Vector3f. 0 0 0)))810 (if (zero? (rem (swap! timer inc) 100))811 (.attachChild812 (.getRootNode world)813 (sphere 0.05 :color ColorRGBA/Yellow814 :physical? false :position815 (.getWorldTranslation obj-a)))))816 )817 ))819 (defn test-joint [joint]820 (let [[origin top bottom floor] (world-setup joint)821 control (.getControl top RigidBodyControl)822 move-up? (atom false)823 move-down? (atom false)824 move-left? (atom false)825 move-right? (atom false)826 roll-left? (atom false)827 roll-right? (atom false)828 timer (atom 0)]830 (world831 (nodify [top bottom floor origin])832 (merge standard-debug-controls833 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))834 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))835 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))836 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))837 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))838 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})840 (fn [world]841 (light-up-everything world)842 (enable-debug world)843 (set-gravity world (Vector3f. 0 0 0))844 )846 (fn [world _]847 (if (zero? (rem (swap! timer inc) 100))848 (do849 ;; (println-repl @timer)850 (.attachChild (.getRootNode world)851 (sphere 0.05 :color ColorRGBA/Yellow852 :position (.getWorldTranslation top)853 :physical? false))854 (.attachChild (.getRootNode world)855 (sphere 0.05 :color ColorRGBA/LightGray856 :position (.getWorldTranslation bottom)857 :physical? false))))859 (if @move-up?860 (.applyTorque control861 (.mult (.getPhysicsRotation control)862 (Vector3f. 0 0 10))))863 (if @move-down?864 (.applyTorque control865 (.mult (.getPhysicsRotation control)866 (Vector3f. 0 0 -10))))867 (if @move-left?868 (.applyTorque control869 (.mult (.getPhysicsRotation control)870 (Vector3f. 0 10 0))))871 (if @move-right?872 (.applyTorque control873 (.mult (.getPhysicsRotation control)874 (Vector3f. 0 -10 0))))875 (if @roll-left?876 (.applyTorque control877 (.mult (.getPhysicsRotation control)878 (Vector3f. -1 0 0))))879 (if @roll-right?880 (.applyTorque control881 (.mult (.getPhysicsRotation control)882 (Vector3f. 1 0 0))))))))883 #+end_src887 * COMMENT generate source888 #+begin_src clojure :tangle ../src/cortex/test/integration.clj889 <<integration>>890 <<integration-2>>891 #+end_src893 #+begin_src clojure :tangle ../src/cortex/video/magick8.clj894 <<magick-8>>895 #+end_src