comparison org/world.org @ 52:00d0e1639d4b

simplified world, got buggy physics ragdoll working
author Robert McIntyre <rlm@mit.edu>
date Mon, 14 Nov 2011 21:30:23 -0700
parents 183744c179e6
children 4b5f00110d8c
comparison
equal deleted inserted replaced
51:2a6ede6d8ad8 52:00d0e1639d4b
291 (.attach (.getStateManager this) physics-manager) 291 (.attach (.getStateManager this) physics-manager)
292 (.setGravity (.getPhysicsSpace physics-manager) 292 (.setGravity (.getPhysicsSpace physics-manager)
293 (Vector3f. 0 -9.81 0)) 293 (Vector3f. 0 -9.81 0))
294 ;; go through every object and add it to the physics 294 ;; go through every object and add it to the physics
295 ;; manager if relevant. 295 ;; manager if relevant.
296 (traverse (fn [geom] 296 ;;(traverse (fn [geom]
297 (dorun 297 ;; (dorun
298 (for [n (range (.getNumControls geom))] 298 ;; (for [n (range (.getNumControls geom))]
299 (do 299 ;; (do
300 (.add (.getPhysicsSpace physics-manager) 300 ;; (cortex.util/println-repl
301 (.getControl geom n)))))) 301 ;; "adding " (.getControl geom n))
302 (.getRootNode this)) 302 ;; (.add (.getPhysicsSpace physics-manager)
303 ;; (.getControl geom n))))))
304 ;; (.getRootNode this))
303 ;; call the supplied setup-fn 305 ;; call the supplied setup-fn
306 ;; simpler !
307 (.addAll (.getPhysicsSpace physics-manager) root-node)
304 (if setup-fn 308 (if setup-fn
305 (setup-fn this)))) 309 (setup-fn this))))
306 (simpleUpdate 310 (simpleUpdate
307 [tpf] 311 [tpf]
308 (no-exceptions 312 (no-exceptions