# HG changeset patch # User Robert McIntyre # Date 1328273972 25200 # Node ID c951799079512da57e11af693134c8da9139d08e # Parent c901b17a1f52a2bb202b2f8e025443bb117d8252 saving progress diff -r c901b17a1f52 -r c95179907951 org/test-creature.org --- a/org/test-creature.org Fri Feb 03 05:52:36 2012 -0700 +++ b/org/test-creature.org Fri Feb 03 05:59:32 2012 -0700 @@ -160,15 +160,6 @@ (declare joint-create) (use 'clojure.contrib.def) - -(defn load-bullet [] - (let [sim (world (Node.) {} no-op no-op)] - (doto sim - (.enqueue - (fn [] - (.stop sim))) - (.start)))) - (defn load-blender-model "Load a .blend file using an asset folder relative path." [^String model] @@ -184,25 +175,18 @@ (.getZ in) (- (.getY in)))) - - - - (defn world-to-local "Convert the world coordinates into coordinates relative to the object (i.e. local coordinates), taking into account the rotation of object." [#^Spatial object world-coordinate] - (let [out (Vector3f.)] - (.worldToLocal object world-coordinate out) out)) + (.worldToLocal object world-coordinate nil)) (defn local-to-world "Convert the local coordinates into coordinates into world relative coordinates" [#^Spatial object local-coordinate] - (let [world-coordinate (Vector3f.)] - (.localToWorld object local-coordinate world-coordinate) - world-coordinate)) + (.localToWorld object local-coordinate nil)) (defmulti joint-dispatch "Translate blender pseudo-joints into real JME joints." diff -r c901b17a1f52 -r c95179907951 org/util.org --- a/org/util.org Fri Feb 03 05:52:36 2012 -0700 +++ b/org/util.org Fri Feb 03 05:59:32 2012 -0700 @@ -203,7 +203,6 @@ [f m] (zipmap (keys m) (map f (vals m)))) - #+end_src #+results: util @@ -216,6 +215,18 @@ #+begin_src clojure :results silent (in-ns 'cortex.util) +(defn load-bullet + "Runnig this function unpacks the native bullet libraries and makes + them available." + [] + (let [sim (world (Node.) {} no-op no-op)] + (doto sim + (.enqueue + (fn [] + (.stop sim))) + (.start)))) + + (defrecord shape-description [name color