# HG changeset patch # User Robert McIntyre # Date 1329014912 25200 # Node ID b7762699eeb59a809d359fd17166434b5c644957 # Parent e29dd0024a9e2956a5efc47946e18223968cf77c completed basic touch test diff -r e29dd0024a9e -r b7762699eeb5 assets/Models/test-creature/worm.blend Binary file assets/Models/test-creature/worm.blend has changed diff -r e29dd0024a9e -r b7762699eeb5 org/touch.org --- a/org/touch.org Sat Feb 11 19:32:21 2012 -0700 +++ b/org/touch.org Sat Feb 11 19:48:32 2012 -0700 @@ -436,6 +436,30 @@ (:import (com.jme3.math Triangle Vector3f Vector2f Ray Matrix4f))) #+end_src +* Adding Touch to the Worm + +#+name: test-touch +#+begin_src clojure +(ns cortex.test.touch + (:use (cortex world util sense body touch)) + (:use cortex.test.body)) + +(cortex.import/mega-import-jme3) + +(defn test-touch [] + (let [the-worm (doto (worm) (body!)) + touch (touch! the-worm) + touch-display (view-touch)] + (world (nodify [the-worm (floor)]) + standard-debug-controls + + (fn [world] + (light-up-everything world)) + + (fn [world tpf] + (touch-display (map #(% (.getRootNode world)) touch)))))) + +#+end_src * Source Listing * Next @@ -455,7 +479,9 @@ <> #+end_src + #+begin_src clojure :tangle ../src/cortex/test/touch.clj +<> #+end_src