;;-*-Lisp-*-
(in-package goal)

;; definition of type collide-sticky-rider
(deftype collide-sticky-rider (structure)
  ((rider-handle    handle                     :offset-assert   0)
   (sticky-prim     collide-shape-prim         :offset-assert   8)
   (prim-ry         float                      :offset-assert  12)
   (rider-local-pos vector             :inline :offset-assert  16)
   )
  :method-count-assert 10
  :size-assert         #x20
  :flag-assert         #xa00000020
  (:methods
    (set-rider! (_type_ handle) symbol 9)
    )
  )

;; definition for method 3 of type collide-sticky-rider
(defmethod inspect collide-sticky-rider ((obj collide-sticky-rider))
  (format #t "[~8x] ~A~%" obj 'collide-sticky-rider)
  (format #t "~Trider-handle: ~D~%" (-> obj rider-handle))
  (format #t "~Tsticky-prim: ~A~%" (-> obj sticky-prim))
  (format #t "~Tprim-ry: ~f~%" (-> obj prim-ry))
  (format #t "~Trider-local-pos: #<vector @ #x~X>~%" (-> obj rider-local-pos))
  obj
  )

;; definition for method 9 of type collide-sticky-rider
(defmethod set-rider! collide-sticky-rider ((obj collide-sticky-rider) (arg0 handle))
  (set! (-> obj rider-handle) arg0)
  (set! (-> obj sticky-prim) #f)
  #f
  )

;; definition of type collide-sticky-rider-group
(deftype collide-sticky-rider-group (basic)
  ((num-riders       int32                          :offset-assert   4)
   (allocated-riders int32                          :offset-assert   8)
   (rider            collide-sticky-rider 1 :inline :offset-assert  16)
   )
  :method-count-assert 11
  :size-assert         #x30
  :flag-assert         #xb00000030
  (:methods
    (new (symbol type int) _type_ 0)
    (add-rider! (_type_ process-drawable) collide-sticky-rider 9)
    (reset! (_type_) int 10)
    )
  )

;; definition for method 3 of type collide-sticky-rider-group
(defmethod inspect collide-sticky-rider-group ((obj collide-sticky-rider-group))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tnum-riders: ~D~%" (-> obj num-riders))
  (format #t "~Tallocated-riders: ~D~%" (-> obj allocated-riders))
  (format #t "~Trider[1] @ #x~X~%" (-> obj rider))
  obj
  )

;; definition for method 10 of type collide-sticky-rider-group
(defmethod reset! collide-sticky-rider-group ((obj collide-sticky-rider-group))
  (set! (-> obj num-riders) 0)
  0
  )

;; definition of type pull-rider-info
(deftype pull-rider-info (structure)
  ((rider          collide-sticky-rider         :offset-assert   0)
   (rider-cshape   collide-shape-moving         :offset-assert   4)
   (rider-delta-ry float                        :offset-assert   8)
   (rider-dest     vector               :inline :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x20
  :flag-assert         #x900000020
  )

;; definition for method 3 of type pull-rider-info
(defmethod inspect pull-rider-info ((obj pull-rider-info))
  (format #t "[~8x] ~A~%" obj 'pull-rider-info)
  (format #t "~Trider: #<collide-sticky-rider @ #x~X>~%" (-> obj rider))
  (format #t "~Trider-cshape: ~A~%" (-> obj rider-cshape))
  (format #t "~Trider-delta-ry: ~f~%" (-> obj rider-delta-ry))
  (format #t "~Trider-dest: #<vector @ #x~X>~%" (-> obj rider-dest))
  obj
  )

;; definition of type collide-shape-intersect
(deftype collide-shape-intersect (basic)
  ((move-vec       vector             :inline :offset-assert  16)
   (best-u         float                      :offset-assert  32)
   (best-tri       collide-tri-result :inline :offset-assert  48)
   (best-from-prim collide-shape-prim         :offset-assert 132)
   (best-to-prim   collide-shape-prim         :offset-assert 136)
   )
  :method-count-assert 10
  :size-assert         #x8c
  :flag-assert         #xa0000008c
  (:methods
    (init! (_type_ vector) symbol 9)
    )
  )

;; definition for method 3 of type collide-shape-intersect
(defmethod inspect collide-shape-intersect ((obj collide-shape-intersect))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tmove-vec: ~`vector`P~%" (-> obj move-vec))
  (format #t "~Tbest-u: ~f~%" (-> obj best-u))
  (format #t "~Tbest-tri: #<collide-tri-result @ #x~X>~%" (-> obj best-tri))
  (format #t "~Tbest-from-prim: ~A~%" (-> obj best-from-prim))
  (format #t "~Tbest-to-prim: ~A~%" (-> obj best-to-prim))
  obj
  )

;; definition of type collide-overlap-result
(deftype collide-overlap-result (structure)
  ((best-dist      float                      :offset-assert   0)
   (best-from-prim collide-shape-prim         :offset-assert   4)
   (best-to-prim   collide-shape-prim         :offset-assert   8)
   (best-from-tri  collide-tri-result :inline :offset-assert  16)
   )
  :method-count-assert 10
  :size-assert         #x64
  :flag-assert         #xa00000064
  (:methods
    (reset! (_type_) none 9)
    )
  )

;; definition for method 3 of type collide-overlap-result
(defmethod inspect collide-overlap-result ((obj collide-overlap-result))
  (format #t "[~8x] ~A~%" obj 'collide-overlap-result)
  (format #t "~Tbest-dist: ~f~%" (-> obj best-dist))
  (format #t "~Tbest-from-prim: ~A~%" (-> obj best-from-prim))
  (format #t "~Tbest-to-prim: ~A~%" (-> obj best-to-prim))
  (format #t "~Tbest-from-tri: #<collide-tri-result @ #x~X>~%" (-> obj best-from-tri))
  obj
  )

;; definition for method 9 of type collide-overlap-result
;; INFO: Return type mismatch symbol vs none.
(defmethod reset! collide-overlap-result ((obj collide-overlap-result))
  (set! (-> obj best-dist) 0.0)
  (set! (-> obj best-from-prim) #f)
  (set! (-> obj best-to-prim) #f)
  (none)
  )

;; definition of type overlaps-others-params
(deftype overlaps-others-params (structure)
  ((options uint32         :offset-assert   0)
   (tlist   touching-list  :offset-assert   4)
   )
  :method-count-assert 9
  :size-assert         #x8
  :flag-assert         #x900000008
  )

;; definition for method 3 of type overlaps-others-params
(defmethod inspect overlaps-others-params ((obj overlaps-others-params))
  (format #t "[~8x] ~A~%" obj 'overlaps-others-params)
  (format #t "~Toptions: ~D~%" (-> obj options))
  (format #t "~Ttlist: ~A~%" (-> obj tlist))
  obj
  )

;; definition for symbol *collide-hit-by-player-list*, type engine
(define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list 768))

;; definition for symbol *collide-usually-hit-by-player-list*, type engine
(define *collide-usually-hit-by-player-list* (new 'global 'engine 'collide-usually-hit-by-player-list 256))

;; definition for symbol *collide-hit-by-others-list*, type engine
(define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list 96))

;; definition for symbol *collide-player-list*, type engine
(define *collide-player-list* (new 'global 'engine 'collide-player-list 32))

;; definition of type collide-prim-core
(deftype collide-prim-core (structure)
  ((world-sphere vector          :inline :offset-assert   0)
   (collide-as   collide-kind            :offset-assert  16)
   (action       collide-action          :offset-assert  24)
   (offense      collide-offense         :offset-assert  28)
   (prim-type    int8                    :offset-assert  29)
   (extra        uint8           2       :offset-assert  30)
   (quad         uint128         2       :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x20
  :flag-assert         #x900000020
  )

;; definition for method 3 of type collide-prim-core
(defmethod inspect collide-prim-core ((obj collide-prim-core))
  (format #t "[~8x] ~A~%" obj 'collide-prim-core)
  (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj world-sphere))
  (format #t "~Tcollide-as: ~D~%" (-> obj collide-as))
  (format #t "~Taction: ~D~%" (-> obj action))
  (format #t "~Toffense: ~D~%" (-> obj offense))
  (format #t "~Tprim-type: ~D~%" (-> obj prim-type))
  (format #t "~Textra[2] @ #x~X~%" (-> obj extra))
  (format #t "~Tquad[2] @ #x~X~%" (-> obj world-sphere))
  obj
  )

;; definition of type collide-shape-prim
(deftype collide-shape-prim (basic)
  ((cshape          collide-shape             :offset-assert   4)
   (prim-id         uint32                    :offset-assert   8)
   (transform-index int8                      :offset-assert  12)
   (prim-core       collide-prim-core :inline :offset-assert  16)
   (local-sphere    vector            :inline :offset-assert  48)
   (collide-with    collide-kind              :offset-assert  64)
   (world-sphere    vector            :inline :offset         16)
   (collide-as      collide-kind              :offset         32)
   (action          collide-action            :offset         40)
   (offense         collide-offense           :offset         44)
   (prim-type       int8                      :offset         45)
   (radius          meters                    :offset         60)
   )
  :method-count-assert 28
  :size-assert         #x48
  :flag-assert         #x1c00000048
  (:methods
    (new (symbol type collide-shape uint int) _type_ 0)
    (move-by-vector! (_type_ vector) none 9)
    (find-prim-by-id (_type_ uint) collide-shape-prim 10)
    (debug-draw-world-sphere (_type_) symbol 11)
    (add-fg-prim-using-box (_type_ collide-cache) none 12)
    (add-fg-prim-using-line-sphere (_type_ collide-cache) none 13)
    (add-fg-prim-using-y-probe (_type_ collide-cache) none 14)
    (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15)
    (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16)
    (unused-17 () none 17)
    (collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18)
    (collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19)
    (add-to-bounding-box (_type_ collide-kind) symbol 20)
    (num-mesh (_type_ collide-shape-prim) int 21)
    (on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22)
    (should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23)
    (should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24)
    (update-transforms! (_type_ process-drawable) symbol 25)
    (set-collide-as! (_type_ collide-kind) none 26)
    (set-collide-with! (_type_ collide-kind) none 27)
    )
  )

;; definition for method 3 of type collide-shape-prim
(defmethod inspect collide-shape-prim ((obj collide-shape-prim))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tcshape: ~A~%" (-> obj cshape))
  (format #t "~Tprim-id: #x~X~%" (-> obj prim-id))
  (format #t "~Ttransform-index: ~D~%" (-> obj transform-index))
  (format #t "~Tprim-core: #<collide-prim-core @ #x~X>~%" (-> obj prim-core))
  (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere))
  (format #t "~Tcollide-with: ~D~%" (-> obj collide-with))
  (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core))
  (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as))
  (format #t "~Taction: ~D~%" (-> obj prim-core action))
  (format #t "~Toffense: ~D~%" (-> obj prim-core offense))
  (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type))
  (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w))
  obj
  )

;; definition of type collide-shape-prim-sphere
(deftype collide-shape-prim-sphere (collide-shape-prim)
  ((pat pat-surface  :offset-assert  72)
   )
  :method-count-assert 28
  :size-assert         #x4c
  :flag-assert         #x1c0000004c
  (:methods
    (new (symbol type collide-shape uint) _type_ 0)
    )
  )

;; definition for method 3 of type collide-shape-prim-sphere
(defmethod inspect collide-shape-prim-sphere ((obj collide-shape-prim-sphere))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tcshape: ~A~%" (-> obj cshape))
  (format #t "~Tprim-id: #x~X~%" (-> obj prim-id))
  (format #t "~Ttransform-index: ~D~%" (-> obj transform-index))
  (format #t "~Tprim-core: #<collide-prim-core @ #x~X>~%" (-> obj prim-core))
  (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere))
  (format #t "~Tcollide-with: ~D~%" (-> obj collide-with))
  (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core))
  (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as))
  (format #t "~Taction: ~D~%" (-> obj prim-core action))
  (format #t "~Toffense: ~D~%" (-> obj prim-core offense))
  (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type))
  (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w))
  (format #t "~Tpat: ~D~%" (-> obj pat))
  obj
  )

;; definition of type collide-shape-prim-mesh
(deftype collide-shape-prim-mesh (collide-shape-prim)
  ((mesh            collide-mesh                           :offset-assert  72)
   (mesh-id         int32                                  :offset-assert  76)
   (mesh-cache-id   uint64                                 :offset-assert  80)
   (mesh-cache-tris (inline-array collide-mesh-cache-tri)  :offset-assert  88)
   )
  :method-count-assert 29
  :size-assert         #x5c
  :flag-assert         #x1d0000005c
  (:methods
    (new (symbol type collide-shape uint uint) _type_ 0)
    (change-mesh (_type_ int) none 28)
    )
  )

;; definition for method 3 of type collide-shape-prim-mesh
(defmethod inspect collide-shape-prim-mesh ((obj collide-shape-prim-mesh))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tcshape: ~A~%" (-> obj cshape))
  (format #t "~Tprim-id: #x~X~%" (-> obj prim-id))
  (format #t "~Ttransform-index: ~D~%" (-> obj transform-index))
  (format #t "~Tprim-core: #<collide-prim-core @ #x~X>~%" (-> obj prim-core))
  (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere))
  (format #t "~Tcollide-with: ~D~%" (-> obj collide-with))
  (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core))
  (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as))
  (format #t "~Taction: ~D~%" (-> obj prim-core action))
  (format #t "~Toffense: ~D~%" (-> obj prim-core offense))
  (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type))
  (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w))
  (format #t "~Tmesh: ~A~%" (-> obj mesh))
  (format #t "~Tmesh-id: ~D~%" (-> obj mesh-id))
  (format #t "~Tmesh-cache-id: ~D~%" (-> obj mesh-cache-id))
  (format #t "~Tmesh-cache-tris: #x~X~%" (-> obj mesh-cache-tris))
  obj
  )

;; definition of type collide-shape-prim-group
(deftype collide-shape-prim-group (collide-shape-prim)
  ((num-prims       int32                       :offset-assert  72)
   (num-prims-u     uint32                      :offset         72)
   (allocated-prims int32                       :offset-assert  76)
   (prim            collide-shape-prim 1        :offset-assert  80)
   (prims           collide-shape-prim :dynamic :offset         80)
   )
  :method-count-assert 30
  :size-assert         #x54
  :flag-assert         #x1e00000054
  (:methods
    (new (symbol type collide-shape uint int) _type_ 0)
    (append-prim (_type_ collide-shape-prim) none 28)
    (add-to-non-empty-bounding-box (_type_ collide-kind) none 29)
    )
  )

;; definition for method 3 of type collide-shape-prim-group
(defmethod inspect collide-shape-prim-group ((obj collide-shape-prim-group))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tcshape: ~A~%" (-> obj cshape))
  (format #t "~Tprim-id: #x~X~%" (-> obj prim-id))
  (format #t "~Ttransform-index: ~D~%" (-> obj transform-index))
  (format #t "~Tprim-core: #<collide-prim-core @ #x~X>~%" (-> obj prim-core))
  (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere))
  (format #t "~Tcollide-with: ~D~%" (-> obj collide-with))
  (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core))
  (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as))
  (format #t "~Taction: ~D~%" (-> obj prim-core action))
  (format #t "~Toffense: ~D~%" (-> obj prim-core offense))
  (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type))
  (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w))
  (format #t "~Tnum-prims: ~D~%" (-> obj num-prims))
  (format #t "~Tallocated-prims: ~D~%" (-> obj allocated-prims))
  (format #t "~Tprim[1] @ #x~X~%" (-> obj prims))
  obj
  )

;; definition of type collide-shape
(deftype collide-shape (trsqv)
  ((process             process-drawable             :offset-assert 140)
   (max-iteration-count uint8                        :offset-assert 144)
   (nav-flags           nav-flags                    :offset-assert 145)
   (pad-byte            uint8                      2 :offset-assert 146)
   (pat-ignore-mask     pat-surface                  :offset-assert 148)
   (event-self          symbol                       :offset-assert 152)
   (event-other         symbol                       :offset-assert 156)
   (root-prim           collide-shape-prim           :offset-assert 160)
   (riders              collide-sticky-rider-group   :offset-assert 164)
   (backup-collide-as   collide-kind                 :offset-assert 168)
   (backup-collide-with collide-kind                 :offset-assert 176)
   )
  :method-count-assert 56
  :size-assert         #xb8
  :flag-assert         #x38000000b8
  (:methods
    (new (symbol type process-drawable collide-list-enum) _type_ 0)
    (move-by-vector! (_type_ vector) none 28)
    (alloc-riders (_type_ int) none 29)
    (move-to-point! (_type_ vector) none 30)
    (debug-draw (_type_) none 31)
    (fill-cache-for-shape! (_type_ float collide-kind) none 32)
    (fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33)
    (find-prim-by-id (_type_ uint) collide-shape-prim 34)
    (detect-riders! (_type_) symbol 35)
    (build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36)
    (integrate-and-collide! (_type_ vector) none 37)
    (find-collision-meshes (_type_) symbol 38)
    (on-platform (_type_ collide-shape collide-overlap-result) symbol 39)
    (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40)
    (dummy-41 (_type_ attack-info float) vector 41)
    (should-push-away (_type_ collide-shape collide-overlap-result) symbol 42)
    (pull-rider! (_type_ pull-rider-info) none 43)
    (pull-riders! (_type_) symbol 44)
    (do-push-aways! (_type_) symbol 45)
    (set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46)
    (update-transforms! (_type_) symbol 47)
    (clear-collide-with-as (_type_) none 48)
    (restore-collide-with-as (_type_) none 49)
    (backup-collide-with-as (_type_) none 50)
    (set-root-prim-collide-with! (_type_ collide-kind) none 51)
    (set-root-prim-collide-as! (_type_ collide-kind) none 52)
    (set-collide-kinds (_type_ int collide-kind collide-kind) none 53)
    (set-collide-offense (_type_ int collide-offense) none 54)
    (send-shove-back (_type_ process touching-shapes-entry float float float) none 55)
    )
  )

;; definition for method 3 of type collide-shape
(defmethod inspect collide-shape ((obj collide-shape))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
  (format #t "~Trot: ~`vector`P~%" (-> obj quat))
  (format #t "~Tscale: ~`vector`P~%" (-> obj scale))
  (format #t "~Tquat: #<quaternion @ #x~X>~%" (-> obj quat))
  (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance))
  (format #t "~Tnav-radius: (meters ~m)~%" (-> obj nav-radius))
  (format #t "~Ttransv: ~`vector`P~%" (-> obj transv))
  (format #t "~Trotv: ~`vector`P~%" (-> obj rotv))
  (format #t "~Tscalev: ~`vector`P~%" (-> obj scalev))
  (format #t "~Tdir-targ: #<quaternion @ #x~X>~%" (-> obj dir-targ))
  (format #t "~Tangle-change-time: ~D~%" (-> obj angle-change-time))
  (format #t "~Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff))
  (format #t "~Tprocess: ~A~%" (-> obj process))
  (format #t "~Tmax-iteration-count: ~D~%" (-> obj max-iteration-count))
  (format #t "~Tnav-flags: ~D~%" (-> obj nav-flags))
  (format #t "~Tpad-byte[2] @ #x~X~%" (-> obj pad-byte))
  (format #t "~Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask))
  (format #t "~Tevent-self: ~A~%" (-> obj event-self))
  (format #t "~Tevent-other: ~A~%" (-> obj event-other))
  (format #t "~Troot-prim: ~A~%" (-> obj root-prim))
  (format #t "~Triders: ~A~%" (-> obj riders))
  (format #t "~Tbackup-collide-as: ~D~%" (-> obj backup-collide-as))
  (format #t "~Tbackup-collide-with: ~D~%" (-> obj backup-collide-with))
  obj
  )

;; definition of type collide-shape-moving
(deftype collide-shape-moving (collide-shape)
  ((rider-time         time-frame                                                                                          :offset-assert 184)
   (rider-last-move    vector                                                                                    :inline   :offset-assert 192)
   (trans-old          vector                                                                                    3 :inline :offset-assert 208)
   (poly-pat           pat-surface                                                                                         :offset-assert 256)
   (cur-pat            pat-surface                                                                                         :offset-assert 260)
   (ground-pat         pat-surface                                                                                         :offset-assert 264)
   (status             cshape-moving-flags                                                                                 :offset-assert 272)
   (old-status         cshape-moving-flags                                                                                 :offset-assert 280)
   (prev-status        cshape-moving-flags                                                                                 :offset-assert 288)
   (reaction-flag      cshape-reaction-flags                                                                               :offset-assert 296)
   (reaction           (function collide-shape-moving collide-shape-intersect vector vector cshape-moving-flags)           :offset-assert 300)
   (no-reaction        (function collide-shape-moving collide-shape-intersect vector vector none)                          :offset-assert 304)
   (local-normal       vector                                                                                    :inline   :offset-assert 320)
   (surface-normal     vector                                                                                    :inline   :offset-assert 336)
   (poly-normal        vector                                                                                    :inline   :offset-assert 352)
   (ground-poly-normal vector                                                                                    :inline   :offset-assert 368)
   (ground-touch-point vector                                                                                    :inline   :offset-assert 384)
   (shadow-pos         vector                                                                                    :inline   :offset-assert 400)
   (ground-impact-vel  meters                                                                                              :offset-assert 416)
   (surface-angle      float                                                                                               :offset-assert 420)
   (poly-angle         float                                                                                               :offset-assert 424)
   (touch-angle        float                                                                                               :offset-assert 428)
   (coverage           float                                                                                               :offset-assert 432)
   (dynam              dynamics                                                                                            :offset-assert 436)
   (surf               surface                                                                                             :offset-assert 440)
   )
  :method-count-assert 65
  :size-assert         #x1bc
  :flag-assert         #x41000001bc
  (:methods
    (set-and-handle-pat! (_type_ pat-surface) none 56)
    (integrate-no-collide! (_type_ vector) none 57)
    (dummy-58 (_type_ vector) symbol 58)
    (integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59)
    (move-to-ground (_type_ float float symbol collide-kind) symbol 60)
    (move-to-ground-point! (_type_ vector vector vector) none 61)
    (compute-acc-due-to-gravity (_type_ vector float) vector 62)
    (step-collison! (_type_ vector vector float) float 63)
    (move-to-tri! (_type_ collide-tri-result vector) none 64)
    )
  )

;; definition for method 3 of type collide-shape-moving
(defmethod inspect collide-shape-moving ((obj collide-shape-moving))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
  (format #t "~Trot: ~`vector`P~%" (-> obj quat))
  (format #t "~Tscale: ~`vector`P~%" (-> obj scale))
  (format #t "~Tquat: #<quaternion @ #x~X>~%" (-> obj quat))
  (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance))
  (format #t "~Tnav-radius: (meters ~m)~%" (-> obj nav-radius))
  (format #t "~Ttransv: ~`vector`P~%" (-> obj transv))
  (format #t "~Trotv: ~`vector`P~%" (-> obj rotv))
  (format #t "~Tscalev: ~`vector`P~%" (-> obj scalev))
  (format #t "~Tdir-targ: #<quaternion @ #x~X>~%" (-> obj dir-targ))
  (format #t "~Tangle-change-time: ~D~%" (-> obj angle-change-time))
  (format #t "~Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff))
  (format #t "~Tprocess: ~A~%" (-> obj process))
  (format #t "~Tmax-iteration-count: ~D~%" (-> obj max-iteration-count))
  (format #t "~Tnav-flags: ~D~%" (-> obj nav-flags))
  (format #t "~Tpad-byte[2] @ #x~X~%" (-> obj pad-byte))
  (format #t "~Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask))
  (format #t "~Tevent-self: ~A~%" (-> obj event-self))
  (format #t "~Tevent-other: ~A~%" (-> obj event-other))
  (format #t "~Troot-prim: ~A~%" (-> obj root-prim))
  (format #t "~Triders: ~A~%" (-> obj riders))
  (format #t "~Tbackup-collide-as: ~D~%" (-> obj backup-collide-as))
  (format #t "~Tbackup-collide-with: ~D~%" (-> obj backup-collide-with))
  (format #t "~Trider-time: ~D~%" (-> obj rider-time))
  (format #t "~Trider-last-move: ~`vector`P~%" (-> obj rider-last-move))
  (format #t "~Ttrans-old[3] @ #x~X~%" (-> obj trans-old))
  (format #t "~Tpoly-pat: #x~X~%" (-> obj poly-pat))
  (format #t "~Tcur-pat: #x~X~%" (-> obj cur-pat))
  (format #t "~Tground-pat: #x~X~%" (-> obj ground-pat))
  (format #t "~Tstatus: ~D~%" (-> obj status))
  (format #t "~Told-status: ~D~%" (-> obj old-status))
  (format #t "~Tprev-status: ~D~%" (-> obj prev-status))
  (format #t "~Treaction-flag: ~D~%" (-> obj reaction-flag))
  (format #t "~Treaction: ~A~%" (-> obj reaction))
  (format #t "~Tno-reaction: ~A~%" (-> obj no-reaction))
  (format #t "~Tlocal-normal: ~`vector`P~%" (-> obj local-normal))
  (format #t "~Tsurface-normal: ~`vector`P~%" (-> obj surface-normal))
  (format #t "~Tpoly-normal: ~`vector`P~%" (-> obj poly-normal))
  (format #t "~Tground-poly-normal: ~`vector`P~%" (-> obj ground-poly-normal))
  (format #t "~Tground-touch-point: ~`vector`P~%" (-> obj ground-touch-point))
  (format #t "~Tshadow-pos: ~`vector`P~%" (-> obj shadow-pos))
  (format #t "~Tground-impact-vel: (meters ~m)~%" (-> obj ground-impact-vel))
  (format #t "~Tsurface-angle: ~f~%" (-> obj surface-angle))
  (format #t "~Tpoly-angle: ~f~%" (-> obj poly-angle))
  (format #t "~Ttouch-angle: ~f~%" (-> obj touch-angle))
  (format #t "~Tcoverage: ~f~%" (-> obj coverage))
  (format #t "~Tdynam: ~A~%" (-> obj dynam))
  (format #t "~Tsurf: ~A~%" (-> obj surf))
  obj
  )

;; definition for method 0 of type collide-shape-prim
(defmethod new collide-shape-prim ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint) (size-bytes int))
  (let ((v0-0 (object-new allocation type-to-make size-bytes)))
    (set! (-> v0-0 cshape) cshape)
    (set! (-> v0-0 prim-id) prim-id)
    (set! (-> v0-0 prim-core action) (collide-action))
    (set! (-> v0-0 prim-core collide-as) (collide-kind))
    (set! (-> v0-0 collide-with) (collide-kind))
    (set! (-> v0-0 transform-index) -2)
    (set! (-> v0-0 prim-core offense) (collide-offense no-offense))
    (set! (-> v0-0 prim-core prim-type) -2)
    v0-0
    )
  )

;; definition for method 0 of type collide-shape-prim-sphere
;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-sphere.
(defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint))
  (let ((obj (the-as
               collide-shape-prim-sphere
               ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id 76)
               )
             )
        )
    (set! (-> obj pat) (new 'static 'pat-surface :mode (pat-mode obstacle)))
    (set! (-> obj prim-core prim-type) -1)
    (the-as collide-shape-prim-sphere obj)
    )
  )

;; definition for method 0 of type collide-shape-prim-mesh
;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-mesh.
(defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (cshape collide-shape) (mesh-id uint) (prim-id uint))
  (let ((obj (the-as
               collide-shape-prim-mesh
               ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id 92)
               )
             )
        )
    (set! (-> obj mesh) #f)
    (set! (-> obj mesh-id) (the-as int mesh-id))
    (set! (-> obj mesh-cache-id) (the-as uint 0))
    (set! (-> obj prim-core prim-type) 1)
    (the-as collide-shape-prim-mesh obj)
    )
  )

;; definition for method 0 of type collide-shape-prim-group
;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-group.
(defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (cshape collide-shape) (elt-count uint) (prim-id int))
  (let ((obj (the-as collide-shape-prim-group ((method-of-type collide-shape-prim new)
                                               allocation
                                               type-to-make
                                               cshape
                                               (the-as uint prim-id)
                                               (the-as int (+ (-> type-to-make size) (* (+ elt-count -1) 4)))
                                               )
                     )
             )
        )
    (set! (-> obj allocated-prims) (the-as int elt-count))
    (set! (-> obj num-prims) 0)
    (set! (-> obj prim-core prim-type) 0)
    (while (nonzero? elt-count)
      (+! elt-count -1)
      (set! (-> obj prims elt-count) #f)
      (nop!)
      )
    (the-as collide-shape-prim-group obj)
    )
  )

;; definition for method 4 of type collide-shape-prim-group
(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group))
  (-> obj num-prims)
  )

;; definition for method 5 of type collide-shape-prim-group
;; INFO: Return type mismatch uint vs int.
(defmethod asize-of collide-shape-prim-group ((obj collide-shape-prim-group))
  (the-as int (+ (-> obj type size) (* (+ (-> obj allocated-prims) -1) 4)))
  )

;; definition for method 0 of type collide-shape
(defmethod new collide-shape ((allocation symbol) (type-to-make type) (proc process-drawable) (collide-list-kind collide-list-enum))
  (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
    (set! (-> obj process) proc)
    (set! (-> obj max-iteration-count) (the-as uint 1))
    (set! (-> obj nav-flags) (nav-flags navf0))
    (set! (-> obj event-self) #f)
    (set! (-> obj event-other) #f)
    (set! (-> obj riders) #f)
    (set! (-> obj root-prim) #f)
    (case (-> proc type symbol)
      (('camera)
       (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1))
       )
      (else
        (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :noentity #x1))
        )
      )
    (set! (-> obj trans w) 1.0)
    (quaternion-identity! (-> obj quat))
    (vector-identity! (-> obj scale))
    (cond
      ((= collide-list-kind (collide-list-enum hit-by-player))
       (add-connection *collide-hit-by-player-list* proc #f obj #f #f)
       )
      ((= collide-list-kind (collide-list-enum usually-hit-by-player))
       (add-connection *collide-usually-hit-by-player-list* proc #f obj #f #f)
       )
      ((= collide-list-kind (collide-list-enum hit-by-others))
       (add-connection *collide-hit-by-others-list* proc #f obj #f #f)
       )
      ((= collide-list-kind (collide-list-enum player))
       (add-connection *collide-player-list* proc #f obj #f #f)
       )
      (else
        (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%")
        )
      )
    obj
    )
  )

;; definition for method 0 of type collide-sticky-rider-group
(defmethod new collide-sticky-rider-group ((allocation symbol) (type-to-make type) (arg0 int))
  (let ((obj (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 32))))))
    (set! (-> obj allocated-riders) arg0)
    (set! (-> obj num-riders) 0)
    obj
    )
  )

;; definition for method 4 of type collide-sticky-rider-group
(defmethod length collide-sticky-rider-group ((obj collide-sticky-rider-group))
  (-> obj num-riders)
  )

;; definition for method 5 of type collide-sticky-rider-group
;; INFO: Return type mismatch uint vs int.
(defmethod asize-of collide-sticky-rider-group ((obj collide-sticky-rider-group))
  (the-as int (+ (-> obj type size) (* (+ (-> obj allocated-riders) -1) 32)))
  )

;; definition for symbol *collide-shape-prim-backgnd*, type collide-shape-prim-mesh
(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh
                                       :cshape #f
                                       :prim-core (new 'static 'collide-prim-core
                                         :world-sphere (new 'static 'vector :w 204800000.0)
                                         :collide-as (collide-kind background)
                                         :action (collide-action solid)
                                         :offense (collide-offense indestructible)
                                         :prim-type 2
                                         )
                                       :local-sphere (new 'static 'vector :w 204800000.0)
                                       :mesh #f
                                       )
        )

;; definition for symbol *collide-shape-prim-water*, type collide-shape-prim-mesh
(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh
                                     :cshape #f
                                     :prim-core (new 'static 'collide-prim-core
                                       :world-sphere (new 'static 'vector :w 204800000.0)
                                       :collide-as (collide-kind water)
                                       :action (collide-action solid)
                                       :offense (collide-offense indestructible)
                                       :prim-type 2
                                       )
                                     :local-sphere (new 'static 'vector :w 204800000.0)
                                     :mesh #f
                                     )
        )
