0 votes

What is AABB? Is it related to collisionShape? When should one use an AABB?

in Engine by (36 points)

1 Answer

+2 votes
Best answer

AABB stands for "Axis-Aligned-Bounding-Box". In 2D there is Rect2, which is only a point and a size (a pair of Vector2). AABB is the 3D counterpart, a point and a size as a pair of Vector3.
It's not a collision shape, it's only a super-basic math structure representing a box in space.
Doc: https://docs.godotengine.org/en/3.1/classes/class_aabb.html

AABBs are used in variables when you need to get the bounds of an object in space, because it's more handy than having to carry two vector variables. For example, they are used as value type when getting the bounds of a VisualInstance node: https://docs.godotengine.org/en/3.1/classes/class_visualinstance.html#class-visualinstance

by (29,042 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.