diff org/test-creature.org @ 148:511112c44b16

muscles are tested and work!
author Robert McIntyre <rlm@mit.edu>
date Fri, 03 Feb 2012 01:04:42 -0700
parents 72801a20b8e5
children 1e6beed24cec
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Fri Feb 03 00:48:34 2012 -0700
     1.2 +++ b/org/test-creature.org	Fri Feb 03 01:04:42 2012 -0700
     1.3 @@ -1117,7 +1117,7 @@
     1.4          control (.getControl target RigidBodyControl)]
     1.5      (fn [n]
     1.6        (let [pool-index (min n (count fibers))]
     1.7 -        (.applyTorque control (force-index n))))))
     1.8 +        (.applyTorque control (.mult axis (force-index n)))))))
     1.9  
    1.10  
    1.11  (defn enable-muscles
    1.12 @@ -1148,6 +1148,8 @@
    1.13                           "Sounds/pure.wav" false)
    1.14          prop (proprioception creature)
    1.15          prop-debug (proprioception-debug-window)
    1.16 +
    1.17 +        muscle-fns (enable-muscles creature)
    1.18          ;; dream
    1.19  
    1.20          ]
    1.21 @@ -1173,7 +1175,15 @@
    1.22                    (if value
    1.23                      (do
    1.24                        (println-repl "play-sound")
    1.25 -                      (.play bell))))})
    1.26 +                      (.play bell))))
    1.27 +                "key-h"
    1.28 +                (fn [_ value]
    1.29 +                  (if value
    1.30 +                    (do
    1.31 +                      (println-repl "muscle activating!")
    1.32 +                      ((first muscle-fns)  199))))
    1.33 +
    1.34 +                })
    1.35          (fn [world]
    1.36            (light-up-everything world)
    1.37            (enable-debug world)
    1.38 @@ -1190,7 +1200,7 @@
    1.39            ;; world (file-str "/home/r/proj/ai-videos/hand"))
    1.40            ;;(.setTimer world (RatchetTimer. 60))
    1.41            (speed-up world)
    1.42 -          ;;(set-gravity world (Vector3f. 0 0 0))
    1.43 +          (set-gravity world (Vector3f. 0 0 0))
    1.44            )
    1.45          (fn [world tpf]
    1.46            ;;(dorun