Files
jak-project/goal_src/engine/geometry/bounding-box.gc
T
water111 126dfc1c45 [Decompiler] Misc fixes for gkernel/math (#257)
* more cases

* some work on math and floating point stuff

* some decompiling for fun
2021-02-13 11:32:52 -05:00

31 lines
874 B
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: bounding-box.gc
;; name in dgo: bounding-box
;; dgos: GAME, ENGINE
(defun box-vector-enside? ((box bounding-box) (pt vector))
"Is the point in the box? On the edge doesn't count"
(and
(< (-> box min data 0) (-> pt data 0))
(< (-> box min data 1) (-> pt data 1))
(< (-> box min data 2) (-> pt data 2))
(< (-> pt data 0) (-> box max data 0))
(< (-> pt data 1) (-> box max data 1))
(< (-> pt data 2) (-> box max data 2))
)
)
(defun box-vector-inside? ((box bounding-box) (pt vector))
"Is the point in the box? On the edge counts."
(and
(>= (-> pt data 0) (-> box min data 0))
(>= (-> pt data 1) (-> box min data 1))
(>= (-> pt data 2) (-> box min data 2))
(>= (-> box max data 0) (-> pt data 0))
(>= (-> box max data 1) (-> pt data 1))
(>= (-> box max data 2) (-> pt data 2))
)
)