# HG changeset patch # User Robert McIntyre # Date 1325925135 25200 # Node ID 00ab1f10266f654cf410f4f482103ae688ef97df # Parent 4f5e2c629e45f28147a6d09782a0947b3bbbdb08 creatig cone joints for hand diff -r 4f5e2c629e45 -r 00ab1f10266f assets/Models/creature1/one.blend Binary file assets/Models/creature1/one.blend has changed diff -r 4f5e2c629e45 -r 00ab1f10266f org/test-creature.org --- a/org/test-creature.org Sat Jan 07 01:10:14 2012 -0700 +++ b/org/test-creature.org Sat Jan 07 01:32:15 2012 -0700 @@ -180,59 +180,29 @@ (do (let [limit-xz (:limit-xz constraints) limit-xy (:limit-xy constraints) - twist (:twist constraints)] + twist (:twist constraints) + rotation (.toRotationMatrix (.getWorldRotation joint))] (println-repl "creating CONE joint") - (let [frame-a - (.toRotationMatrix - (doto (Quaternion.) - (.fromAngleAxis - (float - (.angleBetween - (.normalize pivot-a) Vector3f/UNIT_X)) - (.normalize - (.cross pivot-a - Vector3f/UNIT_X))))) - ] - (println-repl "pivot-a" pivot-a) - (println-repl - "angle between pivot-a and UNIT_X is" - (.angleBetween Vector3f/UNIT_X (.normalize pivot-a))) - (println-repl "frame-a:" frame-a) - (println-repl - "frame-a moves Vector3f/UNIT_X to" - (.mult frame-a Vector3f/UNIT_X )) - - - (doto - (ConeJoint. - control-a - control-b - pivot-a - pivot-b - - - ;; frame-in-A - ;;frame-a - ;;frame-a - - (.toRotationMatrix - (doto (Quaternion.) - (.fromAngles - 0 0 (* -0.5 (/ Math/PI 2))))) - - - ;; frame-in-B - (.toRotationMatrix - (doto (Quaternion.) - (.fromAngles - 0 0 (* -0.5 (/ Math/PI 2))))) - - - ) - (.setLimit (float limit-xz) - (float limit-xy) - (float twist)))))) + (println-repl rotation) + (println-repl + "UNIT_X --> " (.mult rotation (Vector3f. 1 0 0))) + (println-repl + "UNIT_Y --> " (.mult rotation (Vector3f. 0 1 0))) + (println-repl + "UNIT_Z --> " (.mult rotation (Vector3f. 0 0 1))) + (doto + (ConeJoint. + control-a + control-b + pivot-a + pivot-b + rotation + rotation + ) + (.setLimit (float limit-xz) + (float limit-xy) + (float twist))))) true (println-repl "joint-type" joint-type "not recognized"))) @@ -321,16 +291,11 @@ (doto (Quaternion.) (.fromAngleAxis (* 1 (/ Math/PI 4)) - (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)))))) + (Vector3f. -1 0 0))) + (doto (Quaternion.) + (.fromAngleAxis + (* 1 (/ Math/PI 2)) + (Vector3f. 0 0 1))))) top-position (.mult joint-rotation (Vector3f. 8 0 0)) origin (doto