Click or drag to resize

AABB Structure

Axis-Aligned Bounding Box. AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
[SerializableAttribute]
public struct AABB : IEquatable<AABB>

The AABB type exposes the following members.

Constructors
  NameDescription
Public methodAABB(Vector3, Vector3)
Constructs an AABB from a position and size.
Public methodAABB(Single, Single, Single, Vector3)
Constructs an AABB from x, y, z, and size.
Public methodAABB(Vector3, Single, Single, Single)
Constructs an AABB from a position, width, height, and depth.
Public methodAABB(Single, Single, Single, Single, Single, Single)
Constructs an AABB from x, y, z, width, height, and depth.
Top
Properties
  NameDescription
Public propertyEnd
Ending corner. This is calculated as Position plus Size. Setting this value will change the size.
Public propertyPosition
Beginning corner. Typically has values lower than End.
Public propertySize
Size from Position to End. Typically all components are positive. If the size is negative, you can use Abs to fix it.
Top
Methods
  NameDescription
Public methodAbs
Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive.
Public methodEncloses
Returns true if this AABB completely encloses another one.
Public methodEquals(Object) (Overrides ValueTypeEquals(Object).)
Public methodEquals(AABB)
Public methodExpand
Returns this AABB expanded to include a given point.
Public methodGetArea
Returns the area of the AABB.
Public methodGetEndpoint
Gets the position of one of the 8 endpoints of the AABB.
Public methodGetHashCode (Overrides ValueTypeGetHashCode.)
Public methodGetLongestAxis
Returns the normalized longest axis of the AABB.
Public methodGetLongestAxisIndex
Public methodGetLongestAxisSize
Returns the scalar length of the longest axis of the AABB.
Public methodGetShortestAxis
Returns the normalized shortest axis of the AABB.
Public methodGetShortestAxisIndex
Public methodGetShortestAxisSize
Returns the scalar length of the shortest axis of the AABB.
Public methodGetSupport
Returns the support point in a given direction. This is useful for collision detection algorithms.
Public methodGetType (Inherited from Object.)
Public methodGrow
Returns a copy of the AABB grown a given amount of units towards all the sides.
Public methodHasNoArea
Returns true if the AABB is flat or empty, or false otherwise.
Public methodHasNoSurface
Returns true if the AABB has no surface (no size), or false otherwise.
Public methodHasPoint
Returns true if the AABB contains a point, or false otherwise.
Public methodIntersection
Returns the intersection of this AABB and `b`.
Public methodIntersects
Returns true if the AABB overlaps with `b` (i.e. they have at least one point in common). If `includeBorders` is true, they will also be considered overlapping if their borders touch, even without intersection.
Public methodIntersectsPlane
Returns true if the AABB is on both sides of `plane`.
Public methodIntersectsSegment
Returns true if the AABB intersects the line segment between `from` and `to`.
Public methodIsEqualApprox
Returns true if this AABB and `other` are approximately equal, by running IsEqualApprox(Vector3) on each component.
Public methodMerge
Returns a larger AABB that contains this AABB and `b`.
Public methodToString (Overrides ValueTypeToString.)
Public methodToString(String)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Public operatorStatic memberInequality
Top
See Also