Files
jak-project/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc
T
water111 7348e6a4ff [decompiler] Update vector ops, reduce casts (#3849)
Update the decompiler to use the new vf macros.

Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

![image](https://github.com/user-attachments/assets/885bbb07-634f-47b8-99f5-5a947941cdde)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 16:32:58 -05:00

139 lines
3.7 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for function box-vector-enside?
(defun box-vector-enside? ((box bounding-box) (pt vector))
(and (< (-> box min x) (-> pt x))
(< (-> box min y) (-> pt y))
(< (-> box min z) (-> pt z))
(< (-> pt x) (-> box max x))
(< (-> pt y) (-> box max y))
(< (-> pt z) (-> box max z))
)
)
;; definition for function box-vector-inside?
(defun box-vector-inside? ((box bounding-box) (pt vector))
(and (>= (-> pt x) (-> box min x))
(>= (-> pt y) (-> box min y))
(>= (-> pt z) (-> box min z))
(>= (-> box max x) (-> pt x))
(>= (-> box max y) (-> pt y))
(>= (-> box max z) (-> pt z))
)
)
;; definition for method 11 of type bounding-box
;; ERROR: Failed load: (set! vf3 (l.vf a2-0)) at op 0
(defmethod set-from-point-offset! ((this bounding-box) (arg0 vector3s) (arg1 vector3s))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(.lvf vf3 arg1)
(.lvf vf4 arg0)
(.add.vf vf5 vf4 vf3)
(.min.vf vf1 vf4 vf5)
(.max.vf vf2 vf4 vf5)
(.mov.vf.w vf1 vf0)
(.mov.vf.w vf2 vf0)
(.svf (&-> this min quad) vf1)
(.svf (&-> this max quad) vf2)
0
)
)
;; definition for method 10 of type bounding-box
;; ERROR: Failed load: (set! vf3 (l.vf a1-0)) at op 2
(defmethod add-point! ((this bounding-box) (arg0 vector3s))
(rlet ((vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf1 (&-> this min quad))
(.lvf vf2 (&-> this max quad))
(.lvf vf3 arg0)
(.min.vf vf1 vf1 vf3)
(.max.vf vf2 vf2 vf3)
(.svf (&-> this min quad) vf1)
(.svf (&-> this max quad) vf2)
0
)
)
;; definition for method 15 of type bounding-box
(defmethod add-box! ((this bounding-box) (arg0 bounding-box))
(rlet ((vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf1 (&-> this min quad))
(.lvf vf2 (&-> this max quad))
(.lvf vf3 (&-> arg0 min quad))
(.lvf vf4 (&-> arg0 max quad))
(.min.vf vf1 vf1 vf3)
(.max.vf vf2 vf2 vf4)
(.svf (&-> this min quad) vf1)
(.svf (&-> this max quad) vf2)
0
)
)
;; definition for method 12 of type bounding-box
;; ERROR: Failed load: (set! vf4 (l.vf a2-0)) at op 0
(defmethod set-from-point-offset-pad! ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(.lvf vf4 arg1)
(.lvf vf5 arg0)
(.mov vf1 arg2)
(.add.vf vf6 vf5 vf4)
(.min.vf vf2 vf5 vf6)
(.max.vf vf3 vf5 vf6)
(.add.x.vf.xyz vf3 vf3 vf1)
(.sub.x.vf.xyz vf2 vf2 vf1)
(.mov.vf.w vf2 vf0)
(.mov.vf.w vf3 vf0)
(.svf (&-> this min quad) vf2)
(.svf (&-> this max quad) vf3)
0
)
)
;; definition for method 13 of type bounding-box
(defmethod set-from-sphere! ((this bounding-box) (arg0 sphere))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
)
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.sub.w.vf.xyz vf2 vf1 vf1)
(.add.w.vf.xyz vf3 vf1 vf1)
(.mov.vf.w vf2 vf0)
(.mov.vf.w vf3 vf0)
(.svf (&-> this min quad) vf2)
(.svf (&-> this max quad) vf3)
0
)
)
;; definition for method 14 of type bounding-box
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for method 9 of type bounding-box
;; ERROR: function was not converted to expressions. Cannot decompile.