diff org/sense.org @ 283:23aadf376e9d

upgraded to latest jMonkeyEngine, streamlined tests
author Robert McIntyre <rlm@mit.edu>
date Wed, 15 Feb 2012 16:56:01 -0700
parents c39b8b29a79e
children 7e7f8d6d9ec5
line wrap: on
line diff
     1.1 --- a/org/sense.org	Wed Feb 15 14:09:20 2012 -0700
     1.2 +++ b/org/sense.org	Wed Feb 15 16:56:01 2012 -0700
     1.3 @@ -448,32 +448,35 @@
     1.4  (defn test-bind-sense
     1.5    "Show a camera that stays in the same relative position to a blue
     1.6    cube."
     1.7 -  []
     1.8 -  (let [eye-pos (Vector3f. 0 30 0)
     1.9 -        rock (box 1 1 1 :color ColorRGBA/Blue
    1.10 -                  :position (Vector3f. 0 10 0)
    1.11 -                  :mass 30)
    1.12 -        table (box 3 1 10 :color ColorRGBA/Gray :mass 0
    1.13 -                   :position (Vector3f. 0 -3 0))]
    1.14 -    (world
    1.15 -     (nodify [rock table])
    1.16 -     standard-debug-controls
    1.17 -     (fn init [world]
    1.18 -       (let [cam (doto (.clone (.getCamera world))
    1.19 -                   (.setLocation eye-pos)
    1.20 -                   (.lookAt Vector3f/ZERO
    1.21 -                            Vector3f/UNIT_X))]
    1.22 -         (bind-sense rock cam)
    1.23 -         (.setTimer world (RatchetTimer. 60))
    1.24 -         (Capture/captureVideo
    1.25 -          world (File. "/home/r/proj/cortex/render/bind-sense0"))
    1.26 -         (add-camera!
    1.27 -          world cam
    1.28 -          (comp (view-image
    1.29 -                 (File. "/home/r/proj/cortex/render/bind-sense1"))
    1.30 -                BufferedImage!))
    1.31 -         (add-camera! world (.getCamera world) no-op)))
    1.32 -     no-op)))
    1.33 +  ([] (test-bind-sense false))
    1.34 +  ([record?]
    1.35 +     (let [eye-pos (Vector3f. 0 30 0)
    1.36 +           rock (box 1 1 1 :color ColorRGBA/Blue
    1.37 +                     :position (Vector3f. 0 10 0)
    1.38 +                     :mass 30)
    1.39 +           table (box 3 1 10 :color ColorRGBA/Gray :mass 0
    1.40 +                      :position (Vector3f. 0 -3 0))]
    1.41 +       (world
    1.42 +        (nodify [rock table])
    1.43 +        standard-debug-controls
    1.44 +        (fn init [world]
    1.45 +          (let [cam (doto (.clone (.getCamera world))
    1.46 +                      (.setLocation eye-pos)
    1.47 +                      (.lookAt Vector3f/ZERO
    1.48 +                               Vector3f/UNIT_X))]
    1.49 +            (bind-sense rock cam)
    1.50 +            (.setTimer world (RatchetTimer. 60))
    1.51 +            (if record?
    1.52 +              (Capture/captureVideo
    1.53 +               world (File. "/home/r/proj/cortex/render/bind-sense0")))
    1.54 +            (add-camera!
    1.55 +             world cam
    1.56 +             (comp (view-image
    1.57 +                    (if record?
    1.58 +                    (File. "/home/r/proj/cortex/render/bind-sense1")))
    1.59 +                   BufferedImage!))
    1.60 +            (add-camera! world (.getCamera world) no-op)))
    1.61 +        no-op))))
    1.62  #+end_src
    1.63  
    1.64  #+begin_html