# HG changeset patch # User Robert McIntyre # Date 1370527777 14400 # Node ID 4c37d39a3cf6c40954730b96e8dc90a71de9b5b9 # Parent 13059eb62899768baf74cd8c61601168fe553041 removed dependency on swank, which had silently bit rotted. Restored functionality of mege-import-jme3. diff -r 13059eb62899 -r 4c37d39a3cf6 org/body.org --- a/org/body.org Wed May 29 17:17:40 2013 -0400 +++ b/org/body.org Thu Jun 06 10:09:37 2013 -0400 @@ -24,8 +24,8 @@ Collision Mesh in tandem with its Geometric Mesh under the influence of the armature. Without this the creature will not be able to grab things in its environment, and it won't be able to tell where its -physical body is by using its eyes. Also, armatures do not specify -any rotational limits for a joint, making it hard to model elbows, +physical body is by using its eyes. Also, armatures do not specify any +rotational limits for a joint, making it hard to model elbows, shoulders, etc. ** EVE diff -r 13059eb62899 -r 4c37d39a3cf6 org/integration.org --- a/org/integration.org Wed May 29 17:17:40 2013 -0400 +++ b/org/integration.org Thu Jun 06 10:09:37 2013 -0400 @@ -48,8 +48,8 @@ For this demonstration I have to manually drive the muscles of the hand. I do this by creating a little mini-language to describe +simulated muscle contraction. -simulated muscle contraction. #+name: integration-2 #+begin_src clojure (defn motor-control-program @@ -224,8 +224,8 @@ (import com.aurellem.capture.Capture) -(defn test-everything! - ([] (test-everything! false)) +(defn test-integration + ([] (test-integration false)) ([record?] (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false) diff -r 13059eb62899 -r 4c37d39a3cf6 org/test.org --- a/org/test.org Wed May 29 17:17:40 2013 -0400 +++ b/org/test.org Thu Jun 06 10:09:37 2013 -0400 @@ -18,8 +18,8 @@ touch proprioception movement + integration]) - ]) (:import com.jme3.app.state.AppState com.jme3.system.AppSettings) (:import (com.jme3.math Triangle Vector3f Vector2f Ray Matrix4f))) @@ -73,6 +73,8 @@ #'cortex.test.proprioception/test-proprioception #'cortex.test.movement/test-worm-movement + + #'cortex.test.integration/test-integration ]) diff -r 13059eb62899 -r 4c37d39a3cf6 org/util.org --- a/org/util.org Wed May 29 17:17:40 2013 -0400 +++ b/org/util.org Thu Jun 06 10:09:37 2013 -0400 @@ -16,7 +16,7 @@ #+name: import #+begin_src clojure :results silent (ns cortex.import - (:require swank.util.class-browse)) + (:import java.io.File java.util.jar.JarFile)) (defn permissive-import [classname] @@ -32,19 +32,34 @@ ;; upon being loaded. (not (re-matches #".*Lwjgl.*" classname)))) -(defn jme-classes - "returns a list of all jme3 classes" - [] +(defn jme-jars [] + (map + #(JarFile. (File. %)) + (filter (partial re-matches #".*jME3.*") + (clojure.string/split + (System/getProperty "java.class.path") #":")))) + +(defn jme-class-names [] (filter jme-class? - (map :name - swank.util.class-browse/available-classes))) - + (map + (comp + #(.replace % File/separator ".") + #(clojure.string/replace % ".class" "")) + (filter + (partial re-matches #".*\.class$") + (mapcat + #(map + str + (enumeration-seq + (.entries %))) + (jme-jars)))))) + (defn mega-import-jme3 "Import ALL the jme classes. For REPL use." [] - (doall - (map (comp permissive-import symbol) (jme-classes)))) + (dorun + (map (comp permissive-import symbol) (jme-class-names)))) #+end_src jMonkeyEngine3 has a plethora of classes which can be overwhelming to