jak-project/goal_src/levels/beach/air-h.gc
Tyler Wilding 506b5d8ceb
Decompile: prototype | video | vol-h | air-h | nav-enemy-h | rigid-body-h (#575)
* decomp: `prototype` done

* tests/ref: Update all reference tests

* decomp: `video` done

* decomp: Add `video` to src

* decomp: `vol-h` done

* tests/ref: Update reference tests again

* decomp: Add `vol-h` to ref tests, leave `entity` in process as a `basic` for now!

* decomp: `air-h` done, compiler issue though

* decomp: `nav-enemy-h` done, compiler issue though

* decomp: `rigid-body-h` done, compiler issue though

* Address feedback and fix the failing to compile files

* linting

* finish `video` off
2021-06-12 21:52:55 -04:00

69 lines
1.7 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: air-h.gc
;; name in dgo: air-h
;; dgos: BEA, L1
;; definition of type air-box
(deftype air-box (structure)
((vecs vector 2 :inline :offset-assert 0)
(x-pos float :offset 0)
(height-level float :offset 4)
(z-pos float :offset 8)
(cos-angle float :offset 12)
(x-length float :offset 16)
(z-length float :offset 24)
(sin-angle float :offset 28)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for function point-in-air-box-area?
(defun point-in-air-box-area? ((arg0 float) (arg1 float) (arg2 air-box))
(let ((v0-0 #f))
(let ((f0-2 (+ (* arg0 (-> arg2 vecs 0 w)) (* arg1 (-> arg2 vecs 1 w))))
(f1-5 (- (* arg1 (-> arg2 vecs 0 w)) (* arg0 (-> arg2 vecs 1 w))))
)
(if
(and
(>= f0-2 0.0)
(>= f1-5 0.0)
(< f0-2 (-> arg2 vecs 1 x))
(< f1-5 (-> arg2 vecs 1 z))
)
(set! v0-0 #t)
)
)
v0-0
)
)
;; definition for function point-in-air-box?
(defun point-in-air-box? ((arg0 vector) (arg1 air-box))
(when (< (-> arg1 vecs 0 y) (-> arg0 y))
(let ((f1-2 (- (-> arg0 x) (the-as float (-> arg1 vecs 0 x))))
(f2-1 (- (-> arg0 z) (-> arg1 vecs 0 z)))
(v1-0 arg1)
(v0-0 #f)
)
(let ((f0-5 (+ (* f1-2 (-> v1-0 vecs 0 w)) (* f2-1 (-> v1-0 vecs 1 w))))
(f1-4 (- (* f2-1 (-> v1-0 vecs 0 w)) (* f1-2 (-> v1-0 vecs 1 w))))
)
(if
(and
(>= f0-5 0.0)
(>= f1-4 0.0)
(< f0-5 (-> v1-0 vecs 1 x))
(< f1-4 (-> v1-0 vecs 1 z))
)
(set! v0-0 #t)
)
)
v0-0
)
)
)