# HG changeset patch # User Robert McIntyre # Date 1326709155 25200 # Node ID c05d8d222166607baeae77230218af795e45c264 # Parent 92b857b6145d78112689129337409220b1ac0c28 ready to start touch UV maps with GIMP diff -r 92b857b6145d -r c05d8d222166 assets/Models/creature1/tip.png Binary file assets/Models/creature1/tip.png has changed diff -r 92b857b6145d -r c05d8d222166 assets/Models/creature1/tip.xcf Binary file assets/Models/creature1/tip.xcf has changed diff -r 92b857b6145d -r c05d8d222166 assets/Models/creature1/try-again.blend Binary file assets/Models/creature1/try-again.blend has changed diff -r 92b857b6145d -r c05d8d222166 assets/Models/creature1/worm-2-UV-layout.png Binary file assets/Models/creature1/worm-2-UV-layout.png has changed diff -r 92b857b6145d -r c05d8d222166 assets/Models/creature1/worm-2-UV-layout.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/assets/Models/creature1/worm-2-UV-layout.svg Mon Jan 16 03:19:15 2012 -0700 @@ -0,0 +1,8 @@ + + + +'try-again.blend', worm-2, (Blender 2.59 (sub 4)) + + diff -r 92b857b6145d -r c05d8d222166 org/test-creature.org --- a/org/test-creature.org Sun Jan 15 04:08:31 2012 -0700 +++ b/org/test-creature.org Mon Jan 16 03:19:15 2012 -0700 @@ -628,7 +628,9 @@ (defn enable-touch [#^Geometry geo] (let [feeler-coords (feeler-coordinates geo) tris (triangles geo) - limit 0.1] + limit 0.1 + ;;results (CollisionResults.) + ] (fn [node] (let [sensor-origins (map @@ -657,6 +659,8 @@ (if (> (count touch-objects) 0) 1 0))))))))))) + + (defn touch [#^Node pieces] (map enable-touch (filter #(isa? (class %) Geometry) @@ -704,12 +708,18 @@ ;;(com.aurellem.capture.Capture/captureVideo ;; world (file-str "/home/r/proj/ai-videos/hand")) (.setTimer world (RatchetTimer. 60)) - ;;(speed-up world) + (speed-up world) ;;(set-gravity world (Vector3f. 0 0 0)) ) (fn [world tpf] + ;;(dorun + ;; (map #(%1 %2) touch-nerves (repeat (.getRootNode world)))) + (dorun - (map #(%1 (%2 (.getRootNode world))) touch-debug-windows touch-nerves)) + (map #(%1 (%2 (.getRootNode world))) + touch-debug-windows touch-nerves)) + + ) ;;(let [timer (atom 0)] ;; (fn [_ _] @@ -718,10 +728,63 @@ ;; (println-repl (float (/ @timer 60)))))) ))) + + + + + + + + +;;; experiments in collisions + + + +(defn collision-test [] + (let [a-radius 1 + a-position (Vector3f. -0.25 3 0) + b-radius 1 + b-position (Vector3f. 0.25 3 0) + + + obj-a (box 1 1 1 :color ColorRGBA/Red + :position a-position + :physical? false) + obj-b (box 1 1 1 :color ColorRGBA/Blue + :position b-position + :physical? false) + node (nodify [obj-a obj-b]) + bounds-a (BoundingBox. a-position 1 1 1) + bounds-b (BoundingBox. b-position 1 1 1) + sim + (world node + {} + no-op + no-op) + + ] + (.setBound (.getMesh obj-a) bounds-a) + (.updateBound (.getMesh obj-a)) + + + (.setBound (.getMesh obj-b) bounds-b) + (.updateBound (.getMesh obj-b)) + + + + (let [cr (CollisionResults.)] + (.collideWith node bounds-a cr) + [cr sim]) + +)) + + + + #+end_src #+results: body-1 -: #'cortex.silly/tactile-coords +: #'cortex.silly/test-creature * COMMENT purgatory