comparison org/movement.org @ 295:67a4e92d4628

made the hand 10x stronger
author Robert McIntyre <rlm@mit.edu>
date Thu, 16 Feb 2012 09:59:44 -0700
parents e27a91b1f997
children 1eed471e2ebf
comparison
equal deleted inserted replaced
294:76a5edd6507d 295:67a4e92d4628
120 pool-integral (reductions + pool) 120 pool-integral (reductions + pool)
121 force-index 121 force-index
122 (vec (map #(float (* strength (/ % (last pool-integral)))) 122 (vec (map #(float (* strength (/ % (last pool-integral))))
123 pool-integral)) 123 pool-integral))
124 control (.getControl target RigidBodyControl)] 124 control (.getControl target RigidBodyControl)]
125 (println-repl "adding muscle to" (.getName target))
126 (println-repl "points" axis)
125 (fn [n] 127 (fn [n]
126 (let [pool-index (max 0 (min n (dec (count pool)))) 128 (let [pool-index (max 0 (min n (dec (count pool))))
127 force (force-index pool-index)] 129 force (force-index pool-index)]
128 (.applyTorque control (.mult axis force)) 130 (.applyTorque control (.mult axis force))
129 (float (/ force strength)))))) 131 (float (/ force strength))))))