# HG changeset patch # User Robert McIntyre # Date 1327905252 25200 # Node ID 4b38355ad6e3de921811bc5ebf9f27eaefe42991 # Parent bc49d452c42a73592bb1db93dad6908a389ca486 modifications to docstrings by dylan diff -r bc49d452c42a -r 4b38355ad6e3 org/test-creature.org --- a/org/test-creature.org Thu Jan 26 12:59:22 2012 -0700 +++ b/org/test-creature.org Sun Jan 29 23:34:12 2012 -0700 @@ -553,8 +553,11 @@ (take 3 points)))) (defn convex-bounds - "Dimensions of the smallest integer bounding square of the list of - 2D verticies in the form: [x y width height]." + ;;dylan + "Returns the smallest square containing the given +vertices, as a vector of integers [left top width height]." + ;; "Dimensions of the smallest integer bounding square of the list of + ;; 2D verticies in the form: [x y width height]." [uv-verts] (let [xs (map first uv-verts) ys (map second uv-verts) @@ -565,8 +568,10 @@ [x0 y0 (- x1 x0) (- y1 y0)])) (defn sensors-in-triangle - "Find the locations of the touch sensors within a triangle in both - UV and gemoetry relative coordinates." + ;;dylan + "Locate the touch sensors in the triangle, returning a map of their UV and geometry-relative coordinates." + ;;"Find the locations of the touch sensors within a triangle in both + ;; UV and gemoetry relative coordinates." [image mesh tri-index] (let [width (.getWidth image) height (.getHeight image) @@ -688,8 +693,10 @@ (apply max (map second dimensions))])) (defn creature-eyes - "The eye nodes which are children of the \"eyes\" node in the - creature." + ;;dylan + "Return the children of the creature's \"eyes\" node." + ;;"The eye nodes which are children of the \"eyes\" node in the + ;;creature." [#^Node creature] (if-let [eye-node (.getChild creature "eyes")] (seq (.getChildren eye-node)) @@ -742,15 +749,18 @@ ;; incommong sound data, making it available to each sensor function. (defn creature-ears - "The ear nodes which are children of the \"ears\" node in the - creature." + "Return the children of the creature's \"ears\" node." + ;;dylan + ;;"The ear nodes which are children of the \"ears\" node in the + ;;creature." [#^Node creature] (if-let [ear-node (.getChild creature "ears")] (seq (.getChildren ear-node)) (do (println-repl "could not find ears node") []))) (defn closest-node - "The closest object in creature to the given node." + "Return the object in creature which is closest to the given node." + ;;dylan"The closest object in creature to the given node." [#^Node creature #^Node eye] (loop [radius (float 0.01)] (let [results (CollisionResults.)] @@ -763,6 +773,8 @@ (.getGeometry target) (recur (float (* 2 radius))))))) +;;dylan (defn follow-sense, adjoin-sense, attach-stimuli, +;;anchor-qualia, augment-organ, with-organ (defn bind-sense "Bind the sense to the Spatial such that it will maintain its current position relative to the Spatial no matter how the spatial @@ -910,7 +922,21 @@ [[][]] (for [eye (creature-eyes creature)] (enable-vision creature eye)))) - + + + + + +;; lower level --- nodes +;; closest-node "parse/compile-x" -> makes organ, which is spatial, fn pair + +;; higher level -- organs +;; + +;; higher level --- sense/effector +;; these are the functions that provide world i/o, chinese-room style + + (defn blender-creature "Return a creature with all joints in place." @@ -997,7 +1023,7 @@ hearing-windows (map (fn [_] (debug-hearing-window 50)) hearing-senses) bell (AudioNode. (asset-manager) - "Sounds/ear-and-eye.wav" false) + "Sounds/pure.wav" false) ;; dream ]