Mercurial > cortex
comparison org/hearing.org @ 169:94b79c191fc7
renamed some functions in vision.org
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 04 Feb 2012 04:23:32 -0700 |
parents | 9e6a30b8c99a |
children | facc2ef3fe5c |
comparison
equal
deleted
inserted
replaced
168:1c8e9d389ea4 | 169:94b79c191fc7 |
---|---|
807 (.mult (.subtract new-position @old-position) | 807 (.mult (.subtract new-position @old-position) |
808 (float (/ tpf)))) | 808 (float (/ tpf)))) |
809 (reset! old-position new-position))) | 809 (reset! old-position new-position))) |
810 (controlRender [_ _]))))) | 810 (controlRender [_ _]))))) |
811 | 811 |
812 (defn create-listener! | 812 (defn add-ear! |
813 "Create a Listener centered on the current position of 'ear | 813 "Create a Listener centered on the current position of 'ear |
814 which follows the closest physical node in 'creature and | 814 which follows the closest physical node in 'creature and |
815 sends sound data to 'continuation." | 815 sends sound data to 'continuation." |
816 [#^Application world #^Node creature #^Spatial ear continuation] | 816 [#^Application world #^Node creature #^Spatial ear continuation] |
817 (let [target (closest-node creature ear) | 817 (let [target (closest-node creature ear) |
831 [#^Node creature #^Spatial ear] | 831 [#^Node creature #^Spatial ear] |
832 (let [hearing-data (atom []) | 832 (let [hearing-data (atom []) |
833 register-listener! | 833 register-listener! |
834 (runonce | 834 (runonce |
835 (fn [#^Application world] | 835 (fn [#^Application world] |
836 (create-listener! | 836 (add-ear! |
837 world creature ear | 837 world creature ear |
838 (fn [data] | 838 (fn [data] |
839 (reset! hearing-data (vec data))))))] | 839 (reset! hearing-data (vec data))))))] |
840 (fn [#^Application world] | 840 (fn [#^Application world] |
841 (register-listener! world) | 841 (register-listener! world) |