comparison 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
comparison
equal deleted inserted replaced
231:e29dd0024a9e 232:b7762699eeb5
434 (:import com.jme3.collision.CollisionResults) 434 (:import com.jme3.collision.CollisionResults)
435 (:import com.jme3.scene.VertexBuffer$Type) 435 (:import com.jme3.scene.VertexBuffer$Type)
436 (:import (com.jme3.math Triangle Vector3f Vector2f Ray Matrix4f))) 436 (:import (com.jme3.math Triangle Vector3f Vector2f Ray Matrix4f)))
437 #+end_src 437 #+end_src
438 438
439 * Adding Touch to the Worm
440
441 #+name: test-touch
442 #+begin_src clojure
443 (ns cortex.test.touch
444 (:use (cortex world util sense body touch))
445 (:use cortex.test.body))
446
447 (cortex.import/mega-import-jme3)
448
449 (defn test-touch []
450 (let [the-worm (doto (worm) (body!))
451 touch (touch! the-worm)
452 touch-display (view-touch)]
453 (world (nodify [the-worm (floor)])
454 standard-debug-controls
455
456 (fn [world]
457 (light-up-everything world))
458
459 (fn [world tpf]
460 (touch-display (map #(% (.getRootNode world)) touch))))))
461
462 #+end_src
439 463
440 * Source Listing 464 * Source Listing
441 * Next 465 * Next
442 466
443 467
453 <<rays>> 477 <<rays>>
454 <<kernel>> 478 <<kernel>>
455 <<visualization>> 479 <<visualization>>
456 #+end_src 480 #+end_src
457 481
482
458 #+begin_src clojure :tangle ../src/cortex/test/touch.clj 483 #+begin_src clojure :tangle ../src/cortex/test/touch.clj
484 <<test-touch>>
459 #+end_src 485 #+end_src
460 486
461 487
462 488
463 489