mirror of
https://github.com/open-goal/jak-project
synced 2026-09-11 20:41:41 -04:00
2969833b2d
- `speech` - `ambient` - `water-h` - `vol-h` - `generic-obs` - `carry-h` - `pilot-h` - `board-h` - `gun-h` - `flut-h` - `indax-h` - `lightjak-h` - `darkjak-h` - `target-util` - `history` - `collide-reaction-target` - `logic-target` - `sidekick` - `projectile` - `voicebox` - `ragdoll-edit` - most of `ragdoll` (not added to gsrc yet) - `curves` - `find-nearest` - `lightjak-wings` - `target-handler` - `target-anim` - `target` - `target2` - `target-swim` - `target-lightjak` - `target-invisible` - `target-death` - `target-gun` - `gun-util` - `board-util` - `target-board` - `board-states` - `mech-h` - `vol` - `vent` - `viewer` - `gem-pool` - `collectables` - `crates` - `secrets-menu` Additionally: - Detection of non-virtual state inheritance - Added a config file that allows overriding the process stack size set by `stack-size-set!` calls - Fix for integer multiplication with `r0` - Fixed detection for the following macros: - `static-attack-info` - `defpart` and `defpartgroup` (probably still needs adjustments, uses Jak 2 implementation at the moment) - `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a `sound-group` of 0, so the macro has been temporarily defaulted to use that) One somewhat significant change made here that should be noted is that the return type of `process::init-from-entity!` was changed to `object`. I've been thinking about this for a while, since it looks a bit nicer without the `(none)` at the end and I have recently encountered init methods that early return `0`.
249 lines
9.3 KiB
Common Lisp
Vendored
Generated
249 lines
9.3 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type collide-puss-sphere
|
|
(deftype collide-puss-sphere (structure)
|
|
"A query sphere from the user for the porbe-using-spheres query.
|
|
This is used internally by the collide-cache implementation."
|
|
((bsphere sphere :inline)
|
|
(bbox4w bounding-box4w :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-puss-sphere
|
|
(defmethod inspect ((this collide-puss-sphere))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-puss-sphere)
|
|
(format #t "~1Tbsphere: #<sphere @ #x~X>~%" (-> this bsphere))
|
|
(format #t "~1Tbbox4w: #<bounding-box4w @ #x~X>~%" (-> this bbox4w))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-puss-work
|
|
(deftype collide-puss-work (structure)
|
|
"Scratchpad memory map for probe-using-spheres query."
|
|
((closest-pt vector :inline)
|
|
(tri-normal vector :inline)
|
|
(tri-bbox4w bounding-box4w :inline)
|
|
(spheres-bbox4w bounding-box4w :inline)
|
|
(spheres collide-puss-sphere 64 :inline)
|
|
)
|
|
(:methods
|
|
(check-mesh-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol)
|
|
(check-sphere-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-puss-work
|
|
(defmethod inspect ((this collide-puss-work))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-puss-work)
|
|
(format #t "~1Tclosest-pt: #<vector @ #x~X>~%" (-> this closest-pt))
|
|
(format #t "~1Ttri-normal: #<vector @ #x~X>~%" (-> this tri-normal))
|
|
(format #t "~1Ttri-bbox4w: #<bounding-box4w @ #x~X>~%" (-> this tri-bbox4w))
|
|
(format #t "~1Tspheres-bbox4w: #<bounding-box4w @ #x~X>~%" (-> this spheres-bbox4w))
|
|
(format #t "~1Tspheres[64] @ #x~X~%" (-> this spheres))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-cache-tri
|
|
(deftype collide-cache-tri (structure)
|
|
"A single triangle inside the collision cache.
|
|
Contains a reference back to the source object (like a collide-shape or water-control), and the prim itself."
|
|
((vertex vector 3 :inline)
|
|
(extra-quad uint8 16)
|
|
(pat pat-surface :overlay-at (-> extra-quad 0))
|
|
(collide-ptr basic :overlay-at (-> extra-quad 4))
|
|
(prim-index uint16 :overlay-at (-> extra-quad 8))
|
|
(user16 uint16 :overlay-at (-> extra-quad 10))
|
|
(user32 uint32 :overlay-at (-> extra-quad 12))
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-cache-tri
|
|
(defmethod inspect ((this collide-cache-tri))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-cache-tri)
|
|
(format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex))
|
|
(format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad))
|
|
(format #t "~1Tpat: ~D~%" (-> this pat))
|
|
(format #t "~1Tcollide-ptr: ~A~%" (-> this collide-ptr))
|
|
(format #t "~1Tprim-index: ~D~%" (-> this prim-index))
|
|
(format #t "~1Tuser16: ~D~%" (-> this user16))
|
|
(format #t "~1Tuser32: ~D~%" (-> this user32))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-cache-prim
|
|
(deftype collide-cache-prim (structure)
|
|
"A primitive inside the collide-cache.
|
|
This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere."
|
|
((prim-core collide-prim-core :inline)
|
|
(extra-quad uint8 16)
|
|
(ccache collide-cache :overlay-at (-> extra-quad 0))
|
|
(prim collide-shape-prim :overlay-at (-> extra-quad 4))
|
|
(first-tri uint16 :overlay-at (-> extra-quad 8))
|
|
(num-tris uint16 :overlay-at (-> extra-quad 10))
|
|
(unused uint8 4 :overlay-at (-> extra-quad 12))
|
|
(world-sphere vector :inline :overlay-at (-> prim-core world-sphere))
|
|
(collide-as collide-spec :overlay-at (-> prim-core collide-as))
|
|
(action collide-action :overlay-at (-> prim-core action))
|
|
(prim-type prim-type :overlay-at (-> prim-core prim-type))
|
|
)
|
|
(:methods
|
|
(collide-cache-prim-method-9 () none)
|
|
(collide-cache-prim-method-10 () none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-cache-prim
|
|
(defmethod inspect ((this collide-cache-prim))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-cache-prim)
|
|
(format #t "~1Tprim-core: #<collide-prim-core @ #x~X>~%" (-> this prim-core))
|
|
(format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad))
|
|
(format #t "~1Tccache: ~A~%" (-> this ccache))
|
|
(format #t "~1Tprim: ~A~%" (-> this prim))
|
|
(format #t "~1Tfirst-tri: ~D~%" (-> this first-tri))
|
|
(format #t "~1Tnum-tris: ~D~%" (-> this num-tris))
|
|
(format #t "~1Tunused[4] @ #x~X~%" (-> this unused))
|
|
(format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core))
|
|
(format #t "~1Tcollide-as: ~D~%" (-> this prim-core collide-as))
|
|
(format #t "~1Taction: ~D~%" (-> this prim-core action))
|
|
(format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-cache
|
|
(deftype collide-cache (basic)
|
|
"The collide-cache is a structure to accelerate collision queries.
|
|
In particular, it helps with queries where you don't know what you might hit.
|
|
It can detect collision with the background geometry, foreground dynamic collision shapes (spheres and meshes), and water.
|
|
To use it, it must first be 'filled' with geometry. Then you can manually inspect the geometry, or use one of the queries.
|
|
The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything).
|
|
It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'."
|
|
((num-tris int32)
|
|
(num-prims int32)
|
|
(ignore-mask pat-surface)
|
|
(ignore-processes process 2)
|
|
(collide-box bounding-box :inline)
|
|
(collide-box4w bounding-box4w :inline)
|
|
(collide-with collide-spec)
|
|
(unused uint32)
|
|
(prims collide-cache-prim 100 :inline)
|
|
(tris collide-cache-tri 461 :inline)
|
|
)
|
|
(:methods
|
|
(collide-cache-method-9 () none)
|
|
(fill-and-probe-using-line-sphere (_type_ collide-query) float)
|
|
(fill-and-probe-using-spheres (_type_ collide-query) symbol)
|
|
(collide-cache-method-12 () none)
|
|
(fill-using-line-sphere (_type_ collide-query) none)
|
|
(collide-cache-method-14 () none)
|
|
(collide-cache-method-15 () none)
|
|
(probe-using-line-sphere (_type_ collide-query) float)
|
|
(collide-cache-method-17 () none)
|
|
(collide-cache-method-18 () none)
|
|
(collide-cache-method-19 () none)
|
|
(collide-cache-method-20 () none)
|
|
(collide-cache-method-21 () none)
|
|
(collide-cache-method-22 () none)
|
|
(collide-cache-method-23 () none)
|
|
(collide-cache-method-24 () none)
|
|
(collide-cache-method-25 () none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-cache
|
|
(defmethod inspect ((this collide-cache))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~1Tnum-tris: ~D~%" (-> this num-tris))
|
|
(format #t "~1Tnum-prims: ~D~%" (-> this num-prims))
|
|
(format #t "~1Tignore-mask: ~D~%" (-> this ignore-mask))
|
|
(format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes))
|
|
(format #t "~1Tcollide-box: #<bounding-box @ #x~X>~%" (-> this collide-box))
|
|
(format #t "~1Tcollide-box4w: #<bounding-box4w @ #x~X>~%" (-> this collide-box4w))
|
|
(format #t "~1Tcollide-with: ~D~%" (-> this collide-with))
|
|
(format #t "~1Tunused: ~D~%" (-> this unused))
|
|
(format #t "~1Tprims[100] @ #x~X~%" (-> this prims))
|
|
(format #t "~1Ttris[461] @ #x~X~%" (-> this tris))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-list-item
|
|
(deftype collide-list-item (structure)
|
|
"Entry on the broad-phase collision list.
|
|
Can represent instanced collision, as a TIE instance, or a single non-instanced mesh fragment."
|
|
((mesh instance-tie)
|
|
(inst basic)
|
|
)
|
|
:pack-me
|
|
)
|
|
|
|
;; definition for method 3 of type collide-list-item
|
|
(defmethod inspect ((this collide-list-item))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-list-item)
|
|
(format #t "~1Tmesh: ~A~%" (-> this mesh))
|
|
(format #t "~1Tinst: ~A~%" (-> this inst))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-list
|
|
(deftype collide-list (structure)
|
|
"List of items returned by the broad-phase collision query."
|
|
((num-items int32)
|
|
(items collide-list-item 256 :inline :offset 16)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-list
|
|
(defmethod inspect ((this collide-list))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-list)
|
|
(format #t "~1Tnum-items: ~D~%" (-> this num-items))
|
|
(format #t "~1Titems[256] @ #x~X~%" (-> this items))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(kmemopen global "collide-cache-buffers")
|
|
|
|
;; definition (perm) for symbol *collide-cache*, type collide-cache
|
|
(define-perm *collide-cache* collide-cache (new 'global 'collide-cache))
|
|
|
|
;; definition (perm) for symbol *collide-list*, type collide-list
|
|
(define-perm *collide-list* collide-list (new 'global 'collide-list))
|
|
|
|
;; failed to figure out what this is:
|
|
(kmemclose)
|