comparison org/body.org @ 142:ccd057319c2a

improved proprioception test
author Robert McIntyre <rlm@mit.edu>
date Thu, 02 Feb 2012 02:03:19 -0700
parents 22e193b5c60f
children 48f9cba082eb
comparison
equal deleted inserted replaced
141:22e193b5c60f 142:ccd057319c2a
402 change only the value of pitch. key-f/key-g moves it side to side 402 change only the value of pitch. key-f/key-g moves it side to side
403 and changes yaw. key-v/key-b will spin the blue segment clockwise 403 and changes yaw. key-v/key-b will spin the blue segment clockwise
404 and counterclockwise, and only affect roll." 404 and counterclockwise, and only affect roll."
405 [] 405 []
406 (let [hand (box 1 0.2 0.2 :position (Vector3f. 0 2 0) 406 (let [hand (box 1 0.2 0.2 :position (Vector3f. 0 2 0)
407 :mass 1 :color ColorRGBA/Green :name "hand") 407 :mass 0 :color ColorRGBA/Green :name "hand")
408 finger (box 1 0.2 0.2 :position (Vector3f. 2.4 2 0) 408 finger (box 1 0.2 0.2 :position (Vector3f. 2.4 2 0)
409 :mass 1 :color ColorRGBA/Red :name "finger") 409 :mass 1 :color ColorRGBA/Red :name "finger")
410 joint-node (box 0.1 0.05 0.05 :color ColorRGBA/Yellow 410 joint-node (box 0.1 0.05 0.05 :color ColorRGBA/Yellow
411 :position (Vector3f. 1.2 2 0) 411 :position (Vector3f. 1.2 2 0)
412 :physical? false) 412 :physical? false)
433 (fn [_ _] (.setEnabled hand-control true)) 433 (fn [_ _] (.setEnabled hand-control true))
434 "key-l" 434 "key-l"
435 (fn [_ _] (.setEnabled hand-control false)) 435 (fn [_ _] (.setEnabled hand-control false))
436 "key-i" 436 "key-i"
437 (fn [world _] (set-gravity world (Vector3f. 0 0 0))) 437 (fn [world _] (set-gravity world (Vector3f. 0 0 0)))
438 "key-period"
439 (fn [world _]
440 (.setEnabled finger-control false)
441 (.setEnabled hand-control false)
442 (.rotate creature (doto (Quaternion.)
443 (.fromAngleAxis
444 (float (/ Math/PI 15))
445 (Vector3f. 0 0 -1))))
446
447 (.setEnabled finger-control true)
448 (.setEnabled hand-control true)
449 (set-gravity world (Vector3f. 0 0 0))
450 )
451
452
438 } 453 }
439 ) 454 )
440 455
441 ] 456 ]
442 (comment 457 (comment