Files
jak-project/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc
T
Hat Kid 122de4ecf5 jak1: clean up control-info names and other misc cleanup (#4295)
After spending the last month staring at and comparing Jak 3 and Jak 1
versions of a bunch of `target` code for my jetboard mod, I figured this
would be a good opportunity to revive this ancient PR #1714 along with
some other small misc fixes/improvements.

Instead of directly replacing the old fields, I decided to opt for using
overlay fields to maintain backwards compatibility with existing manual
patches, files without ref tests and mods that might use these fields.
2026-05-31 15:08:41 +02:00

305 lines
26 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type collide-history
(deftype collide-history (structure)
((intersect vector :inline)
(trans vector :inline)
(transv vector :inline)
(transv-out vector :inline)
(local-normal vector :inline)
(surface-normal vector :inline)
(time time-frame)
(status cshape-moving-flags)
(pat pat-surface)
(reaction-flag cshape-reaction-flags)
)
(:methods
(update! (_type_ collide-shape-moving vector vector vector) _type_)
)
)
;; definition for method 3 of type collide-history
(defmethod inspect ((this collide-history))
(format #t "[~8x] ~A~%" this 'collide-history)
(format #t "~Tintersect: ~`vector`P~%" (-> this intersect))
(format #t "~Ttrans: ~`vector`P~%" (-> this trans))
(format #t "~Ttransv: ~`vector`P~%" (-> this transv))
(format #t "~Ttransv-out: ~`vector`P~%" (-> this transv-out))
(format #t "~Tlocal-normal: ~`vector`P~%" (-> this local-normal))
(format #t "~Tsurface-normal: ~`vector`P~%" (-> this surface-normal))
(format #t "~Ttime: ~D~%" (-> this time))
(format #t "~Tstatus: ~D~%" (-> this status))
(format #t "~Tpat: ~D~%" (-> this pat))
(format #t "~Treaction-flag: ~D~%" (-> this reaction-flag))
this
)
;; definition of type control-info
(deftype control-info (collide-shape-moving)
((unknown-vector00 vector :inline :offset 448)
(unknown-vector01 vector :inline :offset 464)
(unknown-vector02 vector :inline :offset 480)
(unknown-quaternion00 quaternion :inline :offset 496)
(unknown-quaternion01 quaternion :inline :offset 512)
(unknown-float00 float :offset 528)
(unknown-float01 float :offset 532)
(unknown-float02 float :offset 536)
(unknown-vector10 vector :inline :offset 544)
(unknown-vector11 vector :inline :offset 560)
(unknown-vector12 vector :inline :offset 576)
(unknown-vector13 vector :inline :offset 592)
(unknown-vector14 vector :inline :offset 608)
(unknown-vector15 vector :inline :offset 624)
(unknown-vector16 vector :inline :offset 640)
(unknown-dynamics00 dynamics :offset 656)
(unknown-surface00 surface :offset 660)
(unknown-surface01 surface :offset 664)
(unknown-cpad-info00 cpad-info :offset 668)
(unknown-float10 float :offset 672)
(unknown-float11 float :offset 676)
(unknown-float12 float :offset 680)
(unknown-float13 float :offset 684)
(unknown-vector20 vector :inline :offset 688)
(unknown-vector21 vector :inline :offset 704)
(unknown-vector22 vector :inline :offset 720)
(unknown-vector23 vector :inline :offset 736)
(unknown-vector-array00 vector 7 :inline :offset 752)
(unknown-vector30 vector :inline :offset 880)
(unknown-vector31 vector :inline :offset 896)
(unknown-float20 float :offset 912)
(unknown-float21 float :offset 916)
(unknown-dword00 uint64 :offset 920)
(unknown-matrix00 matrix :inline :offset 928)
(unknown-matrix01 matrix :inline :offset 992)
(unknown-matrix02 matrix :inline :offset 1056)
(unknown-qword00 uint128 :offset 1136)
(unknown-float30 float :offset 1140)
(unknown-vector40 vector :inline :offset 1152)
(unknown-float40 float :offset 1172)
(unknown-float41 float :offset 1176)
(unknown-int00 int32 :offset 1180)
(unknown-float50 float :offset 1168)
(unknown-vector50 vector :inline :offset 1184)
(unknown-vector51 vector :inline :offset 1200)
(unknown-vector52 vector :inline :offset 1216)
(unknown-vector53 vector :inline :offset 1232)
(last-known-safe-ground vector :inline :offset 1248)
(unknown-vector55 vector :inline :offset 1264)
(unknown-dword10 time-frame :offset 1280)
(unknown-dword11 time-frame :offset 1288)
(unknown-float60 float :offset 1300)
(unknown-float61 float :offset 1304)
(unknown-float62 float :offset 1308)
(unknown-float63 float :offset 1312)
(unknown-float64 float :offset 1316)
(unknown-dword20 time-frame :offset 1320)
(unknown-dword21 time-frame :offset 1328)
(unknown-dword-coverage int64 :offset 1336)
(unknown-float-coverage-0 float :offset 1344)
(unknown-float-coverage-1 float :offset 1348)
(unknown-float-coverage-2 float :offset 1352)
(unknown-u32-coverage-0 uint32 :offset 1356)
(unknown-vector-coverage-0 vector :inline :offset 1376)
(unknown-vector-coverage-1 vector :inline :offset 1392)
(unknown-vector-coverage-2 vector :inline :offset 1440)
(unknown-vector-coverage-3 vector :inline :offset 1472)
(unknown-vector60 vector :inline :offset 1456)
(unknown-vector61 vector :inline :offset 1504)
(unknown-float70 float :offset 1520)
(unknown-float71 float :offset 1524)
(unknown-vector70 vector :inline :offset 1536)
(unknown-vector71 vector :inline :offset 1552)
(unknown-vector72 vector :inline :offset 1568)
(unknown-vector73 vector :inline :offset 1584)
(unknown-handle00 handle :offset 1600)
(unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608)
(unknown-sphere00 collide-shape-prim-sphere :offset 1632)
(unknown-sphere01 collide-shape-prim-sphere :offset 1636)
(unknown-sphere02 collide-shape-prim-sphere :offset 1640)
(unknown-int50 int32 :offset 1656)
(unknown-dword30 time-frame :offset 1664)
(unknown-dword31 time-frame :offset 1672)
(unknown-dword32 time-frame :offset 1680)
(unknown-dword33 time-frame :offset 1688)
(unknown-dword34 time-frame :offset 1696)
(unknown-dword35 time-frame :offset 1704)
(unknown-dword36 time-frame :offset 1712)
(unknown-float80 float :offset 1724)
(unknown-float81 float :offset 1728)
(unknown-float82 float :offset 1732)
(unknown-vector80 vector :inline :offset 1744)
(unknown-cspace00 cspace :inline :offset 1760)
(unknown-vector90 vector :inline :offset 1776)
(unknown-vector91 vector :inline :offset 1792)
(unknown-vector92 vector :inline :offset 1824)
(unknown-cspace10 cspace :inline :offset 1808)
(unknown-symbol00 symbol :offset 1840)
(unknown-float90 float :offset 1844)
(unknown-float91 float :offset 1848)
(unknown-vector-array10 vector 16 :inline :offset 1856)
(unknown-float100 float :offset 2112)
(unknown-int10 int32 :offset 2116)
(unknown-float110 float :offset 2120)
(unknown-vector100 vector :inline :offset 2128)
(unknown-vector101 vector :inline :offset 2144)
(unknown-dword40 time-frame :offset 2160)
(unknown-dword41 time-frame :offset 2168)
(unknown-handle10 handle :offset 2176)
(unknown-uint20 uint32 :offset 2184)
(unknown-spoolanim00 spool-anim :overlay-at unknown-uint20)
(unknown-int20 int32 :overlay-at unknown-spoolanim00)
(unknown-symbol20 symbol :overlay-at unknown-int20)
(unknown-float120 float :overlay-at unknown-symbol20)
(unknown-int21 int32 :offset 2188)
(unknown-uint30 uint32 :overlay-at unknown-int21)
(unknown-float121 float :overlay-at unknown-uint30)
(unknown-uint31 uint32 :offset 2192)
(unknown-int37 int32 :overlay-at unknown-uint31)
(unknown-float122 float :offset 2196)
(unknown-float123 float :offset 2200)
(unknown-float124 float :offset 2204)
(unknown-vector102 vector :inline :offset 2224)
(unknown-vector103 vector :inline :offset 2240)
(unknown-quaternion02 quaternion :inline :offset 2256)
(unknown-quaternion03 quaternion :inline :offset 2272)
(unknown-smush00 smush-control :inline :offset 2288)
(unknown-vector110 vector :inline :offset 2320)
(unknown-vector111 vector :inline :offset 2336)
(unknown-symbol30 symbol :offset 2384)
(unknown-int31 uint32 :overlay-at unknown-symbol30)
(unknown-dword50 int64 :offset 2392)
(unknown-dword51 int64 :offset 2400)
(unknown-pointer00 pointer :offset 2416)
(unknown-symbol40 symbol :offset 2428)
(unknown-dword60 int64 :offset 2432)
(unknown-dword61 int64 :offset 2440)
(unknown-dword62 int64 :offset 2448)
(unknown-dword63 int64 :offset 2456)
(unknown-halfword00 int16 :offset 2488)
(history-length int16 :offset 2490)
(history-data collide-history 128 :inline)
(unknown-float140 float :offset 18944)
(unknown-dword70 time-frame :offset 18952)
(unknown-int40 int32 :offset 18880)
(unknown-dword80 time-frame :offset 18888)
(unknown-dword81 time-frame :offset 18896)
(unknown-float130 float :offset 18904)
(unknown-float131 float :offset 18908)
(unknown-dword82 time-frame :offset 18912)
(unknown-vector120 vector :inline :offset 18928)
(unknown-float150 float :overlay-at unknown-float140)
(unknown-vector121 vector :inline :offset 18960)
(wall-pat pat-surface :offset 18976)
(unknown-soundid00 sound-id :offset 18980)
(unknown-float141 float :offset 18984)
(unknown-soundid01 sound-id :offset 18988)
(unknown-int34 int32 :offset 18992)
(unknown-int35 int32 :offset 18996)
(unknown-int36 int32 :offset 19000)
(transv-ctrl vector :inline :overlay-at unknown-vector00)
(target-transv vector :inline :overlay-at unknown-vector01)
(bent-gravity-normal vector :inline :overlay-at unknown-vector02)
(last-transv vector :inline :overlay-at unknown-vector10)
(draw-offset vector :inline :overlay-at unknown-vector11)
(cspace-offset vector :inline :overlay-at unknown-vector12)
(anim-collide-offset-world vector :inline :overlay-at unknown-vector14)
(old-anim-collide-offset-world vector :inline :overlay-at unknown-vector15)
(anim-collide-offset-delta-world vector :inline :overlay-at unknown-vector16)
(to-target-pt-xz vector :inline :overlay-at unknown-vector20)
(last-to-target-pt-xz vector :inline :overlay-at unknown-vector21)
(turn-to-target vector :inline :overlay-at unknown-vector22)
(last-turn-to-target vector :inline :overlay-at unknown-vector23)
(pad-xz-dir vector :inline :overlay-at unknown-vector30)
(last-pad-xz-dir vector :inline :overlay-at unknown-vector31)
(force-turn-to-direction vector :inline :overlay-at unknown-vector40)
(gravity-normal vector :inline :overlay-at unknown-vector50)
(last-gravity-normal vector :inline :overlay-at unknown-vector51)
(last-trans-any-surf vector :inline :overlay-at unknown-vector52)
(ground-contact-normal vector :inline :overlay-at unknown-vector53)
(ground-contact-sphere-center vector :inline :overlay-at unknown-vector55)
(low-coverage-tangent vector :inline :overlay-at unknown-vector60)
(btransv vector :inline :overlay-at unknown-vector61)
(wall-contact-pt vector :inline :overlay-at unknown-vector70)
(wall-contact-poly-normal vector :inline :overlay-at unknown-vector71)
(actor-contact-pt vector :inline :overlay-at unknown-vector72)
(actor-contact-normal vector :inline :overlay-at unknown-vector73)
(ctrl-to-hands-offset vector :inline :overlay-at unknown-vector91)
(edge-grab-edge-dir vector :inline :overlay-at unknown-vector100)
(edge-grab-across-edge-dir vector :inline :overlay-at unknown-vector101)
(low-coverage-overhang-plane-normal vector :inline :overlay-at unknown-vector-coverage-2)
(low-coverage-tangent-xz vector :inline :overlay-at unknown-vector-coverage-3)
(last-trans-leaving-surf vector :inline :overlay-at unknown-vector110)
(highest-jump-mark vector :inline :overlay-at unknown-vector111)
(wall-contact-normal vector :inline :overlay-at unknown-vector121)
(quat-for-control quaternion :inline :overlay-at unknown-quaternion00)
(override-quat quaternion :inline :overlay-at unknown-quaternion01)
(w-R-c matrix :inline :overlay-at unknown-matrix00)
(c-R-w matrix :inline :overlay-at unknown-matrix01)
(ctrl-orientation matrix :inline :overlay-at unknown-matrix02)
(mod-surface surface :overlay-at unknown-surface00)
(current-surface surface :overlay-at unknown-surface01)
(override-quat-alpha float :overlay-at unknown-float00)
(ctrl-xz-vel float :overlay-at unknown-float01)
(velocity-after-thrust float :overlay-at unknown-float02)
(turn-to-angle float :overlay-at unknown-float10)
(last-turn-to-angle float :overlay-at unknown-float11)
(turn-to-magnitude float :overlay-at unknown-float12)
(last-turn-to-magnitude float :overlay-at unknown-float13)
(pad-magnitude float :overlay-at unknown-float20)
(last-pad-magnitude float :overlay-at unknown-float21)
(smack-speed-lerp-min float :overlay-at unknown-float40)
(force-turn-to-strength float :overlay-at unknown-float41)
(force-turn-to-speed float :overlay-at unknown-float50)
(ground-local-norm-dot-grav float :overlay-at unknown-float60)
(local-slope-z float :overlay-at unknown-float61)
(local-slope-x float :overlay-at unknown-float62)
(surface-slope-z float :overlay-at unknown-float63)
(surface-slope-x float :overlay-at unknown-float64)
(blocked-factor float :overlay-at unknown-float70)
(blocked-in-air-factor float :overlay-at unknown-float71)
(bend-amount float :overlay-at unknown-float80)
(bend-target float :overlay-at unknown-float81)
(bend-speed float :overlay-at unknown-float82)
(average-xz-vel float :overlay-at unknown-float100)
(low-coverage-slope-to-next1 float :overlay-at unknown-float-coverage-0)
(low-coverage-slope-to-next2 float :overlay-at unknown-float-coverage-2)
(idx-of-fastest-xz-vel int32 :overlay-at unknown-int10)
(did-move-to-pole-or-max-jump-height int32 :overlay-at unknown-float121)
(remaining-ctrl-iterations int32 :overlay-at unknown-int40)
(history-data-idx int16 :overlay-at unknown-halfword00)
(time-of-last-pad-read time-frame :overlay-at unknown-dword00)
(last-time-on-ground time-frame :overlay-at unknown-dword10)
(last-time-on-surface time-frame :overlay-at unknown-dword11)
(last-time-touching-actor time-frame :overlay-at unknown-dword20)
(time-of-last-lc time-frame :overlay-at unknown-dword21)
(last-attack-end-time time-frame :overlay-at unknown-dword33)
(last-time-of-stuck time-frame :overlay-at unknown-dword36)
(last-successful-compute-edge-time time-frame :overlay-at unknown-dword40)
(target-attack-id int64 :overlay-at unknown-dword50)
(attack-count int64 :overlay-at unknown-dword51)
(actor-contact-handle handle :overlay-at unknown-handle00)
(danger-mode symbol :overlay-at unknown-int31)
(cpad cpad-info :overlay-at unknown-cpad-info00)
(standard-dynamics dynamics :overlay-at unknown-dynamics00)
(transv-history vector 16 :inline :overlay-at (-> unknown-vector-array10 0))
(camera-pos vector :inline :overlay-at unknown-qword00)
)
)
;; definition for method 9 of type collide-history
;; INFO: Used lq/sq
(defmethod update! ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector))
(set! (-> this intersect quad) (-> xs quad))
(set! (-> this transv quad) (-> transv quad))
(set! (-> this transv-out quad) (-> transv-out quad))
(set! (-> this trans quad) (-> cshape trans quad))
(set! (-> this local-normal quad) (-> cshape local-normal quad))
(set! (-> this surface-normal quad) (-> cshape surface-normal quad))
(set-time! (-> this time))
(set! (-> this status) (-> cshape status))
(set! (-> this reaction-flag) (-> cshape reaction-flag))
(set! (-> this pat) (-> cshape cur-pat))
this
)