mirror of
https://github.com/open-goal/jak-project
synced 2026-08-16 21:28:00 -04:00
8775840265
* decompile some stuff * fix typo * playing around with trigonometry * more progress on trig * more trig * comments and small fixes * finish trig
29 lines
647 B
Common Lisp
29 lines
647 B
Common Lisp
(defmacro print-vf (vf)
|
|
`(let ((temp (new 'stack 'vector)))
|
|
(.svf temp ,vf)
|
|
(format #t "~f ~f ~f ~f~%" (-> temp x) (-> temp y) (-> temp z) (-> temp w))
|
|
)
|
|
)
|
|
|
|
(defmacro print-vf-hex (vf)
|
|
`(let ((temp (new 'stack 'vector4w)))
|
|
(.svf temp ,vf)
|
|
(format #t "~d ~d ~d ~d~%" (-> temp data 0) (-> temp data 1) (-> temp data 2) (-> temp data 3))
|
|
)
|
|
)
|
|
|
|
|
|
(defun itof-test ()
|
|
(rlet ((vf1 :class vf)
|
|
(vf2 :class vf))
|
|
(.lvf vf1 (new 'static 'vector :x 1.0 :y -2.0 :z 3.0 :w 4.0))
|
|
(.ftoi.vf vf2 vf1)
|
|
(print-vf vf1)
|
|
(print-vf-hex vf2)
|
|
(.itof.vf vf2 vf2)
|
|
(print-vf vf2)
|
|
)
|
|
)
|
|
|
|
(itof-test)
|
|
0 |