changeset 14:3aa1ee6c6308

touch-debug partially works
author Robert McIntyre <rlm@mit.edu>
date Sun, 23 Oct 2011 11:30:42 -0700
parents 0eb2eac53361
children c32f3eb9fdeb
files org/skin.org
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/org/skin.org	Sun Oct 23 11:22:06 2011 -0700
     1.2 +++ b/org/skin.org	Sun Oct 23 11:30:42 2011 -0700
     1.3 @@ -113,10 +113,16 @@
     1.4  
     1.5  (defn collision-debug [node result]
     1.6    (println-repl "contact point: " (.getContactPoint result))
     1.7 +
     1.8 +
     1.9    )
    1.10  
    1.11 -(defn update-ray-debug [node ray]
    1.12 -  (.setLocalTranslation (.getChild node 1) (.getOrigin ray)))
    1.13 +(defn update-ray-debug [node ray contacts]
    1.14 +  (let [origin (.getChild node 0)]
    1.15 +    (.setLocalTranslation origin (.getOrigin ray))
    1.16 +    (.setColor (.getMaterial origin) "Color" (contact-color contacts))))
    1.17 +
    1.18 +  
    1.19  
    1.20  
    1.21  (defn init-node
    1.22 @@ -129,8 +135,10 @@
    1.23           (.attachChild
    1.24            debug-node 
    1.25            (doto (Node.)
    1.26 -            (.attachChild (ray-debug ray ColorRGBA/Gray))
    1.27 -            (.attachChild (ray-origin-debug ray ColorRGBA/Gray))))))))
    1.28 +            (.attachChild (ray-origin-debug ray ColorRGBA/Gray))
    1.29 +            ;;(.attachChild (ray-debug ray ColorRGBA/Gray))
    1.30 +            ))))))
    1.31 +
    1.32  
    1.33  
    1.34  (defn manage-ray-debug-node [debug-node geom touch-data limit]
    1.35 @@ -139,7 +147,8 @@
    1.36        (init-node debug-node rays))
    1.37      (dorun 
    1.38       (for [n (range (count touch-data))]
    1.39 -       (update-ray-debug (.getChild debug-node n) (nth rays n))))))
    1.40 +       (update-ray-debug
    1.41 +        (.getChild debug-node n) (nth rays n) (nth touch-data n))))))
    1.42  
    1.43  
    1.44  (defn touch-percieve [limit geom node]
    1.45 @@ -224,8 +233,8 @@
    1.46  
    1.47  (defn test-skin []
    1.48    (let [b
    1.49 -	(transparent-box)
    1.50 -	;;(transparent-sphere)
    1.51 +	;;(transparent-box)
    1.52 +	(transparent-sphere)
    1.53          ;;(sphere)
    1.54  	f (transparent-floor)
    1.55  	;;controls