Mercurial > cortex
view org/test.org @ 67:6f74d89fb8b3
got world working with updated jme system
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 08 Dec 2011 20:58:40 -0600 |
parents | 1381a6ebd08b |
children | 6cd5a034d855 |
line wrap: on
line source
1 #+title: Test Suite2 #+author: Robert McIntyre3 #+email: rlm@mit.edu4 #+description: Simulating a body (movement, touch, propioception) in jMonkeyEngine3.5 #+SETUPFILE: ../../aurellem/org/setup.org6 #+INCLUDE: ../../aurellem/org/level-0.org8 * Tests10 #+name: body-main11 #+begin_src clojure12 (ns test.all13 (:require [test touch vision])14 (:import com.jme3.app.state.AppState15 com.jme3.system.AppSettings))17 (defn run-world18 "run the simulation and wait until it closes proprely"19 [world]20 (let [lock (promise)]21 (.enqueue22 world23 (partial24 (fn [world]25 (.attach26 (.getStateManager world)27 (proxy [AppState] []28 (cleanup [] (deliver lock nil))29 (initialize [_ _])30 (isEnabled [] true)31 (setEnabled [_] )32 (stateAttached [_])33 (stateDetached [_])34 (update [_])35 (render [_])36 (isInitialized [] true)37 (postRender []))))38 world))39 (.start world)40 (deref lock)))42 (defn test-all []43 (println44 "***************\n"45 "Testing touch:\n"46 "you should see a ball which responds to the table\n"47 "and whatever balls hit it.\n")48 (run-world (test.touch/test-skin))49 (println50 "***************\n"51 "Testing vision:\n"52 "You should see a rotating cube, and two windows,\n"53 "each displaying a different view of the cube.\n")54 (run-world (test.vision/test-two-eyes))55 (println56 "***************\n"57 "Testing hearing:\n"58 "You should see a blue sphere flying around several\n"59 "cubes. As the sphere approaches each cube, it turns\n"60 "green.\n")61 (run-world62 (doto (com.aurellem.capture.examples.Advanced.)63 (.setSettings64 (doto (AppSettings. true)65 (.setAudioRenderer "Send")))66 (.setShowSettings false)67 (.setPauseOnLostFocus false))))68 #+end_src70 * COMMENT generate Source.71 #+begin_src clojure :tangle ../src/test/all.clj72 <<body-main>>73 #+end_src