Mercurial > cortex
comparison org/skin.org @ 16:d2e9f0d09475
remove useless function
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 23 Oct 2011 11:51:15 -0700 |
parents | c32f3eb9fdeb |
children | 014b14d48092 |
comparison
equal
deleted
inserted
replaced
15:c32f3eb9fdeb | 16:d2e9f0d09475 |
---|---|
108 (Ray. (get-ray-origin geom tri) | 108 (Ray. (get-ray-origin geom tri) |
109 (get-ray-direction geom tri)) | 109 (get-ray-direction geom tri)) |
110 (.setLimit limit))) | 110 (.setLimit limit))) |
111 (triangles geom)))) | 111 (triangles geom)))) |
112 | 112 |
113 | |
114 (defn collision-debug [node result] | |
115 (println-repl "contact point: " (.getContactPoint result)) | |
116 | |
117 | |
118 ) | |
119 | |
120 (defn update-ray-debug [node ray contacts] | 113 (defn update-ray-debug [node ray contacts] |
121 (let [origin (.getChild node 0)] | 114 (let [origin (.getChild node 0)] |
122 (.setLocalTranslation origin (.getOrigin ray)) | 115 (.setLocalTranslation origin (.getOrigin ray)) |
123 (.setColor (.getMaterial origin) "Color" (contact-color contacts)))) | 116 (.setColor (.getMaterial origin) "Color" (contact-color contacts)))) |
124 | |
125 | |
126 | |
127 | 117 |
128 (defn init-node | 118 (defn init-node |
129 [debug-node rays] | 119 [debug-node rays] |
130 (println-repl "Init touch debug node.") | 120 (println-repl "Init touch debug node.") |
131 (.detachAllChildren debug-node) | 121 (.detachAllChildren debug-node) |
137 (doto (Node.) | 127 (doto (Node.) |
138 (.attachChild (ray-origin-debug ray ColorRGBA/Gray)) | 128 (.attachChild (ray-origin-debug ray ColorRGBA/Gray)) |
139 ;;(.attachChild (ray-debug ray ColorRGBA/Gray)) | 129 ;;(.attachChild (ray-debug ray ColorRGBA/Gray)) |
140 )))))) | 130 )))))) |
141 | 131 |
142 | |
143 | |
144 (defn manage-ray-debug-node [debug-node geom touch-data limit] | 132 (defn manage-ray-debug-node [debug-node geom touch-data limit] |
145 (let [rays (normal-rays limit geom)] | 133 (let [rays (normal-rays limit geom)] |
146 (if (not= (count (.getChildren debug-node)) (count touch-data)) | 134 (if (not= (count (.getChildren debug-node)) (count touch-data)) |
147 (init-node debug-node rays)) | 135 (init-node debug-node rays)) |
148 (dorun | 136 (dorun |
149 (for [n (range (count touch-data))] | 137 (for [n (range (count touch-data))] |
150 (update-ray-debug | 138 (update-ray-debug |
151 (.getChild debug-node n) (nth rays n) (nth touch-data n)))))) | 139 (.getChild debug-node n) (nth rays n) (nth touch-data n)))))) |
152 | |
153 | 140 |
154 (defn touch-percieve [limit geom node] | 141 (defn touch-percieve [limit geom node] |
155 (let [normals (normal-rays limit geom)] | 142 (let [normals (normal-rays limit geom)] |
156 | 143 |
157 (doall | 144 (doall |
161 (.collideWith node ray results) | 148 (.collideWith node ray results) |
162 (let [answer (count (filter #(not (= geom (.getGeometry %))) results)) | 149 (let [answer (count (filter #(not (= geom (.getGeometry %))) results)) |
163 ;;color (contact-color answer) | 150 ;;color (contact-color answer) |
164 ] | 151 ] |
165 ;;(dorun (map #(println-repl (.getName (.getGeometry %))) results)) | 152 ;;(dorun (map #(println-repl (.getName (.getGeometry %))) results)) |
166 | 153 answer ))))))) |
167 | |
168 ;;(println-repl (.size results) "results for " ray) | |
169 ;;(doall (map (partial collision-debug node) results)) | |
170 answer | |
171 ))))))) | |
172 | 154 |
173 (defn enable-debug [world] | 155 (defn enable-debug [world] |
174 (.enableDebug | 156 (.enableDebug |
175 (.getPhysicsSpace | 157 (.getPhysicsSpace |
176 (.getState | 158 (.getState |