:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AABB.xml. .. _class_AABB: AABB ==== A 3D axis-aligned bounding box. .. rst-class:: classref-introduction-group Description ----------- The **AABB** built-in :ref:`Variant` type represents an axis-aligned bounding box in a 3D space. It is defined by its :ref:`position` and :ref:`size`, which are :ref:`Vector3`. It is frequently used for fast overlap tests (see :ref:`intersects()`). Although **AABB** itself is axis-aligned, it can be combined with :ref:`Transform3D` to represent a rotated or skewed bounding box. It uses floating-point coordinates. The 2D counterpart to **AABB** is :ref:`Rect2`. There is no version of **AABB** that uses integer coordinates. \ **Note:** Negative values for :ref:`size` are not supported. With negative size, most **AABB** methods do not work correctly. Use :ref:`abs()` to get an equivalent **AABB** with a non-negative size. \ **Note:** In a boolean context, an **AABB** evaluates to ``false`` if both :ref:`position` and :ref:`size` are zero (equal to :ref:`Vector3.ZERO`). Otherwise, it always evaluates to ``true``. .. note:: There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information. .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`Math documentation index <../tutorials/math/index>` - :doc:`Vector math <../tutorials/math/vector_math>` - :doc:`Advanced vector math <../tutorials/math/vectors_advanced>` .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------+-----------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`end` | ``Vector3(0, 0, 0)`` | +-------------------------------+-----------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`position` | ``Vector3(0, 0, 0)`` | +-------------------------------+-----------------------------------------------+----------------------+ | :ref:`Vector3` | :ref:`size` | ``Vector3(0, 0, 0)`` | +-------------------------------+-----------------------------------------------+----------------------+ .. rst-class:: classref-reftable-group Constructors ------------ .. table:: :widths: auto +-------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`AABB`\ (\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`AABB`\ (\ from\: :ref:`AABB`\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`AABB`\ (\ position\: :ref:`Vector3`, size\: :ref:`Vector3`\ ) | +-------------------------+--------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`abs`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`encloses`\ (\ with\: :ref:`AABB`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`expand`\ (\ to_point\: :ref:`Vector3`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_center`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_endpoint`\ (\ idx\: :ref:`int`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_longest_axis`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_longest_axis_index`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_longest_axis_size`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_shortest_axis`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_shortest_axis_index`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_shortest_axis_size`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_support`\ (\ direction\: :ref:`Vector3`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_volume`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`grow`\ (\ by\: :ref:`float`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_point`\ (\ point\: :ref:`Vector3`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_surface`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_volume`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`intersection`\ (\ with\: :ref:`AABB`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`intersects`\ (\ with\: :ref:`AABB`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`intersects_plane`\ (\ plane\: :ref:`Plane`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`intersects_ray`\ (\ from\: :ref:`Vector3`, dir\: :ref:`Vector3`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`intersects_segment`\ (\ from\: :ref:`Vector3`, to\: :ref:`Vector3`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx`\ (\ aabb\: :ref:`AABB`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_finite`\ (\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`merge`\ (\ with\: :ref:`AABB`\ ) |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Operators --------- .. table:: :widths: auto +-------------------------+-------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator !=`\ (\ right\: :ref:`AABB`\ ) | +-------------------------+-------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`operator *`\ (\ right\: :ref:`Transform3D`\ ) | +-------------------------+-------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`operator ==`\ (\ right\: :ref:`AABB`\ ) | +-------------------------+-------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_AABB_property_end: .. rst-class:: classref-property :ref:`Vector3` **end** = ``Vector3(0, 0, 0)`` :ref:`🔗` The ending point. This is usually the corner on the top-right and back of the bounding box, and is equivalent to ``position + size``. Setting this point affects the :ref:`size`. .. rst-class:: classref-item-separator ---- .. _class_AABB_property_position: .. rst-class:: classref-property :ref:`Vector3` **position** = ``Vector3(0, 0, 0)`` :ref:`🔗` The origin point. This is usually the corner on the bottom-left and forward of the bounding box. .. rst-class:: classref-item-separator ---- .. _class_AABB_property_size: .. rst-class:: classref-property :ref:`Vector3` **size** = ``Vector3(0, 0, 0)`` :ref:`🔗` The bounding box's width, height, and depth starting from :ref:`position`. Setting this value also affects the :ref:`end` point. \ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the :ref:`position` is the bottom-left-forward corner, and the :ref:`end` is the top-right-back corner. To get an equivalent bounding box with non-negative size, use :ref:`abs()`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Constructor Descriptions ------------------------ .. _class_AABB_constructor_AABB: .. rst-class:: classref-constructor :ref:`AABB` **AABB**\ (\ ) :ref:`🔗` Constructs an **AABB** with its :ref:`position` and :ref:`size` set to :ref:`Vector3.ZERO`. .. rst-class:: classref-item-separator ---- .. rst-class:: classref-constructor :ref:`AABB` **AABB**\ (\ from\: :ref:`AABB`\ ) Constructs an **AABB** as a copy of the given **AABB**. .. rst-class:: classref-item-separator ---- .. rst-class:: classref-constructor :ref:`AABB` **AABB**\ (\ position\: :ref:`Vector3`, size\: :ref:`Vector3`\ ) Constructs an **AABB** by ``position`` and ``size``. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AABB_method_abs: .. rst-class:: classref-method :ref:`AABB` **abs**\ (\ ) |const| :ref:`🔗` Returns an **AABB** equivalent to this bounding box, with its width, height, and depth modified to be non-negative values. .. tabs:: .. code-tab:: gdscript var box = AABB(Vector3(5, 0, 5), Vector3(-20, -10, -5)) var absolute = box.abs() print(absolute.position) # Prints (-15.0, -10.0, 0.0) print(absolute.size) # Prints (20.0, 10.0, 5.0) .. code-tab:: csharp var box = new Aabb(new Vector3(5, 0, 5), new Vector3(-20, -10, -5)); var absolute = box.Abs(); GD.Print(absolute.Position); // Prints (-15, -10, 0) GD.Print(absolute.Size); // Prints (20, 10, 5) \ **Note:** It's recommended to use this method when :ref:`size` is negative, as most other methods in Godot assume that the :ref:`size`'s components are greater than ``0``. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_encloses: .. rst-class:: classref-method :ref:`bool` **encloses**\ (\ with\: :ref:`AABB`\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box *completely* encloses the ``with`` box. The edges of both boxes are included. .. tabs:: .. code-tab:: gdscript var a = AABB(Vector3(0, 0, 0), Vector3(4, 4, 4)) var b = AABB(Vector3(1, 1, 1), Vector3(3, 3, 3)) var c = AABB(Vector3(2, 2, 2), Vector3(8, 8, 8)) print(a.encloses(a)) # Prints true print(a.encloses(b)) # Prints true print(a.encloses(c)) # Prints false .. code-tab:: csharp var a = new Aabb(new Vector3(0, 0, 0), new Vector3(4, 4, 4)); var b = new Aabb(new Vector3(1, 1, 1), new Vector3(3, 3, 3)); var c = new Aabb(new Vector3(2, 2, 2), new Vector3(8, 8, 8)); GD.Print(a.Encloses(a)); // Prints True GD.Print(a.Encloses(b)); // Prints True GD.Print(a.Encloses(c)); // Prints False .. rst-class:: classref-item-separator ---- .. _class_AABB_method_expand: .. rst-class:: classref-method :ref:`AABB` **expand**\ (\ to_point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns a copy of this bounding box expanded to align the edges with the given ``to_point``, if necessary. .. tabs:: .. code-tab:: gdscript var box = AABB(Vector3(0, 0, 0), Vector3(5, 2, 5)) box = box.expand(Vector3(10, 0, 0)) print(box.position) # Prints (0.0, 0.0, 0.0) print(box.size) # Prints (10.0, 2.0, 5.0) box = box.expand(Vector3(-5, 0, 5)) print(box.position) # Prints (-5.0, 0.0, 0.0) print(box.size) # Prints (15.0, 2.0, 5.0) .. code-tab:: csharp var box = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 5)); box = box.Expand(new Vector3(10, 0, 0)); GD.Print(box.Position); // Prints (0, 0, 0) GD.Print(box.Size); // Prints (10, 2, 5) box = box.Expand(new Vector3(-5, 0, 5)); GD.Print(box.Position); // Prints (-5, 0, 0) GD.Print(box.Size); // Prints (15, 2, 5) .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_center: .. rst-class:: classref-method :ref:`Vector3` **get_center**\ (\ ) |const| :ref:`🔗` Returns the center point of the bounding box. This is the same as ``position + (size / 2.0)``. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_endpoint: .. rst-class:: classref-method :ref:`Vector3` **get_endpoint**\ (\ idx\: :ref:`int`\ ) |const| :ref:`🔗` Returns the position of one of the 8 vertices that compose this bounding box. With an ``idx`` of ``0`` this is the same as :ref:`position`, and an ``idx`` of ``7`` is the same as :ref:`end`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_longest_axis: .. rst-class:: classref-method :ref:`Vector3` **get_longest_axis**\ (\ ) |const| :ref:`🔗` Returns the longest normalized axis of this bounding box's :ref:`size`, as a :ref:`Vector3` (:ref:`Vector3.RIGHT`, :ref:`Vector3.UP`, or :ref:`Vector3.BACK`). .. tabs:: .. code-tab:: gdscript var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8)) print(box.get_longest_axis()) # Prints (0.0, 0.0, 1.0) print(box.get_longest_axis_index()) # Prints 2 print(box.get_longest_axis_size()) # Prints 8.0 .. code-tab:: csharp var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8)); GD.Print(box.GetLongestAxis()); // Prints (0, 0, 1) GD.Print(box.GetLongestAxisIndex()); // Prints Z GD.Print(box.GetLongestAxisSize()); // Prints 8 See also :ref:`get_longest_axis_index()` and :ref:`get_longest_axis_size()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_longest_axis_index: .. rst-class:: classref-method :ref:`int` **get_longest_axis_index**\ (\ ) |const| :ref:`🔗` Returns the index to the longest axis of this bounding box's :ref:`size` (see :ref:`Vector3.AXIS_X`, :ref:`Vector3.AXIS_Y`, and :ref:`Vector3.AXIS_Z`). For an example, see :ref:`get_longest_axis()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_longest_axis_size: .. rst-class:: classref-method :ref:`float` **get_longest_axis_size**\ (\ ) |const| :ref:`🔗` Returns the longest dimension of this bounding box's :ref:`size`. For an example, see :ref:`get_longest_axis()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_shortest_axis: .. rst-class:: classref-method :ref:`Vector3` **get_shortest_axis**\ (\ ) |const| :ref:`🔗` Returns the shortest normalized axis of this bounding box's :ref:`size`, as a :ref:`Vector3` (:ref:`Vector3.RIGHT`, :ref:`Vector3.UP`, or :ref:`Vector3.BACK`). .. tabs:: .. code-tab:: gdscript var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8)) print(box.get_shortest_axis()) # Prints (1.0, 0.0, 0.0) print(box.get_shortest_axis_index()) # Prints 0 print(box.get_shortest_axis_size()) # Prints 2.0 .. code-tab:: csharp var box = new Aabb(new Vector3(0, 0, 0), new Vector3(2, 4, 8)); GD.Print(box.GetShortestAxis()); // Prints (1, 0, 0) GD.Print(box.GetShortestAxisIndex()); // Prints X GD.Print(box.GetShortestAxisSize()); // Prints 2 See also :ref:`get_shortest_axis_index()` and :ref:`get_shortest_axis_size()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_shortest_axis_index: .. rst-class:: classref-method :ref:`int` **get_shortest_axis_index**\ (\ ) |const| :ref:`🔗` Returns the index to the shortest axis of this bounding box's :ref:`size` (see :ref:`Vector3.AXIS_X`, :ref:`Vector3.AXIS_Y`, and :ref:`Vector3.AXIS_Z`). For an example, see :ref:`get_shortest_axis()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_shortest_axis_size: .. rst-class:: classref-method :ref:`float` **get_shortest_axis_size**\ (\ ) |const| :ref:`🔗` Returns the shortest dimension of this bounding box's :ref:`size`. For an example, see :ref:`get_shortest_axis()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_support: .. rst-class:: classref-method :ref:`Vector3` **get_support**\ (\ direction\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_get_volume: .. rst-class:: classref-method :ref:`float` **get_volume**\ (\ ) |const| :ref:`🔗` Returns the bounding box's volume. This is equivalent to ``size.x * size.y * size.z``. See also :ref:`has_volume()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_grow: .. rst-class:: classref-method :ref:`AABB` **grow**\ (\ by\: :ref:`float`\ ) |const| :ref:`🔗` Returns a copy of this bounding box extended on all sides by the given amount ``by``. A negative amount shrinks the box instead. .. tabs:: .. code-tab:: gdscript var a = AABB(Vector3(4, 4, 4), Vector3(8, 8, 8)).grow(4) print(a.position) # Prints (0.0, 0.0, 0.0) print(a.size) # Prints (16.0, 16.0, 16.0) var b = AABB(Vector3(0, 0, 0), Vector3(8, 4, 2)).grow(2) print(b.position) # Prints (-2.0, -2.0, -2.0) print(b.size) # Prints (12.0, 8.0, 6.0) .. code-tab:: csharp var a = new Aabb(new Vector3(4, 4, 4), new Vector3(8, 8, 8)).Grow(4); GD.Print(a.Position); // Prints (0, 0, 0) GD.Print(a.Size); // Prints (16, 16, 16) var b = new Aabb(new Vector3(0, 0, 0), new Vector3(8, 4, 2)).Grow(2); GD.Print(b.Position); // Prints (-2, -2, -2) GD.Print(b.Size); // Prints (12, 8, 6) .. rst-class:: classref-item-separator ---- .. _class_AABB_method_has_point: .. rst-class:: classref-method :ref:`bool` **has_point**\ (\ point\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns ``true`` if the bounding box contains the given ``point``. By convention, points exactly on the right, top, and front sides are **not** included. \ **Note:** This method is not reliable for **AABB** with a *negative* :ref:`size`. Use :ref:`abs()` first to get a valid bounding box. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_has_surface: .. rst-class:: classref-method :ref:`bool` **has_surface**\ (\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box has a surface or a length, that is, at least one component of :ref:`size` is greater than ``0``. Otherwise, returns ``false``. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_has_volume: .. rst-class:: classref-method :ref:`bool` **has_volume**\ (\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box's width, height, and depth are all positive. See also :ref:`get_volume()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_intersection: .. rst-class:: classref-method :ref:`AABB` **intersection**\ (\ with\: :ref:`AABB`\ ) |const| :ref:`🔗` Returns the intersection between this bounding box and ``with``. If the boxes do not intersect, returns an empty **AABB**. If the boxes intersect at the edge, returns a flat **AABB** with no volume (see :ref:`has_surface()` and :ref:`has_volume()`). .. tabs:: .. code-tab:: gdscript var box1 = AABB(Vector3(0, 0, 0), Vector3(5, 2, 8)) var box2 = AABB(Vector3(2, 0, 2), Vector3(8, 4, 4)) var intersection = box1.intersection(box2) print(intersection.position) # Prints (2.0, 0.0, 2.0) print(intersection.size) # Prints (3.0, 2.0, 4.0) .. code-tab:: csharp var box1 = new Aabb(new Vector3(0, 0, 0), new Vector3(5, 2, 8)); var box2 = new Aabb(new Vector3(2, 0, 2), new Vector3(8, 4, 4)); var intersection = box1.Intersection(box2); GD.Print(intersection.Position); // Prints (2, 0, 2) GD.Print(intersection.Size); // Prints (3, 2, 4) \ **Note:** If you only need to know whether two bounding boxes are intersecting, use :ref:`intersects()`, instead. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_intersects: .. rst-class:: classref-method :ref:`bool` **intersects**\ (\ with\: :ref:`AABB`\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box overlaps with the box ``with``. The edges of both boxes are *always* excluded. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_intersects_plane: .. rst-class:: classref-method :ref:`bool` **intersects_plane**\ (\ plane\: :ref:`Plane`\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box is on both sides of the given ``plane``. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_intersects_ray: .. rst-class:: classref-method :ref:`Variant` **intersects_ray**\ (\ from\: :ref:`Vector3`, dir\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the first point where this bounding box and the given ray intersect, as a :ref:`Vector3`. If no intersection occurs, returns ``null``. The ray begin at ``from``, faces ``dir`` and extends towards infinity. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_intersects_segment: .. rst-class:: classref-method :ref:`Variant` **intersects_segment**\ (\ from\: :ref:`Vector3`, to\: :ref:`Vector3`\ ) |const| :ref:`🔗` Returns the first point where this bounding box and the given segment intersect, as a :ref:`Vector3`. If no intersection occurs, returns ``null``. The segment begins at ``from`` and ends at ``to``. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_is_equal_approx: .. rst-class:: classref-method :ref:`bool` **is_equal_approx**\ (\ aabb\: :ref:`AABB`\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box and ``aabb`` are approximately equal, by calling :ref:`Vector3.is_equal_approx()` on the :ref:`position` and the :ref:`size`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_is_finite: .. rst-class:: classref-method :ref:`bool` **is_finite**\ (\ ) |const| :ref:`🔗` Returns ``true`` if this bounding box's values are finite, by calling :ref:`Vector3.is_finite()` on the :ref:`position` and the :ref:`size`. .. rst-class:: classref-item-separator ---- .. _class_AABB_method_merge: .. rst-class:: classref-method :ref:`AABB` **merge**\ (\ with\: :ref:`AABB`\ ) |const| :ref:`🔗` Returns an **AABB** that encloses both this bounding box and ``with`` around the edges. See also :ref:`encloses()`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Operator Descriptions --------------------- .. _class_AABB_operator_neq_AABB: .. rst-class:: classref-operator :ref:`bool` **operator !=**\ (\ right\: :ref:`AABB`\ ) :ref:`🔗` Returns ``true`` if the :ref:`position` or :ref:`size` of both bounding boxes are not equal. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. rst-class:: classref-item-separator ---- .. _class_AABB_operator_mul_Transform3D: .. rst-class:: classref-operator :ref:`AABB` **operator ***\ (\ right\: :ref:`Transform3D`\ ) :ref:`🔗` Inversely transforms (multiplies) the **AABB** by the given :ref:`Transform3D` transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not). \ ``aabb * transform`` is equivalent to ``transform.inverse() * aabb``. See :ref:`Transform3D.inverse()`. For transforming by inverse of an affine transformation (e.g. with scaling) ``transform.affine_inverse() * aabb`` can be used instead. See :ref:`Transform3D.affine_inverse()`. .. rst-class:: classref-item-separator ---- .. _class_AABB_operator_eq_AABB: .. rst-class:: classref-operator :ref:`bool` **operator ==**\ (\ right\: :ref:`AABB`\ ) :ref:`🔗` Returns ``true`` if both :ref:`position` and :ref:`size` of the bounding boxes are exactly equal, respectively. \ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()` instead, which is more reliable. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`