Mercurial > cortex
comparison org/test-creature.org @ 124:90154bd674e9
going to work on proprioception
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 24 Jan 2012 18:12:14 -0700 |
parents | 91773e8ec50f |
children | 3d65633dd736 |
comparison
equal
deleted
inserted
replaced
123:91773e8ec50f | 124:90154bd674e9 |
---|---|
4 #+description: | 4 #+description: |
5 #+keywords: simulation, jMonkeyEngine3, clojure | 5 #+keywords: simulation, jMonkeyEngine3, clojure |
6 #+SETUPFILE: ../../aurellem/org/setup.org | 6 #+SETUPFILE: ../../aurellem/org/setup.org |
7 #+INCLUDE: ../../aurellem/org/level-0.org | 7 #+INCLUDE: ../../aurellem/org/level-0.org |
8 | 8 |
9 * objectives | 9 * ideas |
10 - [X] get an overall bitmap-like image for touch | 10 - [ ] directly change the UV-pixels to show sensor activation |
11 - [X] write code to visuliaze this bitmap | 11 - [ ] write an explination for why greyscale bitmaps for senses is appropiate |
12 - [ ] directly change the UV-pixels to show touch sensor activation | 12 - [ ] write tests for integration |
13 - [ ] write an explination for why b&w bitmaps for senses is appropiate | 13 - [ ] usertime/gametime HUD display |
14 - [ ] clean up touch code and write visulazation test | 14 - [ ] use sawfish to auto-tile sense windows |
15 - [ ] do the same for eyes | 15 - [ ] sawfish keybinding to automatically delete all sense windows |
16 - [ ] proprioception sensor map in the style of the other senses | |
17 - [ ] optional fourier view of sound | |
18 - [ ] enable greyscale bitmaps for touch | |
19 | |
16 | 20 |
17 * Intro | 21 * Intro |
18 So far, I've made the following senses -- | 22 So far, I've made the following senses -- |
19 - Vision | 23 - Vision |
20 - Hearing | 24 - Hearing |
777 [#^Application world #^Node creature #^Spatial ear continuation] | 781 [#^Application world #^Node creature #^Spatial ear continuation] |
778 (let [target (closest-node creature ear) | 782 (let [target (closest-node creature ear) |
779 lis (Listener.) | 783 lis (Listener.) |
780 audio-renderer (.getAudioRenderer world) | 784 audio-renderer (.getAudioRenderer world) |
781 sp (sound-processor continuation)] | 785 sp (sound-processor continuation)] |
782 (println-repl "audio-renderer is " audio-renderer) | |
783 (.setLocation lis (.getWorldTranslation ear)) | 786 (.setLocation lis (.getWorldTranslation ear)) |
784 (.setRotation lis (.getWorldRotation ear)) | 787 (.setRotation lis (.getWorldRotation ear)) |
785 (bind-sense target lis) | 788 (bind-sense target lis) |
786 (update-listener-velocity target lis) | 789 (update-listener-velocity target lis) |
787 (.addListener audio-renderer lis) | 790 (.addListener audio-renderer lis) |
801 scaled-data | 804 scaled-data |
802 (vec | 805 (vec |
803 (map | 806 (map |
804 #(rem (int (* 255 (/ (+ 1 %) 2))) 256) | 807 #(rem (int (* 255 (/ (+ 1 %) 2))) 256) |
805 data))] | 808 data))] |
806 (println-repl (take 10 scaled-data)) | |
807 [topology scaled-data])) | 809 [topology scaled-data])) |
808 ]])) | 810 ]])) |
809 | 811 |
810 (defn hearing | 812 (defn hearing |
811 [#^Node creature] | 813 [#^Node creature] |
960 vision-debug (map (fn [_] (debug-vision-window)) vision-data) | 962 vision-debug (map (fn [_] (debug-vision-window)) vision-data) |
961 me (sphere 0.5 :color ColorRGBA/Blue :physical? false) | 963 me (sphere 0.5 :color ColorRGBA/Blue :physical? false) |
962 [init-hearing-fns hearing-senses] (hearing creature) | 964 [init-hearing-fns hearing-senses] (hearing creature) |
963 hearing-windows (map (fn [_] (debug-hearing-window 50)) | 965 hearing-windows (map (fn [_] (debug-hearing-window 50)) |
964 hearing-senses) | 966 hearing-senses) |
965 bang (AudioNode. (asset-manager) | 967 bell (AudioNode. (asset-manager) |
966 "Sounds/dream.wav" false) | 968 "Sounds/ear-and-eye.wav" false) |
967 ;; dream | 969 ;; dream |
968 | 970 |
969 ] | 971 ] |
970 (world | 972 (world |
971 (nodify [creature | 973 (nodify [creature |
978 {"key-return" | 980 {"key-return" |
979 (fn [_ value] | 981 (fn [_ value] |
980 (if value | 982 (if value |
981 (do | 983 (do |
982 (println-repl "play-sound") | 984 (println-repl "play-sound") |
983 (.play bang))))}) | 985 (.play bell))))}) |
984 (fn [world] | 986 (fn [world] |
985 (light-up-everything world) | 987 (light-up-everything world) |
986 (enable-debug world) | 988 (enable-debug world) |
987 (dorun (map #(% world) init-vision-fns)) | 989 (dorun (map #(% world) init-vision-fns)) |
988 (dorun (map #(% world) init-hearing-fns)) | 990 (dorun (map #(% world) init-hearing-fns)) |