# HG changeset patch # User Robert McIntyre # Date 1319394642 25200 # Node ID 3aa1ee6c6308b1a623ec9c4efc68d658c486f682 # Parent 0eb2eac5336183cd3d411ea078e304d2e39702f0 touch-debug partially works diff -r 0eb2eac53361 -r 3aa1ee6c6308 org/skin.org --- a/org/skin.org Sun Oct 23 11:22:06 2011 -0700 +++ b/org/skin.org Sun Oct 23 11:30:42 2011 -0700 @@ -113,10 +113,16 @@ (defn collision-debug [node result] (println-repl "contact point: " (.getContactPoint result)) + + ) -(defn update-ray-debug [node ray] - (.setLocalTranslation (.getChild node 1) (.getOrigin ray))) +(defn update-ray-debug [node ray contacts] + (let [origin (.getChild node 0)] + (.setLocalTranslation origin (.getOrigin ray)) + (.setColor (.getMaterial origin) "Color" (contact-color contacts)))) + + (defn init-node @@ -129,8 +135,10 @@ (.attachChild debug-node (doto (Node.) - (.attachChild (ray-debug ray ColorRGBA/Gray)) - (.attachChild (ray-origin-debug ray ColorRGBA/Gray)))))))) + (.attachChild (ray-origin-debug ray ColorRGBA/Gray)) + ;;(.attachChild (ray-debug ray ColorRGBA/Gray)) + )))))) + (defn manage-ray-debug-node [debug-node geom touch-data limit] @@ -139,7 +147,8 @@ (init-node debug-node rays)) (dorun (for [n (range (count touch-data))] - (update-ray-debug (.getChild debug-node n) (nth rays n)))))) + (update-ray-debug + (.getChild debug-node n) (nth rays n) (nth touch-data n)))))) (defn touch-percieve [limit geom node] @@ -224,8 +233,8 @@ (defn test-skin [] (let [b - (transparent-box) - ;;(transparent-sphere) + ;;(transparent-box) + (transparent-sphere) ;;(sphere) f (transparent-floor) ;;controls