changeset 84:4f5e2c629e45

going to try to fix cone-joint generating code
author Robert McIntyre <rlm@mit.edu>
date Sat, 07 Jan 2012 01:10:14 -0700
parents 14b604e955ed
children 00ab1f10266f
files org/test-creature.org
diffstat 1 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Sat Jan 07 00:58:47 2012 -0700
     1.2 +++ b/org/test-creature.org	Sat Jan 07 01:10:14 2012 -0700
     1.3 @@ -53,7 +53,12 @@
     1.4  (declare joint-create get-subjective-position)
     1.5  
     1.6  (defn load-bullet []
     1.7 -  (.start (world (Node.) {} no-op no-op)))
     1.8 +  (let [sim (world (Node.) {} no-op no-op)]
     1.9 +    (.enqueue
    1.10 +     sim
    1.11 +     (fn []
    1.12 +       (.stop sim)))
    1.13 +    (.start sim)))
    1.14  
    1.15  (defn load-blender-model
    1.16    "Load a .blend file using an asset folder relative path."
    1.17 @@ -309,25 +314,31 @@
    1.18  (defn world-setup [joint]
    1.19    (let [
    1.20  
    1.21 -        joint-position (Vector3f. 0 4 0)
    1.22 +        joint-position (Vector3f. 0 0 0)
    1.23          joint-rotation
    1.24          (.toRotationMatrix
    1.25           (.mult
    1.26            (doto (Quaternion.)
    1.27              (.fromAngleAxis
    1.28               (* 1 (/ Math/PI 4))
    1.29 -             (Vector3f. -1 0 0)))
    1.30 -          (doto (Quaternion.)
    1.31 -            (.fromAngleAxis
    1.32 -             (/ Math/PI 2)
    1.33 -             (Vector3f. 0 0 1)))))
    1.34 +             (Vector3f. 0 0 1)))
    1.35 +          (.mult
    1.36 +           (doto (Quaternion.)
    1.37 +             (.fromAngleAxis
    1.38 +              (* 2 (/ Math/PI 4))
    1.39 +              (Vector3f. 0 1 0)))
    1.40 +           (doto (Quaternion.)
    1.41 +             (.fromAngleAxis
    1.42 +              (* 1 (/ Math/PI 2))
    1.43 +              (Vector3f. 0 0 1))))))
    1.44 +        top-position (.mult joint-rotation (Vector3f. 8 0 0))
    1.45          
    1.46          origin (doto
    1.47                     (sphere 0.1 :physical? false :color ColorRGBA/Cyan
    1.48 -                           :position (Vector3f. 0 0 0)))
    1.49 +                           :position top-position))
    1.50          top (doto
    1.51                  (sphere 0.1 :physical? false :color ColorRGBA/Yellow
    1.52 -                        :position (.mult joint-rotation (Vector3f. 8 0 0)))
    1.53 +                        :position top-position)
    1.54  
    1.55                (.addControl
    1.56                 (RigidBodyControl.