# HG changeset patch # User Robert McIntyre # Date 1325923814 25200 # Node ID 4f5e2c629e45f28147a6d09782a0947b3bbbdb08 # Parent 14b604e955ed81f119141aaed191adec9993cfce going to try to fix cone-joint generating code diff -r 14b604e955ed -r 4f5e2c629e45 org/test-creature.org --- a/org/test-creature.org Sat Jan 07 00:58:47 2012 -0700 +++ b/org/test-creature.org Sat Jan 07 01:10:14 2012 -0700 @@ -53,7 +53,12 @@ (declare joint-create get-subjective-position) (defn load-bullet [] - (.start (world (Node.) {} no-op no-op))) + (let [sim (world (Node.) {} no-op no-op)] + (.enqueue + sim + (fn [] + (.stop sim))) + (.start sim))) (defn load-blender-model "Load a .blend file using an asset folder relative path." @@ -309,25 +314,31 @@ (defn world-setup [joint] (let [ - joint-position (Vector3f. 0 4 0) + joint-position (Vector3f. 0 0 0) joint-rotation (.toRotationMatrix (.mult (doto (Quaternion.) (.fromAngleAxis (* 1 (/ Math/PI 4)) - (Vector3f. -1 0 0))) - (doto (Quaternion.) - (.fromAngleAxis - (/ Math/PI 2) - (Vector3f. 0 0 1))))) + (Vector3f. 0 0 1))) + (.mult + (doto (Quaternion.) + (.fromAngleAxis + (* 2 (/ Math/PI 4)) + (Vector3f. 0 1 0))) + (doto (Quaternion.) + (.fromAngleAxis + (* 1 (/ Math/PI 2)) + (Vector3f. 0 0 1)))))) + top-position (.mult joint-rotation (Vector3f. 8 0 0)) origin (doto (sphere 0.1 :physical? false :color ColorRGBA/Cyan - :position (Vector3f. 0 0 0))) + :position top-position)) top (doto (sphere 0.1 :physical? false :color ColorRGBA/Yellow - :position (.mult joint-rotation (Vector3f. 8 0 0))) + :position top-position) (.addControl (RigidBodyControl.