;;-*-Lisp-*- (in-package goal) ;; definition of type joint-exploder-tuning (deftype joint-exploder-tuning (structure) ((explosion uint64) (duration time-frame) (gravity float) (rot-speed float) (bounds-inflate float) (max-probes uint8) (max-probe-width float) (max-probe-height float) (max-probe-depth float) (friction float) (fountain-rand-transv-lo vector :inline) (fountain-rand-transv-hi vector :inline) (away-from-focal-pt vector :inline :overlay-at fountain-rand-transv-lo) (away-from-rand-transv-xz-lo float :overlay-at (-> fountain-rand-transv-hi data 0)) (away-from-rand-transv-xz-hi float :overlay-at (-> fountain-rand-transv-hi data 1)) (away-from-rand-transv-y-lo float :overlay-at (-> fountain-rand-transv-hi data 2)) (away-from-rand-transv-y-hi float :overlay-at (-> fountain-rand-transv-hi data 3)) (hit-xz-reaction float) (hit-y-reaction float) ) (:methods (new (symbol type uint) _type_) ) ) ;; definition for method 3 of type joint-exploder-tuning (defmethod inspect ((this joint-exploder-tuning)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this 'joint-exploder-tuning) (format #t "~1Texplosion: ~D~%" (-> this explosion)) (format #t "~1Tduration: ~D~%" (-> this duration)) (format #t "~1Tgravity: ~f~%" (-> this gravity)) (format #t "~1Trot-speed: ~f~%" (-> this rot-speed)) (format #t "~1Tbounds-inflate: ~f~%" (-> this bounds-inflate)) (format #t "~1Tmax-probes: ~D~%" (-> this max-probes)) (format #t "~1Tmax-probe-width: ~f~%" (-> this max-probe-width)) (format #t "~1Tmax-probe-height: ~f~%" (-> this max-probe-height)) (format #t "~1Tmax-probe-depth: ~f~%" (-> this max-probe-depth)) (format #t "~1Tfriction: ~f~%" (-> this friction)) (format #t "~1Tfountain-rand-transv-lo: #~%" (-> this fountain-rand-transv-lo)) (format #t "~1Tfountain-rand-transv-hi: #~%" (-> this fountain-rand-transv-hi)) (format #t "~1Taway-from-focal-pt: #~%" (-> this fountain-rand-transv-lo)) (format #t "~1Taway-from-rand-transv-xz-lo: ~f~%" (-> this fountain-rand-transv-hi x)) (format #t "~1Taway-from-rand-transv-xz-hi: ~f~%" (-> this fountain-rand-transv-hi y)) (format #t "~1Taway-from-rand-transv-y-lo: ~f~%" (-> this fountain-rand-transv-hi z)) (format #t "~1Taway-from-rand-transv-y-hi: ~f~%" (-> this fountain-rand-transv-hi w)) (format #t "~1Thit-xz-reaction: ~f~%" (-> this hit-xz-reaction)) (format #t "~1Thit-y-reaction: ~f~%" (-> this hit-y-reaction)) (label cfg-4) this ) ;; definition of type joint-exploder-static-joint-params (deftype joint-exploder-static-joint-params (structure) ((joint-index int16) (parent-joint-index int16) ) ) ;; definition for method 3 of type joint-exploder-static-joint-params (defmethod inspect ((this joint-exploder-static-joint-params)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this 'joint-exploder-static-joint-params) (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) (format #t "~1Tparent-joint-index: ~D~%" (-> this parent-joint-index)) (label cfg-4) this ) ;; definition of type joint-exploder-static-params (deftype joint-exploder-static-params (basic) ((joints (array joint-exploder-static-joint-params)) (collide-spec collide-spec) (art-level symbol) (collide-sound sound-name) (collide-sound-interval time-frame) ) ) ;; definition for method 3 of type joint-exploder-static-params ;; INFO: Used lq/sq (defmethod inspect ((this joint-exploder-static-params)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Tjoints: ~A~%" (-> this joints)) (format #t "~1Tcollide-spec: ~D~%" (-> this collide-spec)) (format #t "~1Tart-level: ~A~%" (-> this art-level)) (format #t "~1Tcollide-sound: ~D~%" (-> this collide-sound)) (format #t "~1Tcollide-sound-interval: ~D~%" (-> this collide-sound-interval)) (label cfg-4) this ) ;; definition of type joint-exploder-joint (deftype joint-exploder-joint (structure) ((next int16) (prev int16) (joint-index int16) (mat matrix :inline) (rmat matrix :inline) (update-rmat matrix :inline) (transv vector :inline) (prev-pos vector :inline) ) ) ;; definition for method 3 of type joint-exploder-joint (defmethod inspect ((this joint-exploder-joint)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this 'joint-exploder-joint) (format #t "~1Tnext: ~D~%" (-> this next)) (format #t "~1Tprev: ~D~%" (-> this prev)) (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) (format #t "~1Tmat: #~%" (-> this mat)) (format #t "~1Trmat: #~%" (-> this rmat)) (format #t "~1Tupdate-rmat: #~%" (-> this update-rmat)) (format #t "~1Ttransv: #~%" (-> this transv)) (format #t "~1Tprev-pos: #~%" (-> this prev-pos)) (label cfg-4) this ) ;; definition of type joint-exploder-joints (deftype joint-exploder-joints (basic) ((num-joints int32) (joint joint-exploder-joint :inline :dynamic) ) (:methods (new (symbol type joint-exploder-static-params) _type_) ) ) ;; definition for method 3 of type joint-exploder-joints (defmethod inspect ((this joint-exploder-joints)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) (format #t "~1Tjoint[0] @ #x~X~%" (-> this joint)) (label cfg-4) this ) ;; definition of type joint-exploder-list (deftype joint-exploder-list (structure) "Linked list of joint-exploder-joint." ((head int32) (pre-moved? symbol) (bbox-valid? symbol) (probeless? symbol) (bbox bounding-box :inline) ) ) ;; definition for method 3 of type joint-exploder-list (defmethod inspect ((this joint-exploder-list)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this 'joint-exploder-list) (format #t "~1Thead: ~D~%" (-> this head)) (format #t "~1Tpre-moved?: ~A~%" (-> this pre-moved?)) (format #t "~1Tbbox-valid?: ~A~%" (-> this bbox-valid?)) (format #t "~1Tprobeless?: ~A~%" (-> this probeless?)) (format #t "~1Tbbox: #~%" (-> this bbox)) (label cfg-4) this ) ;; definition of type joint-exploder-list-array (deftype joint-exploder-list-array (inline-array-class) ((data joint-exploder-list :inline :dynamic) ) ) ;; definition for method 3 of type joint-exploder-list-array (defmethod inspect ((this joint-exploder-list-array)) (when (not this) (set! this this) (goto cfg-4) ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Tlength: ~D~%" (-> this length)) (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) this ) ;; failed to figure out what this is: (set! (-> joint-exploder-list-array heap-base) (the-as uint 48)) ;; definition of type joint-exploder (deftype joint-exploder (process-drawable) "The joint-exploder animates an object exploding into pieces. For example, geyser rock dummies, or the jak 1 zoomer." ((parent (pointer process-drawable) :override) (die-if-below-y float) (die-if-beyond-xz-dist-sqrd float) (joints joint-exploder-joints) (static-params joint-exploder-static-params) (anim art-joint-anim) (scale-vector vector :inline) (tuning joint-exploder-tuning :inline) (lists joint-exploder-list-array) (last-colsound-time time-frame) ) (:methods (add-joint-to-list (_type_ joint-exploder-list int) int) (update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none) (do-collision-response (_type_ joint-exploder-list) none) (init-joint-list (_type_) none) (remove-from-list-and-reset (_type_ joint-exploder-list int) int) (final-adjust (_type_ joint-exploder-list int) int) (integrate-and-kill (_type_ joint-exploder-list) none) (remove-joint-from-list (_type_ joint-exploder-list int) int) (adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list) (adjust-bbox-for-limits (_type_ joint-exploder-list) none) ) (:states joint-exploder-shatter ) ) ;; definition for method 3 of type joint-exploder (defmethod inspect ((this joint-exploder)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) (format #t "~2Tdie-if-below-y: ~f~%" (-> this die-if-below-y)) (format #t "~2Tdie-if-beyond-xz-dist-sqrd: ~f~%" (-> this die-if-beyond-xz-dist-sqrd)) (format #t "~2Tjoints: ~A~%" (-> this joints)) (format #t "~2Tstatic-params: ~A~%" (-> this static-params)) (format #t "~2Tanim: ~A~%" (-> this anim)) (format #t "~2Tscale-vector: #~%" (-> this scale-vector)) (format #t "~2Ttuning: #~%" (-> this tuning)) (format #t "~2Tlists: ~A~%" (-> this lists)) (format #t "~2Tlast-colsound-time: ~D~%" (-> this last-colsound-time)) (label cfg-4) this ) ;; definition for method 5 of type joint-exploder-joints ;; WARN: Return type mismatch uint vs int. (defmethod asize-of ((this joint-exploder-joints)) (the-as int (+ (-> this type size) (* 240 (-> this num-joints)))) ) ;; definition for method 0 of type joint-exploder-joints (defmethod new joint-exploder-joints ((allocation symbol) (type-to-make type) (arg0 joint-exploder-static-params)) (let* ((gp-0 (-> arg0 joints length)) (v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* 240 gp-0))))) ) (set! (-> v0-0 num-joints) gp-0) v0-0 ) ) ;; definition for function joint-exploder-joint-callback ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defun joint-exploder-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control)) "Postbind callback to set bones to the result of the joint-exploder." (let ((s4-0 (the-as joint-exploder (-> arg0 process)))) (let ((s3-0 (-> s4-0 joints))) (countdown (s2-0 (-> s3-0 num-joints)) (let* ((v1-3 (-> s3-0 joint s2-0)) (a0-5 (-> arg1 data (-> v1-3 joint-index) bone transform)) ) (matrix*! a0-5 (-> v1-3 rmat) (-> v1-3 mat)) ) ) ) (let ((s4-1 (-> s4-0 scale-vector))) (countdown (s3-1 (-> arg1 length)) (let ((a2-2 (-> arg1 data s3-1 bone transform))) (scale-matrix! a2-2 s4-1 a2-2) ) ) ) ) (let ((s4-2 (new-stack-matrix0)) (f30-0 (-> arg0 bounds w)) ) (matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform)) (set! (-> arg0 bounds w) 1.0) (vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2) (set! (-> arg0 bounds w) f30-0) ) 0 (none) ) ;; definition for method 24 of type joint-exploder ;; INFO: Used lq/sq (defmethod remove-from-list-and-reset ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) "Remove a joint from the list and clear its transform" (let ((v0-0 (remove-joint-from-list this arg0 arg1))) (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) ) (set! (-> v1-2 mat rvec quad) (the-as uint128 0)) (set! (-> v1-2 mat uvec quad) (the-as uint128 0)) (set! (-> v1-2 mat fvec quad) (the-as uint128 0)) (vector-copy! (-> v1-2 mat trans) (-> this root trans)) ) v0-0 ) ) ;; definition for method 27 of type joint-exploder (defmethod remove-joint-from-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) "Remove a joint from the linked list and invalidate the bbox." (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) (v0-0 (-> a2-1 next)) ) (cond ((>= a0-4 0) (set! (-> v1-0 joint a0-4 next) v0-0) (if (>= v0-0 0) (set! (-> v1-0 joint v0-0 prev) a0-4) ) ) (else (set! (-> arg0 head) v0-0) (cond ((>= v0-0 0) (let ((v1-2 (-> v1-0 joint v0-0))) (set! (-> v1-2 prev) -1) ) ) (else (set! (-> arg0 bbox-valid?) #f) ) ) ) ) v0-0 ) ) ;; definition for method 20 of type joint-exploder (defmethod add-joint-to-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) "Add a joint to the given linked list of joints." (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) ) (set! (-> arg0 head) arg1) (set! (-> a3-0 prev) -1) (set! (-> a3-0 next) a0-4) (when (>= a0-4 0) (set! (-> v1-0 joint a0-4 prev) arg1) arg1 ) ) ) ;; definition for method 21 of type joint-exploder ;; INFO: Used lq/sq (defmethod update-bbox-for-joint ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) "Update the bounding box to include the joint" (let ((a1-1 (-> arg1 mat trans))) (cond ((-> arg0 bbox-valid?) (add-point! (-> arg0 bbox) a1-1) ) (else (set! (-> arg0 bbox-valid?) #t) (set! (-> arg0 bbox min quad) (-> a1-1 quad)) (vector-copy! (-> arg0 bbox max) a1-1) ) ) ) (add-point! (-> arg0 bbox) (-> arg1 prev-pos)) (none) ) ;; definition for method 28 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs joint-exploder-list. (defmethod adjust-bbox-for-limits-along-axis ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (let ((s4-0 (the-as object #f))) (let ((v1-0 1)) (until (= v1-0 (+ (-> this tuning max-probes) 1)) (let ((a0-4 (-> this lists data v1-0))) (when (< (-> a0-4 head) 0) (set! s4-0 a0-4) (goto cfg-6) ) ) (+! v1-0 1) ) ) (label cfg-6) (cond ((the-as joint-exploder-list s4-0) (set! (-> (the-as joint-exploder-list s4-0) pre-moved?) #t) (set! (-> (the-as joint-exploder-list s4-0) bbox-valid?) #f) ) (else (set! s4-0 (-> this lists data)) ) ) (set! (-> arg0 bbox-valid?) #f) (let ((s2-0 (-> this joints)) (sv-32 (-> arg0 head)) (s1-0 0) (s0-0 0) ) (let ((v1-8 arg1)) (cond ((zero? v1-8) (let ((f30-0 (* 0.5 (+ (-> arg0 bbox min x) (-> arg0 bbox max x))))) (while (>= sv-32 0) (let ((sv-48 (-> s2-0 joint sv-32))) (cond ((>= (-> sv-48 mat trans x) f30-0) (let ((sv-16 (remove-joint-from-list this arg0 sv-32))) (add-joint-to-list this (the-as joint-exploder-list s4-0) sv-32) (set! sv-32 sv-16) ) (update-bbox-for-joint this (the-as joint-exploder-list s4-0) sv-48) (+! s0-0 1) ) (else (update-bbox-for-joint this arg0 sv-48) (set! sv-32 (-> sv-48 next)) (+! s1-0 1) ) ) ) ) ) ) ((= v1-8 1) (let ((f30-1 (* 0.5 (+ (-> arg0 bbox min y) (-> arg0 bbox max y))))) (while (>= sv-32 0) (let ((sv-80 (-> s2-0 joint sv-32))) (cond ((>= (-> sv-80 mat trans y) f30-1) (let ((sv-64 (remove-joint-from-list this arg0 sv-32))) (add-joint-to-list this (the-as joint-exploder-list s4-0) sv-32) (set! sv-32 sv-64) ) (update-bbox-for-joint this (the-as joint-exploder-list s4-0) sv-80) (+! s0-0 1) ) (else (update-bbox-for-joint this arg0 sv-80) (set! sv-32 (-> sv-80 next)) (+! s1-0 1) ) ) ) ) ) ) ((= v1-8 2) (let ((f30-2 (* 0.5 (+ (-> arg0 bbox min z) (-> arg0 bbox max z))))) (while (>= sv-32 0) (let ((sv-112 (-> s2-0 joint sv-32))) (cond ((>= (-> sv-112 mat trans z) f30-2) (let ((sv-96 (remove-joint-from-list this arg0 sv-32))) (add-joint-to-list this (the-as joint-exploder-list s4-0) sv-32) (set! sv-32 sv-96) ) (update-bbox-for-joint this (the-as joint-exploder-list s4-0) sv-112) (+! s0-0 1) ) (else (update-bbox-for-joint this arg0 sv-112) (set! sv-32 (-> sv-112 next)) (+! s1-0 1) ) ) ) ) ) ) ) ) (cond ((zero? s0-0) (final-adjust this arg0 arg1) ) ((zero? s1-0) (if (not (-> (the-as joint-exploder-list s4-0) probeless?)) (final-adjust this (the-as joint-exploder-list s4-0) arg1) ) ) ) ) (the-as joint-exploder-list s4-0) ) ) ;; definition for method 25 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs int. (defmethod final-adjust ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (set! (-> arg0 bbox-valid?) #f) (let ((s3-0 (-> this joints)) (s2-0 (-> arg0 head)) ) (while (>= s2-0 0) (let ((sv-80 (-> s3-0 joint s2-0)) (s1-0 (new 'stack-no-clear 'bounding-box)) (s0-0 (-> arg0 bbox-valid?)) ) (vector-copy! (-> s1-0 min) (-> arg0 bbox min)) (vector-copy! (-> s1-0 max) (-> arg0 bbox max)) (update-bbox-for-joint this arg0 sv-80) (let* ((v1-7 arg1) (v1-8 (cond ((zero? v1-7) (< (-> this tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) ) ((= v1-7 1) (< (-> this tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) ) ((= v1-7 2) (< (-> this tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) ) ) ) ) (set! s2-0 (cond (v1-8 (let ((sv-48 (remove-joint-from-list this arg0 s2-0)) (sv-64 (-> this lists data)) ) (add-joint-to-list this (-> sv-64 0) s2-0) (set! s2-0 sv-48) (update-bbox-for-joint this (-> sv-64 0) sv-80) ) (set! (-> arg0 bbox-valid?) s0-0) (set! (-> arg0 bbox min quad) (-> s1-0 min quad)) (vector-copy! (-> arg0 bbox max) (-> s1-0 max)) s2-0 ) (else (-> sv-80 next) ) ) ) ) ) ) ) (the-as int #f) ) ;; definition for method 29 of type joint-exploder ;; WARN: Return type mismatch int vs none. (defmethod adjust-bbox-for-limits ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?))) (let ((a2-0 -1)) (cond ((< (-> this tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) (set! a2-0 0) ) ((< (-> this tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) (set! a2-0 1) ) ((< (-> this tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) (set! a2-0 2) ) ) (when (>= a2-0 0) (let ((a1-2 (adjust-bbox-for-limits-along-axis this arg0 a2-0))) (if (not (-> a1-2 probeless?)) (adjust-bbox-for-limits this a1-2) ) ) (adjust-bbox-for-limits this arg0) ) ) ) 0 (none) ) ;; definition for method 26 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod integrate-and-kill ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) (let ((s4-0 (-> this joints)) (f30-0 (* (-> this tuning gravity) (seconds-per-frame))) (s3-0 (-> arg0 head)) ) (while (>= s3-0 0) (let* ((s2-0 (-> s4-0 joint s3-0)) (s1-0 (-> s2-0 mat trans)) ) (vector-copy! (-> s2-0 prev-pos) s1-0) (+! (-> s2-0 transv y) f30-0) (when (< 0.0 (-> this tuning friction)) (let* ((f0-4 (vector-length-squared (-> s2-0 transv))) (f1-5 (* 0.00001 (seconds-per-frame) (-> this tuning friction) f0-4)) (f0-6 (- (sqrtf f0-4) f1-5)) ) (if (< f0-6 0.0) (set! f0-6 0.0) ) (vector-normalize! (-> s2-0 transv) f0-6) ) ) (vector-v+! s1-0 s1-0 (-> s2-0 transv)) (matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat)) (cond ((or (< (-> s1-0 y) (-> this die-if-below-y)) (< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans))) ) (set! s3-0 (remove-from-list-and-reset this arg0 s3-0)) ) (else (update-bbox-for-joint this arg0 s2-0) (set! s3-0 (-> s2-0 next)) ) ) ) ) ) 0 (none) ) ;; definition for method 22 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod do-collision-response ((this joint-exploder) (arg0 joint-exploder-list)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 collide-with) (-> this static-params collide-spec)) (set! (-> s5-0 ignore-process0) this) (set! (-> s5-0 ignore-process1) #f) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) ) (set! (-> s5-0 action-mask) (collide-action solid)) (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) (fill-using-bounding-box *collide-cache* s5-0) ) (let ((s5-1 (-> this joints)) (v1-6 (-> arg0 head)) ) (while (>= v1-6 0) (let ((s4-1 (-> s5-1 joint v1-6))) (let ((s3-0 (-> s4-1 mat trans)) (s2-0 (new 'stack-no-clear 'collide-query)) ) (vector-! (-> s2-0 move-dist) s3-0 (-> s4-1 prev-pos)) (vector-copy! (-> s2-0 start-pos) (-> s4-1 prev-pos)) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 40.96) (set! (-> v1-11 collide-with) (-> this static-params collide-spec)) (set! (-> v1-11 ignore-process0) #f) (set! (-> v1-11 ignore-process1) #f) (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) ) (set! (-> v1-11 action-mask) (collide-action solid)) ) (when (>= (probe-using-line-sphere *collide-cache* s2-0) 0.0) (vector-copy! s3-0 (-> s2-0 best-other-tri intersect)) (let* ((v1-16 (-> s4-1 transv)) (f28-0 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) ) (vector-reflect! (-> s4-1 transv) (-> s4-1 transv) (-> s2-0 best-other-tri normal)) (let ((f30-0 (-> s4-1 transv y))) (set! (-> s4-1 transv y) 0.0) (vector-normalize! (-> s4-1 transv) (* f28-0 (-> this tuning hit-xz-reaction))) (set! (-> s4-1 transv y) (* f30-0 (-> this tuning hit-y-reaction))) ) ) (let ((v1-20 (-> this static-params collide-sound))) (when (and v1-20 (nonzero? v1-20) (< (-> this static-params collide-sound-interval) (- (current-time) (-> this last-colsound-time))) ) (sound-play-by-name (-> this static-params collide-sound) (new-sound-id) 1024 0 0 (sound-group) (-> s4-1 transv) ) (set-time! (-> this last-colsound-time)) ) ) (+! (-> s3-0 y) (* 40.96 (-> s2-0 best-other-tri normal y))) (set! (-> s3-0 w) 1.0) (matrix-lerp! (-> s4-1 update-rmat) (-> s4-1 update-rmat) *identity-matrix* 0.5) ) ) (set! v1-6 (-> s4-1 next)) ) ) ) 0 (none) ) ;; failed to figure out what this is: (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () (set-time! (-> self state-time)) ) :trans (behavior () (let* ((f1-0 (the float (- (current-time) (-> self state-time)))) (f0-2 (- 1.0 (/ f1-0 (the float (-> self tuning duration))))) (f1-2 (- 1.0 (/ f1-0 (* 0.75 (the float (-> self tuning duration)))))) (f1-3 (fmax 0.0001 f1-2)) (f0-3 (fmax 0.0001 f0-2)) ) (set-vector! (-> self scale-vector) f0-3 f1-3 f0-3 1.0) ) (dotimes (v1-11 (the-as int (+ (-> self tuning max-probes) 1))) (set! (-> self lists data v1-11 pre-moved?) #f) ) (dotimes (gp-0 (the-as int (+ (-> self tuning max-probes) 1))) (let ((s5-0 (-> self lists data gp-0))) (when (>= (-> s5-0 head) 0) (when (not (-> s5-0 pre-moved?)) (integrate-and-kill self s5-0) (if (nonzero? gp-0) (adjust-bbox-for-limits self s5-0) ) ) ) ) ) (let ((gp-1 (new 'stack-no-clear 'bounding-box))) (let ((v1-31 (-> self root trans))) (vector-copy! (-> gp-1 min) v1-31) (vector-copy! (-> gp-1 max) v1-31) ) (dotimes (s5-1 (the-as int (+ (-> self tuning max-probes) 1))) (let ((s4-0 (-> self lists data s5-1))) (if (-> s4-0 bbox-valid?) (add-box! gp-1 (-> s4-0 bbox)) ) (if (nonzero? s5-1) (do-collision-response self s4-0) ) ) ) (let ((s5-2 (-> self draw bounds))) (vector-average! s5-2 (-> gp-1 min) (-> gp-1 max)) (set! (-> s5-2 w) (+ (vector-vector-distance s5-2 (-> gp-1 max)) (-> self tuning bounds-inflate))) ) ) 0 ) :code (behavior () (set-time! (-> self state-time)) (until (time-elapsed? (-> self state-time) (-> self tuning duration)) (suspend) (ja :num! (loop!)) ) ) :post ja-post ) ;; definition for method 23 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-joint-list ((this joint-exploder)) (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) (let ((v1-2 (-> this static-params joints s4-0)) (s3-0 (-> gp-0 joint s4-0)) ) (let ((a0-6 (-> v1-2 parent-joint-index))) (set! (-> s3-0 prev) (+ s4-0 -1)) (set! (-> s3-0 next) (+ s4-0 1)) (set! (-> s3-0 joint-index) (-> v1-2 joint-index)) (cond ((>= a0-6 0) (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) (let ((a3-0 (-> this parent 0 node-list data a0-6 bone transform))) (matrix-copy! (-> s3-0 mat) a3-0) ) (matrix-identity! (-> s3-0 rmat)) ) (else (let ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform))) (matrix-copy! (-> s3-0 mat) a3-2) ) (matrix-identity! (-> s3-0 rmat)) ) ) ) (case (-> this tuning explosion) ((1) (vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> this tuning fountain-rand-transv-lo)) (vector-normalize! (-> s3-0 transv) (rand-vu-float-range (-> this tuning fountain-rand-transv-hi x) (-> this tuning fountain-rand-transv-hi y)) ) (+! (-> s3-0 transv y) (rand-vu-float-range (-> this tuning fountain-rand-transv-hi z) (-> this tuning fountain-rand-transv-hi w)) ) (set! (-> s3-0 transv w) 1.0) ) (else (let ((s0-0 (-> this tuning fountain-rand-transv-lo)) (s1-1 (-> this tuning fountain-rand-transv-hi)) ) (set-vector! (-> s3-0 transv) (rand-vu-float-range (-> s0-0 x) (-> s1-1 x)) (rand-vu-float-range (-> s0-0 y) (-> s1-1 y)) (rand-vu-float-range (-> s0-0 z) (-> s1-1 z)) 1.0 ) ) ) ) (let ((s2-3 (new 'stack-no-clear 'vector)) (s1-2 (new 'stack-no-clear 'quaternion)) ) (rand-vu-sphere-point-uniform! s2-3 1.0) (vector-normalize! s2-3 1.0) (quaternion-vector-angle! s1-2 s2-3 (* 182.04445 (-> this tuning rot-speed))) (quaternion->matrix (-> s3-0 update-rmat) s1-2) ) ) ) (when (nonzero? (-> gp-0 num-joints)) (let ((v1-31 (-> gp-0 joint (+ (-> gp-0 num-joints) -1)))) (set! (-> v1-31 next) -1) ) (let ((v1-33 (-> this lists data 1))) (set! (-> v1-33 head) 0) (let ((s5-1 (-> v1-33 bbox))) (let ((v1-34 (-> gp-0 joint 0 mat trans))) (vector-copy! (-> s5-1 min) v1-34) (vector-copy! (-> s5-1 max) v1-34) ) (dotimes (s4-1 (-> gp-0 num-joints)) (add-point! s5-1 (the-as vector (+ (the-as uint (-> gp-0 joint 0 mat trans)) (* 240 s4-1)))) ) ) ) ) ) 0 (none) ) ;; definition for method 7 of type joint-exploder ;; WARN: Return type mismatch process-drawable vs joint-exploder. (defmethod relocate ((this joint-exploder) (offset int)) (if (nonzero? (-> this joints)) (&+! (-> this joints) offset) ) (if (nonzero? (-> this lists)) (&+! (-> this lists) offset) ) (the-as joint-exploder ((method-of-type process-drawable relocate) this offset)) ) ;; definition for function joint-exploder-init-by-other ;; INFO: Used lq/sq (defbehavior joint-exploder-init-by-other joint-exploder ((arg0 skeleton-group) (arg1 int) (arg2 joint-exploder-tuning) (arg3 joint-exploder-static-params)) (set! (-> self static-params) arg3) (set! (-> self die-if-beyond-xz-dist-sqrd) 10485760000.0) (mem-copy! (the-as pointer (-> self tuning)) (the-as pointer arg2) 88) (set! (-> self joints) (new 'process 'joint-exploder-joints arg3)) (set! (-> self lists) (new 'process 'joint-exploder-list-array (the-as int (+ (-> self tuning max-probes) 1))) ) (dotimes (v1-4 (the-as int (+ (-> self tuning max-probes) 1))) (let ((a0-7 (-> self lists data v1-4))) (set! (-> a0-7 head) -1) (set! (-> a0-7 bbox-valid?) #f) (set! (-> a0-7 pre-moved?) #f) (set! (-> a0-7 probeless?) #f) ) ) (let ((v1-8 (-> self lists data))) (set! (-> v1-8 0 probeless?) #t) ) (set! (-> self root) (new 'process 'trsqv)) (vector-copy! (-> self root trans) (-> self parent 0 root trans)) (quaternion-copy! (-> self root quat) (-> self parent 0 root quat)) (vector-copy! (-> self root scale) (-> self parent 0 root scale)) (when (-> arg3 art-level) (let ((a1-8 (entity-actor-from-level-name (-> arg3 art-level)))) (if a1-8 (process-entity-set! self a1-8) ) ) ) (initialize-skeleton self arg0 (the-as pair 0)) (logior! (-> self skel status) (joint-control-status sync-math)) (set! (-> self anim) (the-as art-joint-anim (-> self draw art-group data arg1))) (ja-channel-set! 1) (ja :group! (-> self anim) :num! min) (ja-post) (init-joint-list self) (set! (-> self die-if-below-y) (+ -102400.0 (-> self root trans y))) (set! (-> self skel postbind-function) joint-exploder-joint-callback) (set! (-> self last-colsound-time) 0) (go joint-exploder-shatter) ) ;; definition for method 0 of type joint-exploder-tuning ;; WARN: Return type mismatch structure vs joint-exploder-tuning. (defmethod new joint-exploder-tuning ((allocation symbol) (type-to-make type) (arg0 uint)) (let ((t9-0 (method-of-type structure new)) (v1-1 type-to-make) ) (-> type-to-make size) (let ((v0-0 (t9-0 allocation v1-1))) (set! (-> (the-as joint-exploder-tuning v0-0) explosion) arg0) (set! (-> (the-as joint-exploder-tuning v0-0) duration) (seconds 2)) (set! (-> (the-as joint-exploder-tuning v0-0) gravity) -286720.0) (set! (-> (the-as joint-exploder-tuning v0-0) rot-speed) 8.4) (set! (-> (the-as joint-exploder-tuning v0-0) friction) 0.0) (set! (-> (the-as joint-exploder-tuning v0-0) bounds-inflate) 16384.0) (set! (-> (the-as joint-exploder-tuning v0-0) max-probe-width) 20480.0) (set! (-> (the-as joint-exploder-tuning v0-0) max-probe-height) 24576.0) (set! (-> (the-as joint-exploder-tuning v0-0) max-probe-depth) 20480.0) (set! (-> (the-as joint-exploder-tuning v0-0) max-probes) (the-as uint 4)) (set! (-> (the-as joint-exploder-tuning v0-0) hit-xz-reaction) 0.75) (set! (-> (the-as joint-exploder-tuning v0-0) hit-y-reaction) 0.7) (cond ((zero? arg0) (set-vector! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-lo) -81920.0 20480.0 -81920.0 1.0) (set-vector! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-hi) 81920.0 61440.0 81920.0 1.0) ) ((= arg0 1) (vector-reset! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-lo)) (set! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-hi x) 49152.0) (set! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-hi y) 163840.0) (set! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-hi z) 20480.0) (set! (-> (the-as joint-exploder-tuning v0-0) fountain-rand-transv-hi w) 61440.0) ) ) (the-as joint-exploder-tuning v0-0) ) ) )