diff 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
line wrap: on
line diff
     1.1 --- a/org/integration.org	Wed Feb 15 16:58:33 2012 -0700
     1.2 +++ b/org/integration.org	Thu Feb 16 06:39:34 2012 -0700
     1.3 @@ -60,51 +60,42 @@
     1.4          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     1.5  
     1.6          fix-display (gen-fix-display)]
     1.7 -    (apply
     1.8 -     world
     1.9 -     (with-movement
    1.10 -       (.getChild creature "palm")
    1.11 -       ["key-r" "key-t"
    1.12 -        "key-f" "key-g"
    1.13 -        "key-v" "key-b"]
    1.14 -       [10 10 10 10 1 1]
    1.15 -       [(nodify [creature
    1.16 -                 (box 10 2 10 :position (Vector3f. 0 -9 0)
    1.17 -                      :color ColorRGBA/Gray :mass 0)
    1.18 -                 me])
    1.19 -        (merge standard-debug-controls
    1.20 -               {"key-return"
    1.21 -                (fn [_ value]
    1.22 -                  (if value
    1.23 -                    (do
    1.24 -                      (println-repl "play-sound")
    1.25 -                      (.play bell))))
    1.26 -                "key-h"
    1.27 -                (fn [_ value]
    1.28 -                  (if value
    1.29 -                    (swap!  muscle-exertion (partial + 20))))
    1.30 -                "key-n"
    1.31 -                (fn [_ value]
    1.32 -                  (if value
    1.33 -                    (swap! muscle-exertion (fn [v] (- v 20)))))})
    1.34 -        (fn [world]
    1.35 -          (.setTimer world (RatchetTimer. 60))
    1.36 -          (light-up-everything world)
    1.37 -          (enable-debug world)
    1.38 -          (add-camera! world
    1.39 -                       (add-eye! creature
    1.40 -                                 (.getChild 
    1.41 -                                  (.getChild creature "eyes") "eye"))
    1.42 -                   (comp (view-image) BufferedImage!))
    1.43 -          (speed-up world))
    1.44 -        (fn [world tpf]
    1.45 -          (prop-display (prop))
    1.46 -          (touch-display (map #(% (.getRootNode world)) touch))
    1.47 -          (vision-display (map #(% world) vision))
    1.48 -          (hearing-display (map #(% world) hearing))
    1.49 -          (muscle-display (map #(% @muscle-exertion) muscles))
    1.50 -          (.setLocalTranslation me (.getLocation (.getCamera world)))
    1.51 -          (fix-display world))])))))
    1.52 +    (world
    1.53 +     (nodify [creature
    1.54 +              (box 10 2 10 :position (Vector3f. 0 -9 0)
    1.55 +                   :color ColorRGBA/Gray :mass 0)
    1.56 +              me])
    1.57 +     (merge standard-debug-controls
    1.58 +            {"key-return"
    1.59 +             (fn [_ value]
    1.60 +               (if value
    1.61 +                   (.play bell)))
    1.62 +             "key-h"
    1.63 +             (fn [_ value]
    1.64 +               (if value
    1.65 +                 (swap!  muscle-exertion (partial + 20))))
    1.66 +             "key-n"
    1.67 +             (fn [_ value]
    1.68 +               (if value
    1.69 +                 (swap! muscle-exertion (fn [v] (- v 20)))))})
    1.70 +     (fn [world]
    1.71 +       (.setTimer world (RatchetTimer. 60))
    1.72 +       (light-up-everything world)
    1.73 +       (enable-debug world)
    1.74 +       (add-camera! world
    1.75 +                    (add-eye! creature
    1.76 +                              (.getChild 
    1.77 +                               (.getChild creature "eyes") "eye"))
    1.78 +                    (comp (view-image) BufferedImage!))
    1.79 +       (speed-up world))
    1.80 +     (fn [world tpf]
    1.81 +       (prop-display (prop))
    1.82 +       (touch-display (map #(% (.getRootNode world)) touch))
    1.83 +       (vision-display (map #(% world) vision))
    1.84 +       (hearing-display (map #(% world) hearing))
    1.85 +       (muscle-display (map #(% @muscle-exertion) muscles))
    1.86 +       (.setLocalTranslation me (.getLocation (.getCamera world)))
    1.87 +       (fix-display world))))))
    1.88  #+end_src
    1.89  
    1.90  #+results: integration