comparison org/world.org @ 404:939bcc5950b2

completed debug control of worm.
author Robert McIntyre <rlm@mit.edu>
date Mon, 17 Mar 2014 17:29:59 -0400
parents 52de8a36edde
children
comparison
equal deleted inserted replaced
403:92acbe7e5c91 404:939bcc5950b2
175 "mouse-middle" (MouseButtonTrigger. 2) 175 "mouse-middle" (MouseButtonTrigger. 2)
176 "mouse-right" (MouseButtonTrigger. 1)))) 176 "mouse-right" (MouseButtonTrigger. 1))))
177 177
178 (defn initialize-inputs 178 (defn initialize-inputs
179 "Establish key-bindings for a particular virtual world." 179 "Establish key-bindings for a particular virtual world."
180 [game input-manager key-map] 180 [game input-manager key-map]
181 (doall 181 (doall
182 (map (fn [[name trigger]] 182 (map (fn [[name trigger]]
183 (.addMapping 183 (.addMapping
184 ^InputManager input-manager 184 ^InputManager input-manager
185 name (into-array (class trigger) 185 name (into-array (class trigger)
190 ^InputManager input-manager game 190 ^InputManager input-manager game
191 (into-array String [name]))) (keys key-map)))) 191 (into-array String [name]))) (keys key-map))))
192 192
193 #+end_src 193 #+end_src
194 194
195 #+results: input
196 : #'cortex.world/initialize-inputs
197
198 These functions are for controlling the world through the keyboard and 195 These functions are for controlling the world through the keyboard and
199 mouse. 196 mouse.
200 197
201 =constant-map= gets the numerical values for all the keys defined in 198 =constant-map= gets the numerical values for all the keys defined in
202 the =KeyInput= class. 199 the =KeyInput= class.
245 242
246 (defn world 243 (defn world
247 "the =world= function takes care of the details of initializing a 244 "the =world= function takes care of the details of initializing a
248 SimpleApplication. 245 SimpleApplication.
249 246
250 ***** Arguments: 247 ,***** Arguments:
251 248
252 - root-node : a com.jme3.scene.Node object which contains all of 249 - root-node : a com.jme3.scene.Node object which contains all of
253 the objects that should be in the simulation. 250 the objects that should be in the simulation.
254 251
255 - key-map : a map from strings describing keys to functions that 252 - key-map : a map from strings describing keys to functions that