Files
jak-project/test/goalc/source_templates/with_game/test-vector-int-float-conversions.gc
T
water111 8775840265 [Decomp] Decompile engine math library types (#272)
* decompile some stuff

* fix typo

* playing around with trigonometry

* more progress on trig

* more trig

* comments and small fixes

* finish trig
2021-02-20 11:42:46 -05:00

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