comparison org/util.org @ 205:d3a2abfac405

fixed tangling in body.org, added dialated time HUD display in cortex.util
author Robert McIntyre <rlm@mit.edu>
date Thu, 09 Feb 2012 04:15:09 -0700
parents 305439cec54d
children f5ea63245b3b
comparison
equal deleted inserted replaced
204:162b24a82712 205:d3a2abfac405
473 [root-node 473 [root-node
474 keymap* 474 keymap*
475 intilization 475 intilization
476 world-loop*])) 476 world-loop*]))
477 477
478 478 (import com.jme3.font.BitmapText)
479 479 (import com.jme3.scene.control.AbstractControl)
480 (import com.aurellem.capture.IsoTimer)
481
482 (defn display-dialated-time
483 "Shows the time as it is flowing in the simulation on a HUD display.
484 Useful for making videos."
485 [world timer]
486 (let [font (.loadFont (asset-manager) "Interface/Fonts/Default.fnt")
487 text (BitmapText. font false)]
488 (.setLocalTranslation text 300 (.getLineHeight text) 0)
489 (.addControl
490 text
491 (proxy [AbstractControl] []
492 (controlUpdate [tpf]
493 (.setText text (format
494 "%.2f"
495 (float (/ (.getTime timer) 1000)))))
496 (controlRender [_ _])))
497 (.attachChild (.getGuiNode world) text)))
480 #+end_src 498 #+end_src
481 499
482 500
483 *** Viewing Objects 501 *** Viewing Objects
484 502