mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
143 lines
5.1 KiB
Common Lisp
143 lines
5.1 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: air.gc
|
|
;; name in dgo: air
|
|
;; dgos: BEA, L1
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defun point-in-air? ((arg0 vector) (arg1 (inline-array air-box)) (arg2 int))
|
|
(local-vars (t0-0 symbol))
|
|
(dotimes (v1-0 arg2)
|
|
(let ((t1-0 arg0)
|
|
(a3-1 (-> arg1 v1-0))
|
|
)
|
|
(set! t0-0
|
|
(when (< (-> a3-1 height-level) (-> t1-0 y))
|
|
(let ((f0-2 (- (-> t1-0 x) (-> a3-1 x-pos)))
|
|
(f2-1 (- (-> t1-0 z) (-> a3-1 z-pos)))
|
|
)
|
|
(set! t0-0 #f)
|
|
(let ((f1-5 (+ (* f0-2 (-> a3-1 cos-angle)) (* f2-1 (-> a3-1 sin-angle))))
|
|
(f0-4 (- (* f2-1 (-> a3-1 cos-angle)) (* f0-2 (-> a3-1 sin-angle))))
|
|
)
|
|
(if (and (>= f1-5 0.0) (>= f0-4 0.0) (< f1-5 (-> a3-1 x-length)) (< f0-4 (-> a3-1 z-length)))
|
|
(set! t0-0 #t)
|
|
)
|
|
)
|
|
)
|
|
t0-0
|
|
)
|
|
)
|
|
)
|
|
(if t0-0
|
|
(return #t)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
|
|
(defun points-in-air? ((arg0 vector) (arg1 vector) (arg2 (inline-array air-box)) (arg3 int))
|
|
(local-vars (t1-4 symbol))
|
|
(dotimes (v1-0 arg3)
|
|
(let* ((t0-1 (-> arg2 v1-0))
|
|
(f0-0 (-> t0-1 height-level))
|
|
)
|
|
(when (and (< f0-0 (-> arg0 y)) (< f0-0 (-> arg1 y)))
|
|
(let ((f2-0 (- (-> arg0 x) (-> t0-1 x-pos)))
|
|
(f4-0 (- (-> arg0 z) (-> t0-1 z-pos)))
|
|
(f0-4 (- (-> arg1 x) (-> t0-1 x-pos)))
|
|
(f1-6 (- (-> arg1 z) (-> t0-1 z-pos)))
|
|
(t2-0 t0-1)
|
|
(t1-3 #f)
|
|
)
|
|
(let ((f3-3 (+ (* f2-0 (-> t2-0 cos-angle)) (* f4-0 (-> t2-0 sin-angle))))
|
|
(f2-2 (- (* f4-0 (-> t2-0 cos-angle)) (* f2-0 (-> t2-0 sin-angle))))
|
|
)
|
|
(if (and (>= f3-3 0.0) (>= f2-2 0.0) (< f3-3 (-> t2-0 x-length)) (< f2-2 (-> t2-0 z-length)))
|
|
(set! t1-3 #t)
|
|
)
|
|
)
|
|
(set! t1-4
|
|
(and t1-3 (begin
|
|
(set! t1-4 #f)
|
|
(let ((f2-5 (+ (* f0-4 (-> t0-1 cos-angle)) (* f1-6 (-> t0-1 sin-angle))))
|
|
(f0-6 (- (* f1-6 (-> t0-1 cos-angle)) (* f0-4 (-> t0-1 sin-angle))))
|
|
)
|
|
(if (and (>= f2-5 0.0) (>= f0-6 0.0) (< f2-5 (-> t0-1 x-length)) (< f0-6 (-> t0-1 z-length)))
|
|
(set! t1-4 #t)
|
|
)
|
|
)
|
|
t1-4
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if t1-4
|
|
(return #t)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
|
|
(defun-debug add-debug-air-box ((arg0 bucket-id) (arg1 air-box))
|
|
(local-vars (a0-1 symbol))
|
|
(let ((a1-1 (camera-pos))
|
|
(s5-0 (new 'stack-no-clear 'vector))
|
|
(s4-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(-> arg1 cos-angle)
|
|
(-> arg1 sin-angle)
|
|
(let ((s2-0 (the-as uint #x800000ff)))
|
|
(let ((v1-0 arg1))
|
|
(set! a0-1
|
|
(when (< (-> v1-0 height-level) (-> a1-1 y))
|
|
(let ((f0-4 (- (-> a1-1 x) (-> v1-0 x-pos)))
|
|
(f2-1 (- (-> a1-1 z) (-> v1-0 z-pos)))
|
|
)
|
|
(set! a0-1 #f)
|
|
(let ((f1-5 (+ (* f0-4 (-> v1-0 cos-angle)) (* f2-1 (-> v1-0 sin-angle))))
|
|
(f0-6 (- (* f2-1 (-> v1-0 cos-angle)) (* f0-4 (-> v1-0 sin-angle))))
|
|
)
|
|
(if (and (>= f1-5 0.0) (>= f0-6 0.0) (< f1-5 (-> v1-0 x-length)) (< f0-6 (-> v1-0 z-length)))
|
|
(set! a0-1 #t)
|
|
)
|
|
)
|
|
)
|
|
a0-1
|
|
)
|
|
)
|
|
)
|
|
(if a0-1
|
|
(set! s2-0 (the-as uint #x8000ff00))
|
|
)
|
|
(set! (-> s5-0 y) (-> arg1 height-level))
|
|
(set! (-> s4-0 y) (-> arg1 height-level))
|
|
(set! (-> s5-0 w) 1.0)
|
|
(set! (-> s4-0 w) 1.0)
|
|
(set! (-> s5-0 x) (-> arg1 x-pos))
|
|
(set! (-> s5-0 z) (-> arg1 z-pos))
|
|
(set! (-> s4-0 x) (+ (-> arg1 x-pos) (* (-> arg1 cos-angle) (-> arg1 x-length))))
|
|
(set! (-> s4-0 z) (+ (-> arg1 z-pos) (* (-> arg1 sin-angle) (-> arg1 x-length))))
|
|
(add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1))
|
|
(set! (-> s5-0 quad) (-> s4-0 quad))
|
|
(set! (-> s4-0 x) (+ (-> s5-0 x) (* (- (-> arg1 sin-angle)) (-> arg1 z-length))))
|
|
(set! (-> s4-0 z) (+ (-> s5-0 z) (* (-> arg1 cos-angle) (-> arg1 z-length))))
|
|
(add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1))
|
|
(set! (-> s5-0 x) (+ (-> arg1 x-pos) (* (- (-> arg1 sin-angle)) (-> arg1 z-length))))
|
|
(set! (-> s5-0 z) (+ (-> arg1 z-pos) (* (-> arg1 cos-angle) (-> arg1 z-length))))
|
|
(add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1))
|
|
(set! (-> s4-0 x) (-> arg1 x-pos))
|
|
(set! (-> s4-0 z) (-> arg1 z-pos))
|
|
(add-debug-line #t arg0 s5-0 s4-0 (the-as rgba s2-0) #f (the-as rgba -1))
|
|
)
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|