;;-*-Lisp-*-
(in-package goal)

;; definition of type transformq
(deftype transformq (transform)
  ((quat quaternion :inline :offset  16)
   )
  :method-count-assert 9
  :size-assert         #x30
  :flag-assert         #x900000030
  )

;; definition for method 3 of type transformq
(defmethod inspect transformq ((obj transformq))
  (format #t "[~8x] ~A~%" obj 'transformq)
  (format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
  (format #t "~Trot: ~`vector`P~%" (-> obj quat))
  (format #t "~Tscale: ~`vector`P~%" (-> obj scale))
  (format #t "~Tquat: #<quaternion @ #x~X>~%" (-> obj quat))
  obj
  )

;; definition of type trsq
(deftype trsq (trs)
  ((quat quaternion :inline :offset  32)
   )
  :method-count-assert 9
  :size-assert         #x40
  :flag-assert         #x900000040
  )

;; definition for method 3 of type trsq
(defmethod inspect trsq ((obj trsq))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
  (format #t "~Trot: ~`vector`P~%" (-> obj quat))
  (format #t "~Tscale: ~`vector`P~%" (-> obj scale))
  (format #t "~Tquat: #<quaternion @ #x~X>~%" (-> obj quat))
  obj
  )

;; definition of type trsqv
(deftype trsqv (trsq)
  ((pause-adjust-distance meters             :offset          4)
   (nav-radius            meters             :offset          8)
   (transv                vector     :inline :offset-assert  64)
   (rotv                  vector     :inline :offset-assert  80)
   (scalev                vector     :inline :offset-assert  96)
   (dir-targ              quaternion :inline :offset-assert 112)
   (angle-change-time     time-frame         :offset-assert 128)
   (old-y-angle-diff      float              :offset-assert 136)
   )
  :method-count-assert 28
  :size-assert         #x8c
  :flag-assert         #x1c0000008c
  (:methods
    (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9)
    (set-heading-vec! (_type_ vector) quaternion 10)
    (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11)
    (point-toward-point! (_type_ vector) quaternion 12)
    (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13)
    (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14)
    (set-roll-to-grav! (_type_ float) quaternion 15)
    (set-roll-to-grav-2! (_type_ float) quaternion 16)
    (rotate-toward-orientation! (_type_ quaternion float float) quaternion 17)
    (set-quaternion! (_type_ quaternion) quaternion 18)
    (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19)
    (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20)
    (rot->dir-targ! (_type_) quaternion 21)
    (y-angle (_type_) float 22)
    (global-y-angle-to-point (_type_ vector) float 23)
    (relative-y-angle-to-point (_type_ vector) float 24)
    (roll-relative-to-gravity (_type_) float 25)
    (set-and-limit-velocity (_type_ int vector float) trsqv 26)
    (get-quaternion (_type_) quaternion 27)
    )
  )

;; definition for method 3 of type trsqv
(defmethod inspect trsqv ((obj trsqv))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
  (format #t "~Trot: ~`vector`P~%" (-> obj quat))
  (format #t "~Tscale: ~`vector`P~%" (-> obj scale))
  (format #t "~Tquat: #<quaternion @ #x~X>~%" (-> obj quat))
  (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance))
  (format #t "~Tnav-radius: (meters ~m)~%" (-> obj nav-radius))
  (format #t "~Ttransv: ~`vector`P~%" (-> obj transv))
  (format #t "~Trotv: ~`vector`P~%" (-> obj rotv))
  (format #t "~Tscalev: ~`vector`P~%" (-> obj scalev))
  (format #t "~Tdir-targ: #<quaternion @ #x~X>~%" (-> obj dir-targ))
  (format #t "~Tangle-change-time: ~D~%" (-> obj angle-change-time))
  (format #t "~Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff))
  obj
  )

;; definition for method 23 of type trsqv
(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector))
  (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))
  )

;; definition for method 24 of type trsqv
(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector))
  (deg-diff (y-angle obj) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))))
  )

;; failed to figure out what this is:
0
