# HG changeset patch # User Robert McIntyre # Date 1319393032 25200 # Node ID 22c6878a1bc0d4089548780d0356fba333a6a38e # Parent a149692d3d1fd3bea12cfd8a28aa133446c74283 going to great debug view of new raycasting touch diff -r a149692d3d1f -r 22c6878a1bc0 org/skin.org --- a/org/skin.org Sun Oct 23 10:48:41 2011 -0700 +++ b/org/skin.org Sun Oct 23 11:03:52 2011 -0700 @@ -107,10 +107,7 @@ (doto (Ray. (get-ray-origin geom tri) (get-ray-direction geom tri)) - - (.setLimit limit) - ) - ) + (.setLimit limit))) (triangles geom)))) @@ -118,9 +115,26 @@ (println-repl "contact point: " (.getContactPoint result)) ) +(def init-node + (fn [debug-node rays] + (.detachAllChildren debug-node) + (for [ray rays] + (.attachChild debug-node (ray-debug ray ColorRGBA/Gray)) + (.attachChild debug-node (ray-origin-debug ray ColorRGBA/Gray)) + + + +(defn manage-ray-debug-node [debug-node ray color] + + + + ) + + + (defn touch-percieve [limit geom node debug-node] (let [normals (normal-rays limit geom)] - (.detachAllChildren debug-node) + (doall (for [ray normals] (do @@ -130,9 +144,7 @@ ;;color (contact-color answer) ] ;;(dorun (map #(println-repl (.getName (.getGeometry %))) results)) - ;;(.attachChild debug-node (ray-debug ray color)) - ;;(.attachChild debug-node (ray-origin-debug ray color)) - + ;;(println-repl (.size results) "results for " ray) ;;(doall (map (partial collision-debug node) results)) @@ -210,11 +222,13 @@ ;;(make-touch-sphere b) ;;(make-touch b) debug-node (Node.) - node (doto (Node.) (.attachChild b) (.attachChild f) - (.attachChild debug-node))] + node (doto (Node.) (.attachChild b) (.attachChild f)) + root-node (doto (Node.) (.attachChild node) + (.attachChild debug-node)) + ] (world - node + root-node {"key-return" (fire-cannon-ball)} ;;no-op (fn [world]