Mercurial > cortex
view org/integration.org @ 298:85f3ff3e3f26
still working on video generation
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 16 Feb 2012 20:05:54 -0700 |
parents | d1206b11ae2d |
children | 47fe4f7b74b3 |
line wrap: on
line source
1 #+title:2 #+author: Robert McIntyre3 #+email: rlm@mit.edu4 #+description:5 #+keywords: simulation, jMonkeyEngine3, clojure6 #+SETUPFILE: ../../aurellem/org/setup.org7 #+INCLUDE: ../../aurellem/org/level-0.org9 * Intro11 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]].15 #+name: integration16 #+begin_src clojure17 (ns cortex.integration18 "let's play!"19 {:author "Robert McIntyre"}20 (:use (cortex world util body sense21 hearing touch vision proprioception movement))22 (:import (com.jme3.math ColorRGBA Vector3f))23 (:import java.io.File)24 (:import com.jme3.audio.AudioNode)25 (:import com.aurellem.capture.RatchetTimer))27 (dorun (cortex.import/mega-import-jme3))28 (rlm.rlm-commands/help)30 (def hand "Models/test-creature/hand.blend")32 (def output-base (File. "/home/r/proj/cortex/render/hand"))35 ;; Let the hand fall palm-up37 ;; it curls its phalanges, starting with the pinky.39 ;; it lets these fall back down?41 ;; block falls down onto the hand, accompanied by a sound. The block42 ;; can be seen by the hand's eye.44 ;; hand FORCEFULLY catapults the block so that it hits the camera.47 (defn motor-control-program48 "Create a function which will execute the motor script"49 [muscle-positions50 script]51 (let [current-frame (atom -1)52 keyed-script (group-by first script)53 current-forces (atom {}) ]54 (fn [effectors]55 (let [indexed-effectors (vec effectors)]56 (dorun57 (for [[_ part force] (keyed-script (swap! current-frame inc))]58 (swap! current-forces (fn [m] (assoc m part force)))))59 (doall (map (fn [effector power]60 (effector (int power)))61 effectors62 (map #(@current-forces % 0) muscle-positions)))))))64 (def muscle-positions65 [:pointer-2-e66 :pointer-2-f67 :thumb-168 :thumb-169 :pointer-1-e70 :pointer-1-f71 :thumb-2-e72 :thumb-2-f73 :middle-1-e74 :middle-1-f75 :pointer-3-f76 :pointer-3-e77 :middle-2-e78 :middle-2-f79 :middle-3-f80 :middle-3-e81 :pinky-2-e82 :pinky-2-f83 :pinky-3-f84 :pinky-3-e85 :ring-3-e86 :ring-3-f87 :ring-2-f88 :ring-2-e89 :ring-1-e90 :ring-1-f91 :thumb-1-e92 :thumb-1-f93 :pinky-1-f94 :pinky-1-e])96 (def full 9001)97 ;; the systax here is [keyframe body-part force]98 (def wiggle-each-finger-tip99 [[300 :pinky-3-f 50]100 [320 :pinky-2-f 80]101 [340 :pinky-1-f 100]103 [310 :ring-3-f 100]104 [330 :ring-2-f 120]105 [350 :ring-1-f 140]107 [330 :middle-3-f 120]108 [340 :middle-2-f 120]109 [360 :middle-1-f 30]111 [350 :pointer-3-f 120]112 [360 :pointer-2-f 120]113 [380 :pointer-1-f 30]115 [800 :pinky-3-f 0]116 [800 :pinky-2-f 0]117 [800 :pinky-1-f 0]119 [800 :ring-3-f 0]120 [800 :ring-2-f 0]121 [800 :ring-1-f 0]123 [800 :middle-3-f 0]124 [800 :middle-2-f 0]125 [800 :middle-1-f 0]127 [800 :pointer-3-f 0]128 [800 :pointer-2-f 0]129 [800 :pointer-1-f 0]132 [800 :pinky-3-e 50]133 [800 :pinky-2-e 80]134 [800 :pinky-1-e 100]136 [800 :ring-3-e 100]137 [800 :ring-2-e 120]138 [800 :ring-1-e 140]140 [800 :middle-3-e 120]141 [800 :middle-2-e 120]142 [800 :middle-1-e 30]144 [800 :pointer-3-e 120]145 [800 :pointer-2-e 120]146 [800 :pointer-1-e 30]148 [870 :pinky-3-e 0]149 [870 :pinky-2-e 0]150 [870 :pinky-1-e 0]152 [870 :ring-3-e 0]153 [870 :ring-2-e 0]154 [870 :ring-1-e 0]156 [870 :middle-3-e 0]157 [870 :middle-2-e 0]158 [870 :middle-1-e 0]160 [870 :pointer-3-e 0]161 [870 :pointer-2-e 0]162 [870 :pointer-1-e 0]164 [1500 :pointer-1-f full]165 [1500 :pointer-2-f full]166 [1500 :pointer-3-f full]168 [1500 :middle-1-f full]169 [1500 :middle-2-f full]170 [1500 :middle-3-f full]172 [1510 :pointer-1-f 0]173 [1510 :pointer-2-f 0]174 [1510 :pointer-3-f 0]176 [1510 :middle-1-f 0]177 [1510 :middle-2-f 0]178 [1510 :middle-3-f 0]179 ])181 (defn gen-summon-ball [debug?]182 (let [wait (atom 1100)]183 (fn [world]184 (if (= 0 (swap! wait dec))185 (let [brick186 (box 0.8 0.8 0.8 :mass 0.05187 :position (Vector3f. -0.5 0 0.5)188 :color (ColorRGBA/Red))189 bell (AudioNode. (asset-manager)190 "Sounds/pure.wav" false)]191 (.play bell)192 (if debug?193 (.addControl194 brick195 (proxy [AbstractControl] []196 (controlUpdate [tpf]197 (println-repl (.getWorldTranslation brick)))198 (controlRender [_ _]))))199 (add-element world brick))))))202 (def control-list203 [204 0 ;;pointer-21 #<Vector3f (0.99999994, 0.0, 0.0)>205 0 ;;pointer-21 #<Vector3f (-0.99999994, 0.0, 0.0)>206 0 ;;thumb-11 #<Vector3f (-0.8802276, -0.39781287, -0.25873658)>207 0 ;;thumb-11 #<Vector3f (0.8485723, 0.46149826, 0.2587364)>208 0 ;;pointer-11 #<Vector3f (0.99999994, 0.0, 0.0)>209 0 ;;pointer-11 #<Vector3f (-0.99999994, 0.0, 0.0)>210 0 ;;thumb-2.0011 #<Vector3f (-0.71705645, -0.44753736, -0.5343599)>211 0 ;;thumb-2.0011 #<Vector3f (-0.10567085, 0.83862597, 0.53435963)>212 0 ;;middle-11 #<Vector3f (0.99999994, 0.0, 0.0)>213 0 ;;middle-11 #<Vector3f (-0.99999994, 0.0, 0.0)>214 0 ;;pointer-31 #<Vector3f (-0.99999994, 0.0, 0.0)>215 0 ;;pointer-31 #<Vector3f (0.99999994, 0.0, 0.0)>216 0 ;;middle-21 #<Vector3f (0.99999994, 0.0, 0.0)>217 0 ;;middle-21 #<Vector3f (-0.99999994, 0.0, 0.0)>218 0 ;;middle-31 #<Vector3f (-0.99999994, 0.0, 0.0)>219 0 ;;middle-31 #<Vector3f (0.99999994, 0.0, 0.0)>220 0 ;;pinky-21 #<Vector3f (0.99999994, 0.0, 0.0)>221 0 ;;pinky-21 #<Vector3f (-0.99999994, 0.0, 0.0)>222 0 ;;pinky-31 #<Vector3f (-1, 0.0, 0.0)>223 0 ;;pinky-31 #<Vector3f (1.0, 0.0, 0.0)>224 0 ;;ring-31 #<Vector3f (0.99999994, 0.0, 0.0)>225 0 ;;ring-31 #<Vector3f (-0.99999994, 0.0, 0.0)>226 0 ;;ring-21 #<Vector3f (-0.99999994, 0.0, 0.0)>227 0 ;;ring-21 #<Vector3f (0.99999994, 0.0, 0.0)>228 0 ;;ring-11 #<Vector3f (0.99999994, 0.0, 0.0)>229 0 ;;ring-11 #<Vector3f (-0.99999994, 0.0, 0.0)>230 0 ;;thumb-11 #<Vector3f (-0.43154645, 0.7302033, 0.5296894)>231 0 ;;thumb-11 #<Vector3f (-0.8032993, -0.2722854, -0.5296895)>232 0 ;;pinky-11 #<Vector3f (-0.99999994, 0.0, 0.0)>233 0 ;;pinky-11 #<Vector3f (0.99999994, 0.0, 0.0)>234 ])236 (import com.aurellem.capture.Capture)238 (defn test-everything!239 ([] (test-everything! false))240 ([record?]241 (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false)243 base (File. "/home/r/proj/cortex/render/hand")246 creature (doto (load-blender-model hand)247 (body!))249 summon-ball (gen-summon-ball false)250 ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;;251 touch (touch! creature)252 touch-display (view-touch)254 vision (vision! creature)255 vision-display (view-vision)257 hearing (hearing! creature)258 hearing-display (view-hearing)260 prop (proprioception! creature)261 prop-display (view-proprioception)263 control-script (motor-control-program264 muscle-positions wiggle-each-finger-tip)265 muscles (movement! creature)266 muscle-display (view-movement)267 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;269 fix-display (gen-fix-display)]270 (world271 (nodify [creature272 (box 10 2 10 :position (Vector3f. 0 -9 0)273 :color ColorRGBA/Gray :mass 0)274 me])275 standard-debug-controls277 (fn [world]278 (.setTimer world (RatchetTimer. 60))279 (position-camera280 world (Vector3f. -0.13217318, 5.816415, -5.3089414)281 (Quaternion. 0.55685693, 0.0042774677, -0.0028673497, 0.83059245))283 (light-up-everything world)284 (enable-debug world)285 (add-camera! world286 (add-eye! creature287 (.getChild288 (.getChild creature "eyes") "eye"))289 (comp (view-image) BufferedImage!))291 (if record?292 (Capture/captureVideo293 world (File. base "main")))294 (if record?295 (Capture/captureAudio296 world (File. base "main.wav"))))297 (fn [world tpf]298 (prop-display299 (prop)300 (if record? (File. base "proprio")))301 (touch-display302 (map #(% (.getRootNode world)) touch)303 (if record? (File. base "touch")))304 (vision-display305 (map #(% world) vision)306 (if record? (File. base "vision")))307 (hearing-display308 (map #(% world) hearing)309 (if record? (File. base "hearing")))310 (muscle-display311 (control-script muscles)312 (if record? (File. base "muscle")))314 (summon-ball world)316 (.setLocalTranslation me (.getLocation (.getCamera world)))317 (fix-display world))))))320 (comment321 ;; list of touch targets322 0 middle-11323 1 middle-21324 2 middle-31325 3 pinky-11326 4 pinky-21327 5 pinky-31328 6 pointer-11329 7 pointer-21330 8 pointer-31331 9 ring-11332 10 ring-21333 11 ring-31334 12 thumb-11335 13 thumb-2.0011338 ;; list of vision targets339 0 :all340 1 :green341 2 :blue342 3 :red344 ;; list of proprio targets345 0 middle-11 -> middle-21346 1 middle-21 -> middle-31347 2 thumb-11 -> thumb-2.0011348 3 pointer-11 -> pointer-21349 4 pointer-21 -> pointer-31350 5 ring-21 -> ring-31351 6 ring-11 -> ring-21352 7 pinky-21 -> pinky-31353 8 pinky-11 -> pinky-21354 9 middle-11 -> palm1355 10 pinky-11 -> palm1356 11 palm1 -> pointer-11357 12 palm1 -> ring-11358 13 palm1 -> thumb-11361 ;; list of muscle targets362 0 :pointer-2-e363 1 :pointer-2-f364 2 :thumb-1365 3 :thumb-1366 4 :pointer-1-e367 5 :pointer-1-f368 6 :thumb-2-e369 7 :thumb-2-f370 8 :middle-1-e371 9 :middle-1-f372 10 :pointer-3-f373 11 :pointer-3-e374 12 :middle-2-e375 13 :middle-2-f376 14 :middle-3-f377 15 :middle-3-e378 16 :pinky-2-e379 17 :pinky-2-f380 18 :pinky-3-f381 19 :pinky-3-e382 20 :ring-3-e383 21 :ring-3-f384 22 :ring-2-f385 23 :ring-2-e386 24 :ring-1-e387 25 :ring-1-f388 26 :thumb-1-e389 27 :thumb-1-f390 28 :pinky-1-f391 29 :pinky-1-e392 )396 ;; rotate touch 180398 ;; rotate mucles 90 counter-clockwise399 ;; scale muscles to 15x60401 finger width : 113402 finger height : 357404 thumb width : 113406 pinky --- 0,195407 ring --- 111,100408 middle --- 228,0409 pointer -- 436,96410 thumb --- 486,420414 within a finger (coordinates of top left corner (x,y)):416 tip-flexor : 0,7417 tip-extensor : 98,7418 tip : 18,0420 joint-2-3 : 32,79422 mid-flexor : 19,131423 mid-extensor : 80,131424 mid : 30,133426 joint-1-2 : 32,193428 base-flexor : 19,245429 base-extensor : 80,245430 base : 39,247432 joint-palm-1 : 32,307435 Thumb is the same as finger, except it has two more pieces437 extra-flexor-1 : 2,131438 extra-flexor-2 : 100,131440 ;; rotate entire thumb 45 degrees clockwise442 within vision443 gray -- 165,577444 green -- 278,577445 blue -- 165,682446 red -- 278,682448 entire hand : 809, 22449 main view : 78,202450 hearing : 784,819452 hand-size: 688x769455 total image size:456 1600x894458 (def base (File. "/home/r/proj/cortex/render/hand"))462 (defn prepare-muscle [muscle]463 ["(" muscle "-rotate" "90" "-scale" "15x60!" ")"])465 (defn prepare-touch [touch]466 ["(" touch "-rotate" "180" ")"])468 (defn generate-top-finger [tip-flexor tip-extensor tip469 joint-2-3470 mid-flexor mid-extensor mid471 joint-1-2]472 ["("473 "-size" "113x357" "xc:transparent"474 (prepare-muscle tip-flexor) "-geometry" "+0+7" "-composite"475 (prepare-muscle tip-extensor) "-geometry" "+98+7" "-composite"476 (prepare-touch tip) "-geometry" "+18+0" "-composite"478 joint-2-3 "-geometry" "+32+79" "-composite"480 (prepare-muscle mid-flexor) "-geometry" "+19+131" "-composite"481 (prepare-muscle mid-extensor) "-geometry" "+80+131" "-composite"482 (prepare-touch mid) "-geometry" "+39+133" "-composite"484 joint-1-2 "-geometry" "+32+193" "-composite"485 ")"])487 (defn generate-finger488 [tip-flexor tip-extensor tip489 joint-2-3490 mid-flexor mid-extensor mid491 joint-1-2492 base-flexor base-extensor base493 joint-palm-1]494 ["("495 "-size" "113x357" "xc:transparent"496 (generate-top-finger497 tip-flexor tip-extensor tip498 joint-2-3499 mid-flexor mid-extensor mid500 joint-1-2) "-geometry" "+0+0" "-composite"501 (prepare-muscle base-flexor) "-geometry" "+19+245" "-composite"502 (prepare-muscle base-extensor) "-geometry" "+80+245" "-composite"503 (prepare-touch base) "-geometry" "+39+247" "-composite"504 joint-palm-1 "-geometry" "+32+307" "-composite"505 ")"])507 (defn generate-thumb508 [tip-flexor tip-extensor tip509 joint-1-2510 mid-flexor mid-extensor mid-flexor-2 mid-extensor-2 mid511 joint-palm-1]512 ["("513 "-size" "113x357" "xc:transparent"514 (generate-top-finger515 tip-flexor tip-extensor tip516 joint-1-2517 mid-flexor mid-extensor mid518 joint-palm-1) "-geometry" "+0+0" "-composite"519 (prepare-muscle mid-flexor-2) "-geometry" "+2+131" "-composite"520 (prepare-muscle mid-extensor-2) "-geometry" "+100+131" "-composite"521 ")"])523 pinky --- 0,195524 ring --- 111,100525 middle --- 228,0526 pointer -- 436,96527 thumb --- 486,420530 (defn generate-hand531 [pinky-pieces532 ring-pieces533 middle-pieces534 pointer-pieces535 thumb-pieces]536 ["("537 "-size" "688x769" "xc:transparent"538 (apply generate-finger pinky-pieces)539 "-geometry" "+0+195" "-composite"540 (apply generate-finger ring-pieces)541 "-geometry" "+111+100" "-composite"542 (apply generate-finger middle-pieces)543 "-geometry" "+228+0" "-composite"544 "(" (apply generate-thumb thumb-pieces) "-background" "#00000000"545 "-rotate" "45" ")"546 "-geometry" "+300+420" "-composite"547 (apply generate-finger pointer-pieces)548 "-geometry" "+350+96" "-composite"549 ")"])551 (defn generate-vision552 [all green blue red]553 ["("554 "-size" "204x192" "xc:transparent"555 all "-geometry" "+0+0" "-composite"556 green "-geometry" "+113+0" "-composite"557 blue "-geometry" "+0+105" "-composite"558 red "-geometry" "+113+105" "-composite"559 ")"])563 (def test-muscle (File. base "muscle/0/0000000.png"))564 (def test-proprio (File. base "proprio/0/0000000.png"))565 (def test-tip (File. base "touch/2/0000000.png"))566 (def test-mid (File. base "touch/0/0000000.png"))567 (def test-vision (File. base "vision/0/0000000.png"))568 (def test-hearing (File. base "hearing/0/0000000.png"))569 (def test-main (File. base "main/0000000.png"))572 (def test-target (File. base "output.png"))574 (def background (File. base "background.png"))576 (use 'clojure.contrib.shell-out)577 (defn final-image [muscle proprio tip mid vision hearing main]578 (let [[muscle proprio tip mid vision hearing main] (map #(.getCanonicalPath %)579 [muscle proprio tip mid vision580 hearing main])581 finger-pieces [muscle muscle tip582 proprio583 muscle muscle mid584 proprio585 muscle muscle mid586 proprio]587 thumb-pieces [muscle muscle tip588 proprio589 muscle muscle muscle muscle mid590 proprio]]593 (apply594 sh595 (flatten596 ["convert"597 (.getCanonicalPath background)598 (generate-hand finger-pieces599 finger-pieces600 finger-pieces601 finger-pieces602 thumb-pieces)603 "-geometry" "+809+22" "-composite"605 (generate-vision vision vision vision vision)606 "-geometry" "+974+599" "-composite"608 hearing609 "-geometry" "+784+819" "-composite"611 main612 "-geometry" "+78+202" "-composite"614 (.getCanonicalPath test-target)]))))621 #+end_src623 #+results: integration624 : #'cortex.integration/test-everything!626 * COMMENT purgatory627 #+begin_src clojure628 (defn bullet-trans* []629 (let [obj-a (box 1.5 0.5 0.5 :color ColorRGBA/Red630 :position (Vector3f. 5 0 0)631 :mass 90)632 obj-b (sphere 0.5 :color ColorRGBA/Blue633 :position (Vector3f. -5 0 0)634 :mass 0)635 control-a (.getControl obj-a RigidBodyControl)636 control-b (.getControl obj-b RigidBodyControl)637 move-up? (atom nil)638 move-down? (atom nil)639 move-left? (atom nil)640 move-right? (atom nil)641 roll-left? (atom nil)642 roll-right? (atom nil)643 force 100644 swivel645 (.toRotationMatrix646 (doto (Quaternion.)647 (.fromAngleAxis (/ Math/PI 2)648 Vector3f/UNIT_X)))649 x-move650 (doto (Matrix3f.)651 (.fromStartEndVectors Vector3f/UNIT_X652 (.normalize (Vector3f. 1 1 0))))654 timer (atom 0)]655 (doto656 (ConeJoint.657 control-a control-b658 (Vector3f. -8 0 0)659 (Vector3f. 2 0 0)660 ;;swivel swivel661 ;;Matrix3f/IDENTITY Matrix3f/IDENTITY662 x-move Matrix3f/IDENTITY663 )664 (.setCollisionBetweenLinkedBodys false)665 (.setLimit (* 1 (/ Math/PI 4)) ;; twist666 (* 1 (/ Math/PI 4)) ;; swing span in X-Y plane667 (* 0 (/ Math/PI 4)))) ;; swing span in Y-Z plane668 (world (nodify669 [obj-a obj-b])670 (merge standard-debug-controls671 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))672 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))673 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))674 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))675 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))676 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})678 (fn [world]679 (enable-debug world)680 (set-gravity world Vector3f/ZERO)681 )683 (fn [world _]685 (if @move-up?686 (.applyForce control-a687 (Vector3f. force 0 0)688 (Vector3f. 0 0 0)))689 (if @move-down?690 (.applyForce control-a691 (Vector3f. (- force) 0 0)692 (Vector3f. 0 0 0)))693 (if @move-left?694 (.applyForce control-a695 (Vector3f. 0 force 0)696 (Vector3f. 0 0 0)))697 (if @move-right?698 (.applyForce control-a699 (Vector3f. 0 (- force) 0)700 (Vector3f. 0 0 0)))702 (if @roll-left?703 (.applyForce control-a704 (Vector3f. 0 0 force)705 (Vector3f. 0 0 0)))706 (if @roll-right?707 (.applyForce control-a708 (Vector3f. 0 0 (- force))709 (Vector3f. 0 0 0)))711 (if (zero? (rem (swap! timer inc) 100))712 (.attachChild713 (.getRootNode world)714 (sphere 0.05 :color ColorRGBA/Yellow715 :physical? false :position716 (.getWorldTranslation obj-a)))))717 )718 ))720 (defn test-joint [joint]721 (let [[origin top bottom floor] (world-setup joint)722 control (.getControl top RigidBodyControl)723 move-up? (atom false)724 move-down? (atom false)725 move-left? (atom false)726 move-right? (atom false)727 roll-left? (atom false)728 roll-right? (atom false)729 timer (atom 0)]731 (world732 (nodify [top bottom floor origin])733 (merge standard-debug-controls734 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))735 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))736 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))737 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))738 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))739 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})741 (fn [world]742 (light-up-everything world)743 (enable-debug world)744 (set-gravity world (Vector3f. 0 0 0))745 )747 (fn [world _]748 (if (zero? (rem (swap! timer inc) 100))749 (do750 ;; (println-repl @timer)751 (.attachChild (.getRootNode world)752 (sphere 0.05 :color ColorRGBA/Yellow753 :position (.getWorldTranslation top)754 :physical? false))755 (.attachChild (.getRootNode world)756 (sphere 0.05 :color ColorRGBA/LightGray757 :position (.getWorldTranslation bottom)758 :physical? false))))760 (if @move-up?761 (.applyTorque control762 (.mult (.getPhysicsRotation control)763 (Vector3f. 0 0 10))))764 (if @move-down?765 (.applyTorque control766 (.mult (.getPhysicsRotation control)767 (Vector3f. 0 0 -10))))768 (if @move-left?769 (.applyTorque control770 (.mult (.getPhysicsRotation control)771 (Vector3f. 0 10 0))))772 (if @move-right?773 (.applyTorque control774 (.mult (.getPhysicsRotation control)775 (Vector3f. 0 -10 0))))776 (if @roll-left?777 (.applyTorque control778 (.mult (.getPhysicsRotation control)779 (Vector3f. -1 0 0))))780 (if @roll-right?781 (.applyTorque control782 (.mult (.getPhysicsRotation control)783 (Vector3f. 1 0 0))))))))784 #+end_src787 * COMMENT generate source788 #+begin_src clojure :tangle ../src/cortex/integration.clj789 <<integration>>790 #+end_src