# HG changeset patch # User Robert McIntyre # Date 1325840623 25200 # Node ID 6b4ca076285eb932bb7dd4f2a1b00e4279d2cb41 # Parent 10f495560c5935a9616625ee93c8521d3fb1a6c9 making some progress on cone joints... diff -r 10f495560c59 -r 6b4ca076285e assets/Models/creature1/one.blend Binary file assets/Models/creature1/one.blend has changed diff -r 10f495560c59 -r 6b4ca076285e org/test-creature.org --- a/org/test-creature.org Thu Jan 05 21:31:34 2012 -0700 +++ b/org/test-creature.org Fri Jan 06 02:03:43 2012 -0700 @@ -173,19 +173,19 @@ twist (:twist constraints)] (println-repl "creating CONE joint") - (let [vector-1 - (.mult (.getWorldRotation joint) - Vector3f/UNIT_X) - vector-2 - (.normalize - (.subtract - (.getWorldTranslation joint) - (.getWorldTranslation obj-a))) + (let [frame-a + (.toRotationMatrix + (doto (Quaternion.) + (.fromAngleAxis + (float + (.angleBetween + pivot-a Vector3f/UNIT_X)) + (.cross (.normalize pivot-a) + Vector3f/UNIT_X)))) ] (println-repl - "vector-1 :" vector-1) - (println-repl - "vector-2 :" vector-2) + "angle between pivot-a (" pivot-a ") and UNIT_X is" + (.angleBetween Vector3f/UNIT_X (.normalize pivot-a))) @@ -195,40 +195,25 @@ control-b pivot-a pivot-b + + + ;; ;; frame-in-A + frame-a + frame-a - ;;(doto (Matrix3f.) - ;; (.fromStartEndVectors - ;; Vector3f/UNIT_X - ;; (.normalize - ;; (.subtract - ;; (.getWorldTranslation joint) - ;; (.getWorldTranslation obj-a))))) - - - (.toRotationMatrix - (.getWorldRotation joint)) + ;; (.toRotationMatrix + ;; (doto (Quaternion.) + ;; (.fromAngles + ;; 0 0 (* -1 (/ Math/PI 2))))) - - (.toRotationMatrix - (.fromAngleAxis - (Quaternion.) - (.angleBetween Vector3f/UNIT_X pivot-a) - (.cross Vector3f/UNIT_X pivot-a))) - + ;; ;; frame-in-B + ;; (.toRotationMatrix + ;; (doto (Quaternion.) + ;; (.fromAngles + ;; 0 0 (* -1.2 (/ Math/PI 2))))) - - - ;; (doto (Matrix3f.) - ;; (.fromStartEndVectors - ;; Vector3f/UNIT_X - ;; (.normalize - ;; vector-1))) - - ;; (doto (Matrix3f.) - ;; (.fromStartEndVectors - ;; Vector3f/UNIT_X - ;; vector-2)) + ) (.setLimit (float limit-xz) (float limit-xy)