You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the physics section, you can add an algorithm that allows you to detect collisions of different types of primitives. This will be useful when creating games, etc.
The text was updated successfully, but these errors were encountered:
Axis-Aligned Bounding Box (AABB) Collision Detection
An AABB is a rectangle whose edges are aligned with the coordinate axes. Collision detection between two AABBs is relatively straightforward:
Define Boundaries: Each rectangle is defined by its minimum and maximum x and y coordinates (or alternatively, by its top-left corner and width/height).
Check for Overlap: For two rectangles to collide, they must overlap in both the x and y axes. This can be checked with simple comparisons.
The conditions for two AABBs to intersect can be expressed as:
Rect1.x < Rect2.x + Rect2.width
Rect1.x + Rect1.width > Rect2.x
Rect1.y < Rect2.y + Rect2.height
Rect1.y + Rect1.height > Rect2.y
If all these conditions are true, the rectangles intersect.
Feature description
In the physics section, you can add an algorithm that allows you to detect collisions of different types of primitives. This will be useful when creating games, etc.
The text was updated successfully, but these errors were encountered: