;;-*-Lisp-*-
(in-package goal)
(bundles "ENGINE.CGO" "GAME.CGO")
(require "kernel-defs.gc")

;; Types related to bounding boxes.

;; DECOMP BEGINS

;; floating point bounding box.
;; min is the corner with lowest x,y,z values.
;; max is the corner with highest x,y,z values.
;; the w value should be 1 in both min and max.
(deftype bounding-box (structure)
  ((min vector :inline)
   (max vector :inline))
  (:methods
   (add-spheres! (_type_ (inline-array sphere) int) int)
   (add-point! (_type_ vector3s) int)
   (set-from-point-offset! (_type_ vector3s vector3s) int)
   (set-from-point-offset-pad! (_type_ vector3s vector3s float) int)
   (set-from-sphere! (_type_ sphere) int)
   (set-from-spheres! (_type_ (inline-array sphere) int) int)
   (add-box! (_type_ bounding-box) int)))

;; integer (word) bounding box.
(deftype bounding-box4w (structure)
  ((min vector4w :inline)
   (max vector4w :inline)))

;; bounding both that has both a box and box4w.
;; these are used in the collision system where it is useful to have both float/int versions.
(deftype bounding-box-both (structure)
  ((box   bounding-box :inline)
   (box4w bounding-box4w :inline)))
