comparison thesis/user-guide.org @ 487:19b55aaf4462

complete first draft of user guide.
author Robert McIntyre <rlm@mit.edu>
date Sat, 29 Mar 2014 20:17:58 -0400
parents 6d460ac3f5d0
children
comparison
equal deleted inserted replaced
486:6d460ac3f5d0 487:19b55aaf4462
237 object and a float and is called every frame of the 237 object and a float and is called every frame of the
238 simulation. The float tells how many seconds is has been 238 simulation. The float tells how many seconds is has been
239 since the last frame was rendered, according to whatever 239 since the last frame was rendered, according to whatever
240 clock jme is currently using. The default is to use IsoTimer 240 clock jme is currently using. The default is to use IsoTimer
241 which will result in this value always being the same. 241 which will result in this value always being the same.
242
243 242
244 - =(position-camera world position rotation)= :: set the position 243 - =(position-camera world position rotation)= :: set the position
245 of the simulation's main camera. 244 of the simulation's main camera.
245
246 - =(enable-debug world)= :: turn on debug wireframes for each 246 - =(enable-debug world)= :: turn on debug wireframes for each
247 simulated object. 247 simulated object.
248
248 - =(set-gravity world gravity)= :: set the gravity of a running 249 - =(set-gravity world gravity)= :: set the gravity of a running
249 simulation. 250 simulation.
251
250 - =(box length width height & {options})= :: create a box in the 252 - =(box length width height & {options})= :: create a box in the
251 simulation. Options is a hash map specifying texture, mass, 253 simulation. Options is a hash map specifying texture, mass,
252 etc. Possible options are =:name=, =:color=, =:mass=, 254 etc. Possible options are =:name=, =:color=, =:mass=,
253 =:friction=, =:texture=, =:material=, =:position=, 255 =:friction=, =:texture=, =:material=, =:position=,
254 =:rotation=, =:shape=, and =:physical?=. 256 =:rotation=, =:shape=, and =:physical?=.
257
255 - =(sphere radius & {options})= :: create a sphere in the simulation. 258 - =(sphere radius & {options})= :: create a sphere in the simulation.
256 Options are the same as in =box=. 259 Options are the same as in =box=.
260
257 - =(load-blender-model file-name)= :: create a node structure 261 - =(load-blender-model file-name)= :: create a node structure
258 representing that described in a blender file. 262 representing that described in a blender file.
263
259 - =(light-up-everything world)= :: distribute a standard compliment 264 - =(light-up-everything world)= :: distribute a standard compliment
260 of lights throught the simulation. Should be adequate for most 265 of lights throught the simulation. Should be adequate for most
261 purposes. 266 purposes.
267
262 - =(node-seq node)= :: return a recursuve list of the node's 268 - =(node-seq node)= :: return a recursuve list of the node's
263 children. 269 children.
270
264 - =(nodify name children)= :: construct a node given a node-name and 271 - =(nodify name children)= :: construct a node given a node-name and
265 desired children. 272 desired children.
273
266 - =(add-element world element)= :: add an object to a running world 274 - =(add-element world element)= :: add an object to a running world
267 simulation. 275 simulation.
276
268 - =(set-accuracy world accuracy)= :: change the accuracy of the 277 - =(set-accuracy world accuracy)= :: change the accuracy of the
269 world's physics simulator. 278 world's physics simulator.
279
270 - =(asset-manager)= :: get an /AssetManager/, a jMonkeyEngine 280 - =(asset-manager)= :: get an /AssetManager/, a jMonkeyEngine
271 construct that is useful for loading textures and is required 281 construct that is useful for loading textures and is required
272 for smooth interaction with jMonkeyEngine library functions. 282 for smooth interaction with jMonkeyEngine library functions.
283
284 - =(load-bullet)= :: unpack native libraries and initialize
285 blender. This function is required before other world building
286 functions are called.
273 287
274 288
275 *** Creature Manipulation / Import 289 *** Creature Manipulation / Import
276 290
277 - =(body! creature)= :: give the creature a physical body. 291 - =(body! creature)= :: give the creature a physical body.
292
278 - =(vision! creature)= :: give the creature a sense of vision. 293 - =(vision! creature)= :: give the creature a sense of vision.
279 Returns a list of functions which will each, when called 294 Returns a list of functions which will each, when called
280 during a simulation, return the vision data for the channel of 295 during a simulation, return the vision data for the channel of
281 one of the eyes. The functions are ordered depending on the 296 one of the eyes. The functions are ordered depending on the
282 alphabetical order of the names of the eye nodes in the 297 alphabetical order of the names of the eye nodes in the
283 blender file. The data returned by the functions is a vector 298 blender file. The data returned by the functions is a vector
284 containing the eye's /topology/, a vector of coordinates, and 299 containing the eye's /topology/, a vector of coordinates, and
285 the eye's /data/, a vector of RGB values filtered by the eye's 300 the eye's /data/, a vector of RGB values filtered by the eye's
286 sensitivity. 301 sensitivity.
302
287 - =(hearing! creature)= :: give the creature a sense of hearing. 303 - =(hearing! creature)= :: give the creature a sense of hearing.
288 Returns a list of functions, one for each ear, that when 304 Returns a list of functions, one for each ear, that when
289 called will return a frame's worth of hearing data for that 305 called will return a frame's worth of hearing data for that
290 ear. The functions are ordered depending on the alphabetical 306 ear. The functions are ordered depending on the alphabetical
291 order of the names of the ear nodes in the blender file. The 307 order of the names of the ear nodes in the blender file. The
292 data returned by the functions is an array PCM encoded wav 308 data returned by the functions is an array PCM encoded wav
293 data. 309 data.
310
294 - =(touch! creature)= :: give the creature a sense of touch. Returns 311 - =(touch! creature)= :: give the creature a sense of touch. Returns
295 a single function that must be called with the /root node/ of 312 a single function that must be called with the /root node/ of
296 the world, and which will return a vector of /touch-data/ 313 the world, and which will return a vector of /touch-data/
297 one entry for each touch sensitive component, each entry of 314 one entry for each touch sensitive component, each entry of
298 which contains a /topology/ that specifies the distribution of 315 which contains a /topology/ that specifies the distribution of
299 touch sensors, and the /data/, which is a vector of 316 touch sensors, and the /data/, which is a vector of
300 =[activation, length]= pairs for each touch hair. 317 =[activation, length]= pairs for each touch hair.
318
301 - =(proprioception! creature)= :: give the creature the sense of 319 - =(proprioception! creature)= :: give the creature the sense of
302 proprioception. Returns a list of functions, one for each 320 proprioception. Returns a list of functions, one for each
303 joint, that when called during a running simulation will 321 joint, that when called during a running simulation will
304 report the =[headnig, pitch, roll]= of the joint. 322 report the =[headnig, pitch, roll]= of the joint.
323
305 - =(movement! creature)= :: give the creature the power of movement. 324 - =(movement! creature)= :: give the creature the power of movement.
306 Creates a list of functions, one for each muscle, that when 325 Creates a list of functions, one for each muscle, that when
307 called with an integer, will set the recruitment of that 326 called with an integer, will set the recruitment of that
308 muscle to that integer, and will report the current power 327 muscle to that integer, and will report the current power
309 being exerted by the muscle. Order of muscles is determined by 328 being exerted by the muscle. Order of muscles is determined by
312 *** Visualization/Debug 331 *** Visualization/Debug
313 332
314 - =(view-vision)= :: create a function that when called with a list 333 - =(view-vision)= :: create a function that when called with a list
315 of visual data returned from the functions made by =vision!=, 334 of visual data returned from the functions made by =vision!=,
316 will display that visual data on the screen. 335 will display that visual data on the screen.
336
317 - =(view-hearing)= :: same as =view-vision= but for hearing. 337 - =(view-hearing)= :: same as =view-vision= but for hearing.
338
318 - =(view-touch)= :: same as =view-vision= but for touch. 339 - =(view-touch)= :: same as =view-vision= but for touch.
340
319 - =(view-proprioception)= :: same as =view-vision= but for 341 - =(view-proprioception)= :: same as =view-vision= but for
320 proprioception. 342 proprioception.
343
321 - =(view-movement)= :: same as =view-vision= but for 344 - =(view-movement)= :: same as =view-vision= but for
322 proprioception. 345 proprioception.
346
323 - =(view anything)= :: =view= is a polymorphic function that allows 347 - =(view anything)= :: =view= is a polymorphic function that allows
324 you to inspect almost anything you could reasonably expect to 348 you to inspect almost anything you could reasonably expect to
325 be able to ``see'' in =CORTEX=. 349 be able to ``see'' in =CORTEX=.
350
326 - =(text anything)= :: =text= is a polymorphic function that allows 351 - =(text anything)= :: =text= is a polymorphic function that allows
327 you to convert practically anything into a text string. 352 you to convert practically anything into a text string.
353
328 - =(println-repl anything)= :: print messages to clojure's repl 354 - =(println-repl anything)= :: print messages to clojure's repl
329 instead of the simulation's terminal window. 355 instead of the simulation's terminal window.
330 356
331 *** Misc
332
333 - =(load-bullet)= :: unpack native libraries and initialize
334 blender. This function is required before other world building
335 functions are called.
336 - =(mega-import-jme3)= :: for experimenting at the REPL. This 357 - =(mega-import-jme3)= :: for experimenting at the REPL. This
337 function will import all jMonkeyEngine3 classes for immediate 358 function will import all jMonkeyEngine3 classes for immediate
338 use. 359 use.
360
361 - =(display-dialated-time world timer)= :: Shows the time as it is
362 flowing in the simulation on a HUD display.
363
364
365