Mercurial > cortex
view org/integration.org @ 81:10f495560c59
correcting problem with joints
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 05 Jan 2012 21:31:34 -0700 |
parents | 257a86328adb |
children |
line wrap: on
line source
3 * TODO goals for today4 - [X] create falling cube in blender5 - [ ] record falling cube animation in blender6 - [ ] import falling cube in jMonkeyEngine7 - [ ] record jmonkeyEngine cube animation10 #+name: integration11 #+begin_src clojure12 (ns cortex.integration13 "Enable loading creatures with senses from blender."14 {:author "Robert McIntyre"})16 ;; TODO remove this!17 (require 'cortex.import)18 (cortex.import/mega-import-jme3)19 (use '(cortex world util))21 (rlm.rlm-commands/help)25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27 ;; this could be a good way to give objects special properties like28 ;; being eyes and the like29 (defn load-blender-model30 "Load a .blend file using an asset folder relative path."31 [^String model]32 (.loadModel33 (doto (asset-manager)34 (.registerLoader BlenderModelLoader (into-array String ["blend"])))35 model))37 (defn scene []38 (load-blender-model "Models/property/test.blend"))40 (defn test-GET! []41 (.getUserData42 (.getChild43 (scene) 0)44 "properties"))46 (defn make-eye []47 (println "hi"))49 (defn test-eval-prop []50 (eval (read-string (.findValue (test-GET!) "form"))))52 ;; the properties are saved along with the blender file.53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;57 ;; Sensors are thunk-functions that return sensory data.58 ;; Effectors take data and cause changes in the results of the sensor59 ;; functions.61 (defrecord Creature [sensors effectors])71 #+end_src75 #+begin_src clojure :tangle ../src/cortex/integration.clj76 <<integration>>77 #+end_src