Class AABB
AABB metatype, wrapper for godot_aabb
.
Constructed using the idiom AABB(...)
, which calls __new.
typedef union godot_aabb { uint8_t data[24]; float elements[6]; struct { Vector3 position, size; }; } godot_aabb;
Methods
AABB:encloses (with) | Returns true if this AABB completely encloses another one. |
AABB:expand (point) | Returns this AABB expanded to include a given point . |
AABB:get_area () | Returns the volume of the AABB. |
AABB:get_endpoint (index) | Gets the position of the 8 endpoints of the AABB in space. |
AABB:get_longest_axis () | Returns the normalized longest axis of the AABB. |
AABB:get_longest_axis_index () | Returns the index of the longest axis of the AABB (according to Vector3's AXIS_* constants). |
AABB:get_longest_axis_size () | Returns the scalar length of the longest axis of the AABB. |
AABB:get_shortest_axis () | Returns the normalized shortest axis of the AABB. |
AABB:get_shortest_axis_index () | Returns the index of the shortest axis of the AABB (according to Vector3's AXIS_* constants). |
AABB:get_shortest_axis_size () | Returns the scalar length of the shortest axis of the AABB. |
AABB:get_support (direction) | Returns the support point in a given direction . |
AABB:grow (by) | Returns a copy of the AABB grown a given amount of units towards all the sides. |
AABB:has_no_area () | Returns true if the AABB is flat or empty. |
AABB:has_no_surface () | Returns true if the AABB is empty. |
AABB:has_point (point) | Returns true if the AABB contains a point. |
AABB:intersection (with) | Returns the intersection between two AABB. |
AABB:intersects (with) | Returns true if the AABB overlaps with another. |
AABB:intersects_plane (plane) | Returns true if the AABB is on both sides of a plane. |
AABB:intersects_segment (from, to) | Returns true if the AABB intersects the line segment between from and to . |
AABB:merge (with) | Returns a larger AABB that contains both this AABB and with . |
Metamethods
AABB:__concat (a, b) | Concatenates values. |
AABB:__eq (a, b) | Equality operation
If either a or b are not of type AABB, always return false . |
AABB:__new (...) | AABB constructor, called by the idiom AABB(...) . |
AABB:__tostring () | Returns a Lua string representation of this AABB. |
Methods
- AABB:encloses (with)
-
Returns
true
if this AABB completely encloses another one.Parameters:
- with AABB
Returns:
-
bool
- AABB:expand (point)
-
Returns this AABB expanded to include a given
point
.Parameters:
- point Vector3
Returns:
- AABB:get_area ()
-
Returns the volume of the AABB.
Returns:
-
number
- AABB:get_endpoint (index)
-
Gets the position of the 8 endpoints of the AABB in space.
Parameters:
- index int
Returns:
- AABB:get_longest_axis ()
-
Returns the normalized longest axis of the AABB.
Returns:
- AABB:get_longest_axis_index ()
-
Returns the index of the longest axis of the AABB (according to Vector3's
AXIS_*
constants).Returns:
-
int
- AABB:get_longest_axis_size ()
-
Returns the scalar length of the longest axis of the AABB.
Returns:
-
number
- AABB:get_shortest_axis ()
-
Returns the normalized shortest axis of the AABB.
Returns:
- AABB:get_shortest_axis_index ()
-
Returns the index of the shortest axis of the AABB (according to Vector3's
AXIS_*
constants).Returns:
-
int
- AABB:get_shortest_axis_size ()
-
Returns the scalar length of the shortest axis of the AABB.
Returns:
-
number
- AABB:get_support (direction)
-
Returns the support point in a given
direction
. This is useful for collision detection algorithms.Parameters:
- direction Vector3
Returns:
- AABB:grow (by)
-
Returns a copy of the AABB grown a given amount of units towards all the sides.
Parameters:
- by number
Returns:
- AABB:has_no_area ()
-
Returns
true
if the AABB is flat or empty.Returns:
-
bool
- AABB:has_no_surface ()
-
Returns
true
if the AABB is empty.Returns:
-
bool
- AABB:has_point (point)
-
Returns
true
if the AABB contains a point.Parameters:
- point Vector3
Returns:
-
bool
- AABB:intersection (with)
-
Returns the intersection between two AABB. An empty AABB (size 0,0,0) is returned on failure.
Parameters:
- with AABB
Returns:
- AABB:intersects (with)
-
Returns
true
if the AABB overlaps with another.Parameters:
- with AABB
Returns:
-
bool
- AABB:intersects_plane (plane)
-
Returns
true
if the AABB is on both sides of a plane.Parameters:
- plane Plane
Returns:
-
bool
- AABB:intersects_segment (from, to)
-
Returns
true
if the AABB intersects the line segment betweenfrom
andto
.Parameters:
Returns:
-
bool
- AABB:merge (with)
-
Returns a larger AABB that contains both this AABB and
with
.Parameters:
- with AABB
Returns:
Metamethods
- AABB:__concat (a, b)
-
Concatenates values.
Parameters:
Returns:
- AABB:__eq (a, b)
-
Equality operation
If either
a
orb
are not of type AABB, always returnfalse
.Parameters:
Returns:
-
bool
- AABB:__new (...)
-
AABB constructor, called by the idiom
AABB(...)
.AABB()
: all zeros (AABB() == AABB(Vector3.ZERO, Vector3.ZERO)
)AABB(Vector3 position, Vector3 size)
: set position and sizeAABB(AABB other)
: copy values fromother
Parameters:
- ...
Returns:
- AABB:__tostring ()
-
Returns a Lua string representation of this AABB.
Returns: