comparison org/util.org @ 460:763d13f77e03

merge in laptop changes.
author Robert McIntyre <rlm@mit.edu>
date Thu, 27 Mar 2014 17:57:01 -0400
parents a86555b02916 0a4362d1f138
children 01934317b25b
comparison
equal deleted inserted replaced
459:a86555b02916 460:763d13f77e03
127 will always output to the REPL" 127 will always output to the REPL"
128 (bound-fn [& args] (apply println args))) 128 (bound-fn [& args] (apply println args)))
129 129
130 (defn position-camera 130 (defn position-camera
131 "Change the position of the in-world camera." 131 "Change the position of the in-world camera."
132 [world #^Vector3f position #^Quaternion rotation] 132 ([world #^Vector3f position #^Quaternion rotation]
133 (doto (.getCamera world) 133 (doto (.getCamera world)
134 (.setLocation position) 134 (.setLocation position)
135 (.setRotation rotation))) 135 (.setRotation rotation)))
136 ([world [position rotation]]
137 (position-camera world position rotation)))
138
136 139
137 (defn enable-debug 140 (defn enable-debug
138 "Turn on debug wireframes for every object in this simulation." 141 "Turn on debug wireframes for every object in this simulation."
139 [world] 142 [world]
140 (.enableDebug 143 (.enableDebug
144 BulletAppState)) 147 BulletAppState))
145 (asset-manager))) 148 (asset-manager)))
146 149
147 (defn speed-up 150 (defn speed-up
148 "Increase the dismally slow speed of the world's camera." 151 "Increase the dismally slow speed of the world's camera."
149 [world] 152 ([world] (speed-up world 1))
150 (.setMoveSpeed (.getFlyByCamera world) 153 ([world amount]
151 (float 60)) 154 (.setMoveSpeed (.getFlyByCamera world)
152 (.setRotationSpeed (.getFlyByCamera world) 155 (float (* amount 60)))
153 (float 3)) 156 (.setRotationSpeed (.getFlyByCamera world)
154 world) 157 (float (* amount 3)))
155 158 world))
156 159
157 (defn no-logging 160 (defn no-logging
158 "Disable all of jMonkeyEngine's logging." 161 "Disable all of jMonkeyEngine's logging."
159 [] 162 []
160 (.setLevel (Logger/getLogger "com.jme3") Level/OFF)) 163 (.setLevel (Logger/getLogger "com.jme3") Level/OFF))
680 #+begin_src clojure :results silent 683 #+begin_src clojure :results silent
681 (cortex.util/view (cortex.util/box)) 684 (cortex.util/view (cortex.util/box))
682 #+end_src 685 #+end_src
683 686
684 687
685 * COMMENT code generation 688 * code generation
686 #+begin_src clojure :tangle ../src/cortex/import.clj 689 #+begin_src clojure :tangle ../src/cortex/import.clj
687 <<import>> 690 <<import>>
688 #+end_src 691 #+end_src
689 692
690 693