Mercurial > cortex
changeset 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 |
files | assets/Models/test-creature/worm.blend org/touch.org |
diffstat | 2 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
1.1 Binary file assets/Models/test-creature/worm.blend has changed
2.1 --- a/org/touch.org Sat Feb 11 19:32:21 2012 -0700 2.2 +++ b/org/touch.org Sat Feb 11 19:48:32 2012 -0700 2.3 @@ -436,6 +436,30 @@ 2.4 (:import (com.jme3.math Triangle Vector3f Vector2f Ray Matrix4f))) 2.5 #+end_src 2.6 2.7 +* Adding Touch to the Worm 2.8 + 2.9 +#+name: test-touch 2.10 +#+begin_src clojure 2.11 +(ns cortex.test.touch 2.12 + (:use (cortex world util sense body touch)) 2.13 + (:use cortex.test.body)) 2.14 + 2.15 +(cortex.import/mega-import-jme3) 2.16 + 2.17 +(defn test-touch [] 2.18 + (let [the-worm (doto (worm) (body!)) 2.19 + touch (touch! the-worm) 2.20 + touch-display (view-touch)] 2.21 + (world (nodify [the-worm (floor)]) 2.22 + standard-debug-controls 2.23 + 2.24 + (fn [world] 2.25 + (light-up-everything world)) 2.26 + 2.27 + (fn [world tpf] 2.28 + (touch-display (map #(% (.getRootNode world)) touch)))))) 2.29 + 2.30 +#+end_src 2.31 2.32 * Source Listing 2.33 * Next 2.34 @@ -455,7 +479,9 @@ 2.35 <<visualization>> 2.36 #+end_src 2.37 2.38 + 2.39 #+begin_src clojure :tangle ../src/cortex/test/touch.clj 2.40 +<<test-touch>> 2.41 #+end_src 2.42 2.43