Mercurial > cortex
comparison org/skin.org @ 17:014b14d48092
fixed inacuraccy with touch implementation
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 23 Oct 2011 11:58:33 -0700 |
parents | d2e9f0d09475 |
children | 221052dac374 |
comparison
equal
deleted
inserted
replaced
16:d2e9f0d09475 | 17:014b14d48092 |
---|---|
144 (doall | 144 (doall |
145 (for [ray normals] | 145 (for [ray normals] |
146 (do | 146 (do |
147 (let [results (CollisionResults.)] | 147 (let [results (CollisionResults.)] |
148 (.collideWith node ray results) | 148 (.collideWith node ray results) |
149 (let [answer (count (filter #(not (= geom (.getGeometry %))) results)) | 149 (let [answer (set (filter #(not (= geom %)) |
150 (map #(.getGeometry %) results))) | |
150 ;;color (contact-color answer) | 151 ;;color (contact-color answer) |
151 ] | 152 ] |
152 ;;(dorun (map #(println-repl (.getName (.getGeometry %))) results)) | 153 (if (= 2 (count answer)) |
153 answer ))))))) | 154 (dorun (map #(println-repl (.getName %)) answer))) |
155 (count answer) ))))))) | |
154 | 156 |
155 (defn enable-debug [world] | 157 (defn enable-debug [world] |
156 (.enableDebug | 158 (.enableDebug |
157 (.getPhysicsSpace | 159 (.getPhysicsSpace |
158 (.getState | 160 (.getState |
213 (.setBlendMode RenderState$BlendMode/Alpha)) | 215 (.setBlendMode RenderState$BlendMode/Alpha)) |
214 (.setQueueBucket RenderQueue$Bucket/Transparent))) | 216 (.setQueueBucket RenderQueue$Bucket/Transparent))) |
215 | 217 |
216 (defn test-skin [] | 218 (defn test-skin [] |
217 (let [b | 219 (let [b |
218 ;;(transparent-box) | 220 (transparent-box) |
219 (transparent-sphere) | 221 ;;(transparent-sphere) |
220 ;;(sphere) | 222 ;;(sphere) |
221 f (transparent-floor) | 223 f (transparent-floor) |
222 ;;controls | 224 ;;controls |
223 ;;(make-touch-sphere b) | 225 ;;(make-touch-sphere b) |
224 ;;(make-touch b) | 226 ;;(make-touch b) |