# HG changeset patch # User Robert McIntyre # Date 1342974619 18000 # Node ID ef958c44563d5892dbecbe9f60f465e8805f5604 # Parent 83afb1fcc99911d19a60ed00479b6b73755bd0d2 created test script for new joint creature. diff -r 83afb1fcc999 -r ef958c44563d assets/Models/joint/joint.blend Binary file assets/Models/joint/joint.blend has changed diff -r 83afb1fcc999 -r ef958c44563d org/joint.org --- a/org/joint.org Sun Jul 22 11:18:47 2012 -0500 +++ b/org/joint.org Sun Jul 22 11:30:19 2012 -0500 @@ -2,7 +2,60 @@ * A self learning joint +#+name: load-creature +#+begin_src clojure +(in-ns 'cortex.joint) +(def joint "Models/joint/joint.blend") + +(defn load-creature [] + (load-blender-model joint)) + + +(defn test-creature [] + + (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false) + creature (doto (load-creature) (body!)) + + ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;; + touch (touch! creature) + touch-display (view-touch) + + ;;vision (vision! creature) + ;;vision-display (view-vision) + + ;;hearing (hearing! creature) + ;;hearing-display (view-hearing) + + prop (proprioception! creature) + prop-display (view-proprioception) + + muscles (movement! creature) + muscle-display (view-movement) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + fix-display (gen-fix-display) + + floor (box 10 2 10 :position (Vector3f. 0 -9 0) + :color ColorRGBA/Gray :mass 0) + + timer (RatchetTimer. 60) + ] + + + (world + (nodify [floor me creature]) + standard-debug-controls + (fn [world] + (.setTimer world timer) + ) + (fn [world tpf] + (fix-display world))))) + + + + +#+end_src @@ -13,7 +66,12 @@ #+name: joint-header #+begin_src clojure (ns cortex.joint - (:require cortex.import)) + (:require cortex.import) + (:use (cortex world util import body sense + hearing touch vision proprioception movement)) + (:import java.io.File) + (:import (com.aurellem.capture RatchetTimer IsoTimer))) + (cortex.import/mega-import-jme3) (rlm.rlm-commands/help) @@ -24,5 +82,6 @@ #+begin_src clojure :tangle ../src/cortex/joint.clj <> +<> #+end_src