Files
jak-project/test/decompiler/reference/jak3/engine/math/quaternion-h_REF.gc
T
Hat Kid 9a4929ac0c decomp3: some engine files (#3319)
- `vector-h`
- `gravity-h`
- `bounding-box-h`
- `matrix-h`
- `quaternion-h`
- `euler-h`
- `transform-h`
- `geometry-h`
- `trigonometry-h`
- `transformq-h`
- `bounding-box`
- `matrix`
- `matrix-compose`
- `transform`
- `quaternion`
- `euler`
- `trigonometry`

Not a whole lot of changes, just a couple of new functions and one new
file (`matrix-compose`).
2024-01-20 10:42:51 -05:00

45 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: 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