comparison org/sense-util.org @ 156:e8df6e76c3e5

refactored touch
author Robert McIntyre <rlm@mit.edu>
date Fri, 03 Feb 2012 06:15:34 -0700
parents aaacf087504c
children c33a8e5fe7bc
comparison
equal deleted inserted replaced
155:95bf55614211 156:e8df6e76c3e5
159 [(- x min-x) 159 [(- x min-x)
160 (- y min-y)]) 160 (- y min-y)])
161 squeezed))] 161 squeezed))]
162 relocate))) 162 relocate)))
163 163
164 (defn world-to-local
165 "Convert the world coordinates into coordinates relative to the
166 object (i.e. local coordinates), taking into account the rotation
167 of object."
168 [#^Spatial object world-coordinate]
169 (.worldToLocal object world-coordinate nil))
170
171 (defn local-to-world
172 "Convert the local coordinates into coordinates into world relative
173 coordinates"
174 [#^Spatial object local-coordinate]
175 (.localToWorld object local-coordinate nil))
176
164 #+end_src 177 #+end_src
165 178
166 #+results: sense-util 179 #+results: sense-util
167 : #'cortex.sense/meta-data 180 : #'cortex.sense/meta-data
168 181