comparison org/integration.org @ 285:decdbb24ef7c

adding touch to the hand
author Robert McIntyre <rlm@mit.edu>
date Thu, 16 Feb 2012 06:39:34 -0700
parents 2ad29b68ff22
children 76a5edd6507d
comparison
equal deleted inserted replaced
284:3dd13e6095e5 285:decdbb24ef7c
58 muscles (movement! creature) 58 muscles (movement! creature)
59 muscle-display (view-movement) 59 muscle-display (view-movement)
60 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 60 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
61 61
62 fix-display (gen-fix-display)] 62 fix-display (gen-fix-display)]
63 (apply 63 (world
64 world 64 (nodify [creature
65 (with-movement 65 (box 10 2 10 :position (Vector3f. 0 -9 0)
66 (.getChild creature "palm") 66 :color ColorRGBA/Gray :mass 0)
67 ["key-r" "key-t" 67 me])
68 "key-f" "key-g" 68 (merge standard-debug-controls
69 "key-v" "key-b"] 69 {"key-return"
70 [10 10 10 10 1 1] 70 (fn [_ value]
71 [(nodify [creature 71 (if value
72 (box 10 2 10 :position (Vector3f. 0 -9 0) 72 (.play bell)))
73 :color ColorRGBA/Gray :mass 0) 73 "key-h"
74 me]) 74 (fn [_ value]
75 (merge standard-debug-controls 75 (if value
76 {"key-return" 76 (swap! muscle-exertion (partial + 20))))
77 (fn [_ value] 77 "key-n"
78 (if value 78 (fn [_ value]
79 (do 79 (if value
80 (println-repl "play-sound") 80 (swap! muscle-exertion (fn [v] (- v 20)))))})
81 (.play bell)))) 81 (fn [world]
82 "key-h" 82 (.setTimer world (RatchetTimer. 60))
83 (fn [_ value] 83 (light-up-everything world)
84 (if value 84 (enable-debug world)
85 (swap! muscle-exertion (partial + 20)))) 85 (add-camera! world
86 "key-n" 86 (add-eye! creature
87 (fn [_ value] 87 (.getChild
88 (if value 88 (.getChild creature "eyes") "eye"))
89 (swap! muscle-exertion (fn [v] (- v 20)))))}) 89 (comp (view-image) BufferedImage!))
90 (fn [world] 90 (speed-up world))
91 (.setTimer world (RatchetTimer. 60)) 91 (fn [world tpf]
92 (light-up-everything world) 92 (prop-display (prop))
93 (enable-debug world) 93 (touch-display (map #(% (.getRootNode world)) touch))
94 (add-camera! world 94 (vision-display (map #(% world) vision))
95 (add-eye! creature 95 (hearing-display (map #(% world) hearing))
96 (.getChild 96 (muscle-display (map #(% @muscle-exertion) muscles))
97 (.getChild creature "eyes") "eye")) 97 (.setLocalTranslation me (.getLocation (.getCamera world)))
98 (comp (view-image) BufferedImage!)) 98 (fix-display world))))))
99 (speed-up world))
100 (fn [world tpf]
101 (prop-display (prop))
102 (touch-display (map #(% (.getRootNode world)) touch))
103 (vision-display (map #(% world) vision))
104 (hearing-display (map #(% world) hearing))
105 (muscle-display (map #(% @muscle-exertion) muscles))
106 (.setLocalTranslation me (.getLocation (.getCamera world)))
107 (fix-display world))])))))
108 #+end_src 99 #+end_src
109 100
110 #+results: integration 101 #+results: integration
111 : #'cortex.integration/test-everything! 102 : #'cortex.integration/test-everything!
112 103