rlm@58: #+title: The BODY!!! rlm@58: #+author: Robert McIntyre rlm@58: #+email: rlm@mit.edu rlm@58: #+description: Simulating a body (movement, touch, propioception) in jMonkeyEngine3. rlm@58: #+SETUPFILE: ../../aurellem/org/setup.org rlm@58: #+INCLUDE: ../../aurellem/org/level-0.org rlm@58: rlm@58: * Body rlm@58: rlm@58: #+srcname: body-main rlm@58: #+begin_src clojure rlm@58: (ns test.all rlm@58: (:require [test touch vision]) rlm@58: (:import com.jme3.app.state.AppState rlm@58: com.jme3.system.AppSettings)) rlm@58: rlm@58: (defn run-world rlm@58: "run the simulation and wait until it closes proprely" rlm@58: [world] rlm@58: (let [lock (promise)] rlm@58: (.enqueue rlm@58: world rlm@58: (partial rlm@58: (fn [world] rlm@58: (.attach rlm@58: (.getStateManager world) rlm@58: (proxy [AppState] [] rlm@58: (cleanup [] (deliver lock nil)) rlm@58: (initialize [_ _]) rlm@58: (isEnabled [] true) rlm@58: (setEnabled [_] ) rlm@58: (stateAttached [_]) rlm@58: (stateDetached [_]) rlm@58: (update [_]) rlm@58: (render [_]) rlm@58: (isInitialized [] true) rlm@58: (postRender [])))) rlm@58: world)) rlm@58: (.start world) rlm@58: (deref lock))) rlm@58: rlm@58: (defn test-all [] rlm@58: (println rlm@58: "***************\n" rlm@58: "Testing touch:\n" rlm@58: "you should see a ball which responds to the table\n" rlm@58: "and whatever balls hit it.\n") rlm@58: (run-world (test.touch/test-skin)) rlm@58: (println rlm@58: "***************\n" rlm@58: "Testing vision:\n" rlm@58: "You should see a rotating cube, and two windows,\n" rlm@58: "each displaying a different view of the cube.\n") rlm@58: (run-world (test.vision/test-two-eyes)) rlm@58: (println rlm@58: "***************\n" rlm@58: "Testing hearing:\n" rlm@58: "You should see a blue sphere flying around several\n" rlm@58: "cubes. As the sphere approaches each cube, it turns\n" rlm@58: "green.\n") rlm@58: (run-world rlm@58: (doto (com.aurellem.capture.examples.Advanced.) rlm@58: (.setSettings rlm@58: (doto (AppSettings. true) rlm@58: (.setAudioRenderer "Send"))) rlm@58: (.setShowSettings false) rlm@58: (.setPauseOnLostFocus false)))) rlm@58: #+end_src rlm@58: rlm@58: rlm@58: rlm@58: rlm@58: * COMMENT generate Source. rlm@58: #+begin_src clojure :tangle ../src/test/all.clj rlm@58: <> rlm@58: #+end_src rlm@58: rlm@58: