jak-project/goal_src/jak3/engine/anim/aligner-h.gc

89 lines
1.8 KiB
Common Lisp
Raw Normal View History

2023-10-10 09:41:05 -04:00
;;-*-Lisp-*-
(in-package goal)
;; name: aligner-h.gc
;; name in dgo: aligner-h
;; dgos: GAME
(defenum align-flags
:bitfield #t
:type uint32
(disabled) ;; keep object velocity
(af01)
(af02)
(af03)
(af04)
(af05)
)
;; +++align-opts
(defenum align-opts
:bitfield #t
:type uint32
(adjust-x-vel)
(adjust-y-vel)
(adjust-xz-vel)
(keep-other-velocities)
(adjust-quat) ;; 16
(alop0)
(alop1)
(alop2)
(alop3)
(alop4)
(alop5)
(no-gravity)
(ignore-y-if-zero)
)
;; ---align-opts
;; +++align-flags
(defenum align-flags
:bitfield #t
:type uint32
(disabled) ;; keep object velocity
(af01)
(af02)
(af03)
(af04)
(af05)
)
;; ---align-flags
2023-10-10 09:41:05 -04:00
;; DECOMP BEGINS
(deftype align-control (basic)
((flags align-flags)
(process process-drawable)
(frame-group art-joint-anim)
(frame-num float)
(matrix matrix 2 :inline)
(transform transform 2 :inline)
(delta transformq :inline)
(last-speed meters)
(align transformq :inline :overlay-at (-> transform 0 trans data 0))
)
(:methods
(new (symbol type process) _type_)
decomp3: more engine stuff, detect non-virtual state inheritance (#3377) - `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`.
2024-03-03 15:15:27 -05:00
(compute-alignment! (_type_) transformq)
(align! (_type_ align-opts float float float) trsqv)
(align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv)
(first-transform (_type_) transform)
(second-transform (_type_) transform)
)
)
;; WARN: Return type mismatch object vs align-control.
(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process))
decomp3: more engine stuff, detect non-virtual state inheritance (#3377) - `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`.
2024-03-03 15:15:27 -05:00
(let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(when (zero? this)
(go process-drawable-art-error "memory")
(return (the-as align-control 0))
)
decomp3: more engine stuff, detect non-virtual state inheritance (#3377) - `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`.
2024-03-03 15:15:27 -05:00
(set! (-> this process) (the-as process-drawable arg0))
(the-as align-control this)
)
)