Mercurial > cortex
changeset 128:4b38355ad6e3
modifications to docstrings by dylan
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 29 Jan 2012 23:34:12 -0700 |
parents | bc49d452c42a |
children | bab47091534e |
files | org/test-creature.org |
diffstat | 1 files changed, 37 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/org/test-creature.org Thu Jan 26 12:59:22 2012 -0700 1.2 +++ b/org/test-creature.org Sun Jan 29 23:34:12 2012 -0700 1.3 @@ -553,8 +553,11 @@ 1.4 (take 3 points)))) 1.5 1.6 (defn convex-bounds 1.7 - "Dimensions of the smallest integer bounding square of the list of 1.8 - 2D verticies in the form: [x y width height]." 1.9 + ;;dylan 1.10 + "Returns the smallest square containing the given 1.11 +vertices, as a vector of integers [left top width height]." 1.12 + ;; "Dimensions of the smallest integer bounding square of the list of 1.13 + ;; 2D verticies in the form: [x y width height]." 1.14 [uv-verts] 1.15 (let [xs (map first uv-verts) 1.16 ys (map second uv-verts) 1.17 @@ -565,8 +568,10 @@ 1.18 [x0 y0 (- x1 x0) (- y1 y0)])) 1.19 1.20 (defn sensors-in-triangle 1.21 - "Find the locations of the touch sensors within a triangle in both 1.22 - UV and gemoetry relative coordinates." 1.23 + ;;dylan 1.24 + "Locate the touch sensors in the triangle, returning a map of their UV and geometry-relative coordinates." 1.25 + ;;"Find the locations of the touch sensors within a triangle in both 1.26 + ;; UV and gemoetry relative coordinates." 1.27 [image mesh tri-index] 1.28 (let [width (.getWidth image) 1.29 height (.getHeight image) 1.30 @@ -688,8 +693,10 @@ 1.31 (apply max (map second dimensions))])) 1.32 1.33 (defn creature-eyes 1.34 - "The eye nodes which are children of the \"eyes\" node in the 1.35 - creature." 1.36 + ;;dylan 1.37 + "Return the children of the creature's \"eyes\" node." 1.38 + ;;"The eye nodes which are children of the \"eyes\" node in the 1.39 + ;;creature." 1.40 [#^Node creature] 1.41 (if-let [eye-node (.getChild creature "eyes")] 1.42 (seq (.getChildren eye-node)) 1.43 @@ -742,15 +749,18 @@ 1.44 ;; incommong sound data, making it available to each sensor function. 1.45 1.46 (defn creature-ears 1.47 - "The ear nodes which are children of the \"ears\" node in the 1.48 - creature." 1.49 + "Return the children of the creature's \"ears\" node." 1.50 + ;;dylan 1.51 + ;;"The ear nodes which are children of the \"ears\" node in the 1.52 + ;;creature." 1.53 [#^Node creature] 1.54 (if-let [ear-node (.getChild creature "ears")] 1.55 (seq (.getChildren ear-node)) 1.56 (do (println-repl "could not find ears node") []))) 1.57 1.58 (defn closest-node 1.59 - "The closest object in creature to the given node." 1.60 + "Return the object in creature which is closest to the given node." 1.61 + ;;dylan"The closest object in creature to the given node." 1.62 [#^Node creature #^Node eye] 1.63 (loop [radius (float 0.01)] 1.64 (let [results (CollisionResults.)] 1.65 @@ -763,6 +773,8 @@ 1.66 (.getGeometry target) 1.67 (recur (float (* 2 radius))))))) 1.68 1.69 +;;dylan (defn follow-sense, adjoin-sense, attach-stimuli, 1.70 +;;anchor-qualia, augment-organ, with-organ 1.71 (defn bind-sense 1.72 "Bind the sense to the Spatial such that it will maintain its 1.73 current position relative to the Spatial no matter how the spatial 1.74 @@ -910,7 +922,21 @@ 1.75 [[][]] 1.76 (for [eye (creature-eyes creature)] 1.77 (enable-vision creature eye)))) 1.78 - 1.79 + 1.80 + 1.81 + 1.82 + 1.83 + 1.84 +;; lower level --- nodes 1.85 +;; closest-node "parse/compile-x" -> makes organ, which is spatial, fn pair 1.86 + 1.87 +;; higher level -- organs 1.88 +;; 1.89 + 1.90 +;; higher level --- sense/effector 1.91 +;; these are the functions that provide world i/o, chinese-room style 1.92 + 1.93 + 1.94 1.95 (defn blender-creature 1.96 "Return a creature with all joints in place." 1.97 @@ -997,7 +1023,7 @@ 1.98 hearing-windows (map (fn [_] (debug-hearing-window 50)) 1.99 hearing-senses) 1.100 bell (AudioNode. (asset-manager) 1.101 - "Sounds/ear-and-eye.wav" false) 1.102 + "Sounds/pure.wav" false) 1.103 ;; dream 1.104 1.105 ]