mirror of
https://github.com/open-goal/jak-project
synced 2026-06-14 14:28:25 -04:00
42 lines
1.2 KiB
Common Lisp
Vendored
Generated
42 lines
1.2 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type quaternion
|
|
(deftype quaternion (structure)
|
|
"Quaternion. Stored in xyzw order."
|
|
((data float 4)
|
|
(x float :overlay-at (-> data 0))
|
|
(y float :overlay-at (-> data 1))
|
|
(z float :overlay-at (-> data 2))
|
|
(w float :overlay-at (-> data 3))
|
|
(vec vector :inline :overlay-at (-> data 0))
|
|
(quad uint128 :overlay-at (-> data 0))
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type quaternion
|
|
;; INFO: this function exists in multiple non-identical object files
|
|
;; INFO: Used lq/sq
|
|
(defmethod inspect ((this quaternion))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'quaternion)
|
|
(format #t "~1Tdata[4] @ #x~X~%" (&-> this x))
|
|
(format #t "~1Tx: ~f~%" (-> this x))
|
|
(format #t "~1Ty: ~f~%" (-> this y))
|
|
(format #t "~1Tz: ~f~%" (-> this z))
|
|
(format #t "~1Tw: ~f~%" (-> this w))
|
|
(format #t "~1Tvec: #<vector @ #x~X>~%" (&-> this x))
|
|
(format #t "~1Tquad: ~D~%" (-> this quad))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for symbol *unity-quaternion*, type quaternion
|
|
(define *unity-quaternion* (new 'static 'quaternion :w 1.0))
|
|
|
|
;; failed to figure out what this is:
|
|
0
|