changeset 153:c95179907951

saving progress
author Robert McIntyre <rlm@mit.edu>
date Fri, 03 Feb 2012 05:59:32 -0700
parents c901b17a1f52
children bb235258f835
files org/test-creature.org org/util.org
diffstat 2 files changed, 14 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Fri Feb 03 05:52:36 2012 -0700
     1.2 +++ b/org/test-creature.org	Fri Feb 03 05:59:32 2012 -0700
     1.3 @@ -160,15 +160,6 @@
     1.4  (declare joint-create)
     1.5  (use 'clojure.contrib.def)
     1.6  
     1.7 -
     1.8 -(defn load-bullet []
     1.9 -  (let [sim (world (Node.) {} no-op no-op)]
    1.10 -    (doto sim
    1.11 -      (.enqueue
    1.12 -       (fn []
    1.13 -         (.stop sim)))
    1.14 -      (.start))))
    1.15 -
    1.16  (defn load-blender-model
    1.17    "Load a .blend file using an asset folder relative path."
    1.18    [^String model]
    1.19 @@ -184,25 +175,18 @@
    1.20               (.getZ in)
    1.21               (- (.getY in))))
    1.22  
    1.23 -
    1.24 -
    1.25 -
    1.26 -
    1.27  (defn world-to-local
    1.28     "Convert the world coordinates into coordinates relative to the 
    1.29     object (i.e. local coordinates), taking into account the rotation
    1.30     of object."
    1.31     [#^Spatial object world-coordinate]
    1.32 -   (let [out (Vector3f.)]
    1.33 -     (.worldToLocal object world-coordinate out) out))
    1.34 +   (.worldToLocal object world-coordinate nil))
    1.35  
    1.36  (defn local-to-world
    1.37     "Convert the local coordinates into coordinates into world relative
    1.38      coordinates" 
    1.39     [#^Spatial object local-coordinate]
    1.40 -   (let [world-coordinate (Vector3f.)]
    1.41 -     (.localToWorld object local-coordinate world-coordinate)
    1.42 -     world-coordinate))
    1.43 +   (.localToWorld object local-coordinate nil))
    1.44  
    1.45  (defmulti joint-dispatch
    1.46    "Translate blender pseudo-joints into real JME joints."
     2.1 --- a/org/util.org	Fri Feb 03 05:52:36 2012 -0700
     2.2 +++ b/org/util.org	Fri Feb 03 05:59:32 2012 -0700
     2.3 @@ -203,7 +203,6 @@
     2.4    [f m] (zipmap (keys m) (map f (vals m))))
     2.5  
     2.6  
     2.7 -
     2.8  #+end_src
     2.9  
    2.10  #+results: util
    2.11 @@ -216,6 +215,18 @@
    2.12  #+begin_src clojure :results silent
    2.13  (in-ns 'cortex.util)
    2.14  
    2.15 +(defn load-bullet 
    2.16 +  "Runnig this function unpacks the native bullet libraries and makes
    2.17 +   them available."
    2.18 +  []
    2.19 +  (let [sim (world (Node.) {} no-op no-op)]
    2.20 +    (doto sim
    2.21 +      (.enqueue
    2.22 +       (fn []
    2.23 +         (.stop sim)))
    2.24 +      (.start))))
    2.25 +
    2.26 +
    2.27  (defrecord shape-description
    2.28    [name
    2.29     color