.. role:: ts-api-decorator

###########
BoundingBox
###########

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: BoundingBox

      An axis-oriented bounding box storing the extent of an object.

      All vertices of the object that the bounding box has been computed for will be within the 
      box defined by the min and max corners.

      Note that this class is immutable.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.BoundingBox.constructor`



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-class

   * :js:attr:`~cee.BoundingBox.maximum`
   * :js:attr:`~cee.BoundingBox.minimum`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.BoundingBox.getCenter`
   * :js:meth:`~cee.BoundingBox.getExtent`
   * :js:meth:`~cee.BoundingBox.isValid`
   * :js:meth:`~cee.BoundingBox.createInvalid`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: BoundingBox.constructor( minimum, maximum)

      :param minimum: None
      :type minimum: Vec3Like
      :param maximum: None
      :type maximum: Vec3Like


      Creates a bounding box with the given min and max corners.


      :rtype: BoundingBox



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: BoundingBox.maximum

      :type: Vec3

      The maximum values for x, y and z across all vertices in the object.



.. container:: ts-api-section

   .. js:attribute:: BoundingBox.minimum

      :type: Vec3

      The minimum values for x, y and z across all vertices in the object.



Methods
=======

.. rst-class:: ts-api-section

getCenter
---------

.. js:method:: BoundingBox.getCenter()



   Returns the center of the bounding box


   :rtype: Vec3

.. rst-class:: ts-api-section

getExtent
---------

.. js:method:: BoundingBox.getExtent()



   Returns the extent for each component (x,y,z) of the bounding box (maximum - minimum).


   :rtype: Vec3

.. rst-class:: ts-api-section

isValid
-------

.. js:method:: BoundingBox.isValid()



   Returns true if the bounding box is valid, i.e. if minimum < maximum for x, y and z.


   :rtype: boolean

.. rst-class:: ts-api-section

:ts-api-decorator:`static` createInvalid
----------------------------------------

.. js:method:: BoundingBox.createInvalid()



   Creates an invalid bounding box where maximum < minimum for x, y and z


   :rtype: BoundingBox

