diff 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
line wrap: on
line diff
     1.1 --- a/org/sense-util.org	Fri Feb 03 06:04:30 2012 -0700
     1.2 +++ b/org/sense-util.org	Fri Feb 03 06:15:34 2012 -0700
     1.3 @@ -161,6 +161,19 @@
     1.4                    squeezed))]
     1.5          relocate)))
     1.6  
     1.7 +(defn world-to-local
     1.8 +   "Convert the world coordinates into coordinates relative to the 
     1.9 +   object (i.e. local coordinates), taking into account the rotation
    1.10 +   of object."
    1.11 +   [#^Spatial object world-coordinate]
    1.12 +   (.worldToLocal object world-coordinate nil))
    1.13 +
    1.14 +(defn local-to-world
    1.15 +   "Convert the local coordinates into coordinates into world relative
    1.16 +    coordinates" 
    1.17 +   [#^Spatial object local-coordinate]
    1.18 +   (.localToWorld object local-coordinate nil))
    1.19 +
    1.20  #+end_src
    1.21  
    1.22  #+results: sense-util