comparison org/skin.org @ 18:221052dac374

touch has been GREATLY improved
author Robert McIntyre <rlm@mit.edu>
date Sun, 23 Oct 2011 12:07:34 -0700
parents 014b14d48092
children 5a371057078f
comparison
equal deleted inserted replaced
17:014b14d48092 18:221052dac374
148 (.collideWith node ray results) 148 (.collideWith node ray results)
149 (let [answer (set (filter #(not (= geom %)) 149 (let [answer (set (filter #(not (= geom %))
150 (map #(.getGeometry %) results))) 150 (map #(.getGeometry %) results)))
151 ;;color (contact-color answer) 151 ;;color (contact-color answer)
152 ] 152 ]
153 (if (= 2 (count answer)) 153
154 (dorun (map #(println-repl (.getName %)) answer))) 154 ;;(dorun (map #(println-repl (.getName %)) answer))
155 (count answer) ))))))) 155 (count answer) )))))))
156 156
157 (defn enable-debug [world] 157 (defn enable-debug [world]
158 (.enableDebug 158 (.enableDebug
159 (.getPhysicsSpace 159 (.getPhysicsSpace
215 (.setBlendMode RenderState$BlendMode/Alpha)) 215 (.setBlendMode RenderState$BlendMode/Alpha))
216 (.setQueueBucket RenderQueue$Bucket/Transparent))) 216 (.setQueueBucket RenderQueue$Bucket/Transparent)))
217 217
218 (defn test-skin [] 218 (defn test-skin []
219 (let [b 219 (let [b
220 (transparent-box) 220 ;;(transparent-box)
221 ;;(transparent-sphere) 221 (transparent-sphere)
222 ;;(sphere) 222 ;;(sphere)
223 f (transparent-floor) 223 f (transparent-floor)
224 ;;controls 224 ;;controls
225 ;;(make-touch-sphere b) 225 ;;(make-touch-sphere b)
226 ;;(make-touch b) 226 ;;(make-touch b)
237 (fn [world] 237 (fn [world]
238 ;; (Capture/SimpleCaptureVideo 238 ;; (Capture/SimpleCaptureVideo
239 ;; world 239 ;; world
240 ;; (file-str "/home/r/proj/cortex/tmp/blob.avi")) 240 ;; (file-str "/home/r/proj/cortex/tmp/blob.avi"))
241 ;; (no-logging) 241 ;; (no-logging)
242 (enable-debug world) 242 ;;(enable-debug world)
243 ;; (set-accuracy world (/ 1 60)) 243 ;; (set-accuracy world (/ 1 60))
244 ) 244 )
245 245
246 (fn [& _] 246 (fn [& _]
247 (let [touch-data (touch-percieve 0.2 b node)] 247 (let [sensitivity 5
248 touch-data (touch-percieve sensitivity b node)]
248 ;;(println-repl touch-data) 249 ;;(println-repl touch-data)
249 (manage-ray-debug-node debug-node b touch-data 0.2)) 250 (manage-ray-debug-node debug-node b touch-data sensitivity)
251 )
250 (Thread/sleep 10) 252 (Thread/sleep 10)
251 ;;(touch-print controls) 253 ;;(touch-print controls)
252 ;;(color-touch controls) 254 ;;(color-touch controls)
253 )))) 255 ))))
254 256