Mercurial > cortex
view org/integration.org @ 299:47fe4f7b74b3
rendering video for the first time!
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 16 Feb 2012 21:14:28 -0700 |
parents | 85f3ff3e3f26 |
children | c78917fb0615 |
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 )394 (def base (File. "/home/r/proj/cortex/render/hand"))396 (defn prepare-muscle [muscle]397 ["(" muscle "-rotate" "90" "-scale" "15x60!" ")"])399 (defn prepare-touch [touch]400 ["(" touch "-rotate" "180" ")"])402 (defn generate-top-finger [tip-flexor tip-extensor tip403 joint-2-3404 mid-flexor mid-extensor mid405 joint-1-2]406 ["("407 "-size" "113x357" "xc:transparent"408 (prepare-muscle tip-flexor) "-geometry" "+0+7" "-composite"409 (prepare-muscle tip-extensor) "-geometry" "+98+7" "-composite"410 (prepare-touch tip) "-geometry" "+18+0" "-composite"412 joint-2-3 "-geometry" "+32+79" "-composite"414 (prepare-muscle mid-flexor) "-geometry" "+19+131" "-composite"415 (prepare-muscle mid-extensor) "-geometry" "+80+131" "-composite"416 (prepare-touch mid) "-geometry" "+39+133" "-composite"418 joint-1-2 "-geometry" "+32+193" "-composite"419 ")"])421 (defn file-names [#^File dir]422 (map #(.getCanonicalPath %) (next (sort (file-seq dir)))))424 (defn file-groups [& paths]425 (apply (partial map list )426 (map (comp file-names #(File. base %))427 paths)))430 (defn pinky []431 (file-groups432 "muscle/18"433 "muscle/19"434 "touch/5"435 "proprio/7"437 "muscle/17"438 "muscle/16"439 "touch/4"440 "proprio/8"442 "muscle/28"443 "muscle/29"444 "touch/3"445 "proprio/10"))447 (defn ring []448 (file-groups449 "muscle/21"450 "muscle/20"451 "touch/11"452 "proprio/5"454 "muscle/22"455 "muscle/23"456 "touch/10"457 "proprio/6"459 "muscle/25"460 "muscle/24"461 "touch/9"462 "proprio/12"))464 (defn middle []465 (file-groups466 "muscle/14"467 "muscle/15"468 "touch/2"469 "proprio/1"471 "muscle/12"472 "muscle/13"473 "touch/1"474 "proprio/0"476 "muscle/8"477 "muscle/9"478 "touch/0"479 "proprio/9"))481 (defn pointer []482 (file-groups483 "muscle/10"484 "muscle/11"485 "touch/8"486 "proprio/4"488 "muscle/1"489 "muscle/0"490 "touch/7"491 "proprio/3"493 "muscle/5"494 "muscle/4"495 "touch/6"496 "proprio/11"))498 (defn thumb []499 (file-groups500 "muscle/7"501 "muscle/6"502 "touch/13"503 "proprio/2"505 "muscle/27"506 "muscle/26"507 "muscle/3"508 "muscle/2"509 "touch/12"510 "proprio/13"))512 (defn generate-finger513 [tip-flexor tip-extensor tip514 joint-2-3515 mid-flexor mid-extensor mid516 joint-1-2517 base-flexor base-extensor base518 joint-palm-1]519 ["("520 "-size" "113x357" "xc:transparent"521 (generate-top-finger522 tip-flexor tip-extensor tip523 joint-2-3524 mid-flexor mid-extensor mid525 joint-1-2) "-geometry" "+0+0" "-composite"526 (prepare-muscle base-flexor) "-geometry" "+19+245" "-composite"527 (prepare-muscle base-extensor) "-geometry" "+80+245" "-composite"528 (prepare-touch base) "-geometry" "+39+247" "-composite"529 joint-palm-1 "-geometry" "+32+307" "-composite"530 ")"])532 (defn generate-thumb533 [tip-flexor tip-extensor tip534 joint-1-2535 mid-flexor mid-extensor mid-flexor-2 mid-extensor-2 mid536 joint-palm-1]537 ["("538 "-size" "113x357" "xc:transparent"539 (generate-top-finger540 tip-flexor tip-extensor tip541 joint-1-2542 mid-flexor mid-extensor mid543 joint-palm-1) "-geometry" "+0+0" "-composite"544 (prepare-muscle mid-flexor-2) "-geometry" "+2+131" "-composite"545 (prepare-muscle mid-extensor-2) "-geometry" "+100+131" "-composite"546 ")"])548 (defn generate-hand549 [pinky-pieces550 ring-pieces551 middle-pieces552 pointer-pieces553 thumb-pieces]554 ["("555 "-size" "688x769" "xc:transparent"556 (apply generate-finger pinky-pieces)557 "-geometry" "+0+195" "-composite"558 (apply generate-finger ring-pieces)559 "-geometry" "+111+100" "-composite"560 (apply generate-finger middle-pieces)561 "-geometry" "+228+0" "-composite"562 "(" (apply generate-thumb thumb-pieces) "-background" "#00000000"563 "-rotate" "45" ")"564 "-geometry" "+300+420" "-composite"565 (apply generate-finger pointer-pieces)566 "-geometry" "+350+96" "-composite"567 ")"])569 (defn generate-vision570 [all green blue red]571 ["("572 "-size" "204x192" "xc:transparent"573 all "-geometry" "+0+0" "-composite"574 green "-geometry" "+113+0" "-composite"575 blue "-geometry" "+0+105" "-composite"576 red "-geometry" "+113+105" "-composite"577 ")"])579 (def test-muscle (File. base "muscle/0/0000000.png"))580 (def test-proprio (File. base "proprio/0/0000000.png"))581 (def test-tip (File. base "touch/2/0000000.png"))582 (def test-mid (File. base "touch/0/0000000.png"))583 (def test-vision (File. base "vision/0/0000000.png"))584 (def test-hearing (File. base "hearing/0/0000000.png"))585 (def test-main (File. base "main/0000000.png"))587 (def test-target (File. base "output.png"))589 (def background (File. base "background.png"))591 (use 'clojure.contrib.shell-out)593 (defn vision []594 (file-groups595 "vision/0"596 "vision/1"597 "vision/2"598 "vision/3"))600 (defn hearing []601 (file-names (File. base "hearing/0")))603 (defn main []604 (file-names (File. base "main")))606 (defn targets []607 (map608 (comp #(.getCanonicalPath %)609 #(File. (str base "/out/" (format "%07d.png" %))))610 (range 0 (count (main)))))613 (defn final-image [main [all red green blue] hearing614 pinky ring middle pointer thumb target]615 (println target)616 (apply617 sh618 (flatten619 ["convert"620 (.getCanonicalPath background)622 (generate-hand pinky ring middle pointer thumb)623 "-geometry" "+809+22" "-composite"625 (generate-vision all red green blue)626 "-geometry" "+974+599" "-composite"628 hearing629 "-geometry" "+784+819" "-composite"631 main632 "-geometry" "+78+202" "-composite"634 target])))636 (defn convert-files []637 (dorun638 (pmap final-image639 (main)640 (vision)641 (hearing)642 (pinky)643 (ring)644 (middle)645 (pointer)646 (thumb)647 (targets))))648 #+end_src651 #+begin_src sh652 cd /home/r/proj/cortex/render/hand654 ffmpeg -r 60 -i out/%07d.png -i main.wav -b:a 128k \655 -b:v 9000k -c:a libvorbis -c:v libtheora hand.ogg656 #+end_src658 #+results: integration659 : #'cortex.integration/convert-files661 * COMMENT purgatory662 #+begin_src clojure663 (defn bullet-trans* []664 (let [obj-a (box 1.5 0.5 0.5 :color ColorRGBA/Red665 :position (Vector3f. 5 0 0)666 :mass 90)667 obj-b (sphere 0.5 :color ColorRGBA/Blue668 :position (Vector3f. -5 0 0)669 :mass 0)670 control-a (.getControl obj-a RigidBodyControl)671 control-b (.getControl obj-b RigidBodyControl)672 move-up? (atom nil)673 move-down? (atom nil)674 move-left? (atom nil)675 move-right? (atom nil)676 roll-left? (atom nil)677 roll-right? (atom nil)678 force 100679 swivel680 (.toRotationMatrix681 (doto (Quaternion.)682 (.fromAngleAxis (/ Math/PI 2)683 Vector3f/UNIT_X)))684 x-move685 (doto (Matrix3f.)686 (.fromStartEndVectors Vector3f/UNIT_X687 (.normalize (Vector3f. 1 1 0))))689 timer (atom 0)]690 (doto691 (ConeJoint.692 control-a control-b693 (Vector3f. -8 0 0)694 (Vector3f. 2 0 0)695 ;;swivel swivel696 ;;Matrix3f/IDENTITY Matrix3f/IDENTITY697 x-move Matrix3f/IDENTITY698 )699 (.setCollisionBetweenLinkedBodys false)700 (.setLimit (* 1 (/ Math/PI 4)) ;; twist701 (* 1 (/ Math/PI 4)) ;; swing span in X-Y plane702 (* 0 (/ Math/PI 4)))) ;; swing span in Y-Z plane703 (world (nodify704 [obj-a obj-b])705 (merge standard-debug-controls706 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))707 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))708 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))709 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))710 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))711 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})713 (fn [world]714 (enable-debug world)715 (set-gravity world Vector3f/ZERO)716 )718 (fn [world _]720 (if @move-up?721 (.applyForce control-a722 (Vector3f. force 0 0)723 (Vector3f. 0 0 0)))724 (if @move-down?725 (.applyForce control-a726 (Vector3f. (- force) 0 0)727 (Vector3f. 0 0 0)))728 (if @move-left?729 (.applyForce control-a730 (Vector3f. 0 force 0)731 (Vector3f. 0 0 0)))732 (if @move-right?733 (.applyForce control-a734 (Vector3f. 0 (- force) 0)735 (Vector3f. 0 0 0)))737 (if @roll-left?738 (.applyForce control-a739 (Vector3f. 0 0 force)740 (Vector3f. 0 0 0)))741 (if @roll-right?742 (.applyForce control-a743 (Vector3f. 0 0 (- force))744 (Vector3f. 0 0 0)))746 (if (zero? (rem (swap! timer inc) 100))747 (.attachChild748 (.getRootNode world)749 (sphere 0.05 :color ColorRGBA/Yellow750 :physical? false :position751 (.getWorldTranslation obj-a)))))752 )753 ))755 (defn test-joint [joint]756 (let [[origin top bottom floor] (world-setup joint)757 control (.getControl top RigidBodyControl)758 move-up? (atom false)759 move-down? (atom false)760 move-left? (atom false)761 move-right? (atom false)762 roll-left? (atom false)763 roll-right? (atom false)764 timer (atom 0)]766 (world767 (nodify [top bottom floor origin])768 (merge standard-debug-controls769 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))770 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))771 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))772 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))773 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))774 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})776 (fn [world]777 (light-up-everything world)778 (enable-debug world)779 (set-gravity world (Vector3f. 0 0 0))780 )782 (fn [world _]783 (if (zero? (rem (swap! timer inc) 100))784 (do785 ;; (println-repl @timer)786 (.attachChild (.getRootNode world)787 (sphere 0.05 :color ColorRGBA/Yellow788 :position (.getWorldTranslation top)789 :physical? false))790 (.attachChild (.getRootNode world)791 (sphere 0.05 :color ColorRGBA/LightGray792 :position (.getWorldTranslation bottom)793 :physical? false))))795 (if @move-up?796 (.applyTorque control797 (.mult (.getPhysicsRotation control)798 (Vector3f. 0 0 10))))799 (if @move-down?800 (.applyTorque control801 (.mult (.getPhysicsRotation control)802 (Vector3f. 0 0 -10))))803 (if @move-left?804 (.applyTorque control805 (.mult (.getPhysicsRotation control)806 (Vector3f. 0 10 0))))807 (if @move-right?808 (.applyTorque control809 (.mult (.getPhysicsRotation control)810 (Vector3f. 0 -10 0))))811 (if @roll-left?812 (.applyTorque control813 (.mult (.getPhysicsRotation control)814 (Vector3f. -1 0 0))))815 (if @roll-right?816 (.applyTorque control817 (.mult (.getPhysicsRotation control)818 (Vector3f. 1 0 0))))))))819 #+end_src822 * COMMENT generate source823 #+begin_src clojure :tangle ../src/cortex/integration.clj824 <<integration>>825 #+end_src