Mercurial > cortex
diff org/touch.org @ 232:b7762699eeb5
completed basic touch test
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 11 Feb 2012 19:48:32 -0700 |
parents | e29dd0024a9e |
children | f27c9fd9134d |
line wrap: on
line diff
1.1 --- a/org/touch.org Sat Feb 11 19:32:21 2012 -0700 1.2 +++ b/org/touch.org Sat Feb 11 19:48:32 2012 -0700 1.3 @@ -436,6 +436,30 @@ 1.4 (:import (com.jme3.math Triangle Vector3f Vector2f Ray Matrix4f))) 1.5 #+end_src 1.6 1.7 +* Adding Touch to the Worm 1.8 + 1.9 +#+name: test-touch 1.10 +#+begin_src clojure 1.11 +(ns cortex.test.touch 1.12 + (:use (cortex world util sense body touch)) 1.13 + (:use cortex.test.body)) 1.14 + 1.15 +(cortex.import/mega-import-jme3) 1.16 + 1.17 +(defn test-touch [] 1.18 + (let [the-worm (doto (worm) (body!)) 1.19 + touch (touch! the-worm) 1.20 + touch-display (view-touch)] 1.21 + (world (nodify [the-worm (floor)]) 1.22 + standard-debug-controls 1.23 + 1.24 + (fn [world] 1.25 + (light-up-everything world)) 1.26 + 1.27 + (fn [world tpf] 1.28 + (touch-display (map #(% (.getRootNode world)) touch)))))) 1.29 + 1.30 +#+end_src 1.31 1.32 * Source Listing 1.33 * Next 1.34 @@ -455,7 +479,9 @@ 1.35 <<visualization>> 1.36 #+end_src 1.37 1.38 + 1.39 #+begin_src clojure :tangle ../src/cortex/test/touch.clj 1.40 +<<test-touch>> 1.41 #+end_src 1.42 1.43