Mercurial > cortex
diff org/util.org @ 192:deac7b708750
cleaned up test-creature.org and renamed to integreation.org.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 04 Feb 2012 11:29:45 -0700 |
parents | c33a8e5fe7bc |
children | fc0bf33bded2 |
line wrap: on
line diff
1.1 --- a/org/util.org Sat Feb 04 11:02:19 2012 -0700 1.2 +++ b/org/util.org Sat Feb 04 11:29:45 2012 -0700 1.3 @@ -102,7 +102,7 @@ 1.4 (:import javax.swing.JPanel) 1.5 (:import javax.swing.JFrame) 1.6 (:import javax.swing.SwingUtilities) 1.7 - 1.8 + (:import com.jme3.scene.plugins.blender.BlenderModelLoader) 1.9 (:import (java.util.logging Level Logger))) 1.10 1.11 (defvar println-repl 1.12 @@ -318,15 +318,15 @@ 1.13 :shape (Sphere. 32 32 (float r)))))) 1.14 ([] (sphere 0.5))) 1.15 1.16 -(defn green-x-ray 1.17 - "A usefull material for debuging -- it can be seen no matter what 1.18 - object occuldes it." 1.19 - [] 1.20 - (doto (Material. (asset-manager) 1.21 - "Common/MatDefs/Misc/Unshaded.j3md") 1.22 - (.setColor "Color" ColorRGBA/Green) 1.23 - (-> (.getAdditionalRenderState) 1.24 - (.setDepthTest false)))) 1.25 +(defn x-ray 1.26 + "A usefull material for debuging -- it can be seen no matter what 1.27 + object occuldes it." 1.28 + [#^ColorRGBA color] 1.29 + (doto (Material. (asset-manager) 1.30 + "Common/MatDefs/Misc/Unshaded.j3md") 1.31 + (.setColor "Color" color) 1.32 + (-> (.getAdditionalRenderState) 1.33 + (.setDepthTest false)))) 1.34 1.35 (defn node-seq 1.36 "Take a node and return a seq of all its children 1.37 @@ -344,6 +344,14 @@ 1.38 node)) 1.39 ([children] (nodify "" children))) 1.40 1.41 +(defn load-blender-model 1.42 + "Load a .blend file using an asset folder relative path." 1.43 + [^String model] 1.44 + (.loadModel 1.45 + (doto (asset-manager) 1.46 + (.registerLoader BlenderModelLoader 1.47 + (into-array String ["blend"]))) model)) 1.48 + 1.49 1.50 #+end_src 1.51