mirror of
https://github.com/open-goal/jak-project
synced 2026-08-27 16:37:36 -04:00
126dfc1c45
* more cases * some work on math and floating point stuff * some decompiling for fun
31 lines
874 B
Common Lisp
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))
|
|
)
|
|
)
|