jak-project/goal_src/engine/collide/collide-target-h.gc
water111 fef7fad65a
[decompiler] process-drawable-h (#561)
* decomile process-drawable-h

* one more
2021-06-05 23:55:36 -04:00

61 lines
2.1 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: collide-target-h.gc
;; name in dgo: collide-target-h
;; dgos: GAME, ENGINE
;;-*-Lisp-*-
(in-package goal)
;; We believe that target's control-info may contain an array of these.
;; Each collide-history is a record of a single collision event.
(deftype collide-history (structure)
((intersect vector :inline :offset-assert 0)
(trans vector :inline :offset-assert 16)
(transv vector :inline :offset-assert 32)
(transv-out vector :inline :offset-assert 48)
(local-normal vector :inline :offset-assert 64)
(surface-normal vector :inline :offset-assert 80)
(time uint64 :offset-assert 96)
(status uint64 :offset-assert 104)
(pat uint32 :offset-assert 112)
(reaction-flag uint32 :offset-assert 116)
)
:method-count-assert 10
:size-assert #x78
:flag-assert #xa00000078
(:methods
(update! (_type_ collide-shape-moving vector vector vector) _type_ 9)
)
)
(deftype control-info (collide-shape-moving)
(
;; these were determined from racer-collision-reaction.
(array-size int16 :offset 2490)
(history-array collide-history 128 :inline :offset-assert 2496)
;; what's on the end?
(pad uint32 27)
)
:size-assert #x4a2c
:method-count-assert 65
:flag-assert #x4100004a2c
)
(defmethod update! collide-history ((obj collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector))
"Update the collide-history element."
(set! (-> obj intersect quad) (-> xs quad))
(set! (-> obj transv quad) (-> transv quad))
(set! (-> obj transv-out quad) (-> transv-out quad))
(set! (-> obj trans quad) (-> cshape trans quad))
(set! (-> obj local-normal quad) (-> cshape local-normal quad))
(set! (-> obj surface-normal quad) (-> cshape surface-normal quad))
(set! (-> obj time) (-> *display* base-frame-counter))
(set! (-> obj status) (-> cshape status))
(set! (-> obj reaction-flag) (-> cshape reaction-flag))
(set! (-> obj pat) (-> cshape cur-pat))
obj
)