mirror of
https://github.com/open-goal/jak-project
synced 2026-06-28 19:21:06 -04:00
7ce58f709f
* some jp support to fix some errors in the original game * music fade toggle * recognize `process-new` macros!! * strip casts in this macro * rename macro * fix cast typecheck * update source 1 * detect kernel stack case * less boilerplate * `manipy-spawn` special case * pretty printer improvements * revert dumb thing from earlier * use shell detection on `send-event` * fix some events * remove unused argument * detect `static-attack-info` and add `CondNoElse` to shell detect * better `attack-info` detect * support `process-spawn` in multi-lets * detect `rand-float-gen` pt 1 * detect as return value * detect in `countdown` and `dotimes` * oops this wasnt working * fancier `send-event`s * clang * update source!! * fix tests * fine jeez * uh okay * fix some accidental regressions * fix more regressions * regression fixes * fix big bug... * extra safety!
77 lines
2.4 KiB
Common Lisp
77 lines
2.4 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: tippy.gc
|
|
;; name in dgo: tippy
|
|
;; dgos: GAME, COMMON, L1
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype tippy (structure)
|
|
((axis vector :inline :offset-assert 0)
|
|
(angle float :offset-assert 16)
|
|
(orig quaternion :inline :offset-assert 32)
|
|
(dist-ratio float :offset-assert 48)
|
|
(damping float :offset-assert 52)
|
|
(1-damping float :offset-assert 56)
|
|
)
|
|
:method-count-assert 11
|
|
:size-assert #x3c
|
|
:flag-assert #xb0000003c
|
|
(:methods
|
|
(reset! (_type_ process-drawable float float) none 9)
|
|
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
|
)
|
|
)
|
|
|
|
|
|
(defmethod reset! tippy ((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
|
|
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
|
|
(set! (-> obj angle) 0.0)
|
|
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
|
|
(set! (-> obj dist-ratio) arg1)
|
|
(set! (-> obj damping) arg2)
|
|
(set! (-> obj 1-damping) (- 1.0 arg2))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod TODO-RENAME-10 tippy ((obj tippy) (arg0 process-drawable) (arg1 vector))
|
|
(let ((s4-0 #t))
|
|
(cond
|
|
(arg1
|
|
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
|
0.0
|
|
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
|
|
(set! (-> s3-0 y) 0.0)
|
|
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
|
|
(let ((f0-6 (vector-length s3-0)))
|
|
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
|
|
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
|
|
(set! (-> obj axis x) (+ (* (-> obj 1-damping) (-> obj axis x)) (* (-> obj damping) (-> s3-0 x))))
|
|
(set! (-> obj axis y) 0.0)
|
|
(set! (-> obj axis z) (+ (* (-> obj 1-damping) (-> obj axis z)) (* (-> obj damping) (-> s3-0 z))))
|
|
(vector-normalize! (-> obj axis) 1.0)
|
|
(set! (-> obj angle) (+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
|
|
(when (< (-> obj angle) 182.04445)
|
|
(set! (-> obj angle) 0.0)
|
|
(set! s4-0 #f)
|
|
)
|
|
)
|
|
)
|
|
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
|
|
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
|
|
s4-0
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|