diff org/test-creature.org @ 185:cfb71209ddc6

moved touch-debug view to touch.org
author Robert McIntyre <rlm@mit.edu>
date Sat, 04 Feb 2012 09:33:13 -0700
parents f1b078375484
children 22548d48cc85
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Sat Feb 04 09:11:42 2012 -0700
     1.2 +++ b/org/test-creature.org	Sat Feb 04 09:33:13 2012 -0700
     1.3 @@ -110,29 +110,6 @@
     1.4  ;; these are the functions that provide world i/o, chinese-room style
     1.5  
     1.6  
     1.7 -
     1.8 -
     1.9 -
    1.10 -(defn gray-scale [num]
    1.11 -  (+ num
    1.12 -     (bit-shift-left num 8)
    1.13 -     (bit-shift-left num 16)))
    1.14 -
    1.15 -(defn debug-touch-window
    1.16 -  "creates function that offers a debug view of sensor data"
    1.17 -  []
    1.18 -  (let [vi (view-image)]
    1.19 -    (fn 
    1.20 -      [[coords sensor-data]]
    1.21 -      (let [image (points->image coords)]
    1.22 -        (dorun
    1.23 -         (for [i (range (count coords))]
    1.24 -           (.setRGB image ((coords i) 0) ((coords i) 1)
    1.25 -                    (gray-scale (sensor-data i)))))
    1.26 -
    1.27 -                   
    1.28 -        (vi image)))))
    1.29 -
    1.30  (defn debug-vision-window
    1.31    "creates function that offers a debug view of sensor data"
    1.32    []
    1.33 @@ -172,8 +149,8 @@
    1.34          creature (doto 
    1.35                       (load-blender-model thing)
    1.36                     (body!))
    1.37 -        touch-nerves (touch! creature)
    1.38 -        touch-debug-windows (map (fn [_] (debug-touch-window)) touch-nerves)
    1.39 +        touch (touch! creature)
    1.40 +        touch-view (view-touch)
    1.41          vision-data (vision! creature)
    1.42          vision-debug (map (fn [_] (debug-vision-window)) vision-data)
    1.43          me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
    1.44 @@ -245,9 +222,7 @@
    1.45            
    1.46            (prop-debug (prop))
    1.47            
    1.48 -          (dorun
    1.49 -           (map #(%1 (%2 (.getRootNode world)))
    1.50 -                touch-debug-windows touch-nerves))
    1.51 +          (touch-view (map #(% (.getRootNode world)) touch))
    1.52            
    1.53            (dorun
    1.54             (map #(%1 (%2 world))