
:origin()/pre00/0b1d/th/pre/i/2006/307/0/0/collision_of_worlds_by_alexiuss.jpg)
One of them is to define an AABB by a top-left and a bottom-right position. This is exactly what we're going to do.Īxis aligned bounding boxes can be defined in several ways. Here we surround the ball object with an AABB:Īlmost all the objects in Breakout are rectangular based objects, so it makes perfect sense to use axis aligned bounding boxes for detecting collisions. The fact that these boxes are always aligned to the axes of the scene makes calculations easier. left and right edge are parallel to the y axis). Being axis-aligned means the rectangular box has no rotation and its edges are parallel to the base axes of the scene (e.g. The effect is that a collision may be detected that didn't really collide with the actual object one should always keep in mind that these shapes are just approximations of the real shapes.ĪABB stands for axis-aligned bounding box, a rectangular collision shape aligned to the base axes of the scene, which in 2D aligns to the x and y axis.

While the simple shapes do give us easier and more efficient collision detection algorithms, they share a common disadvantage in that these shapes usually do not fully surround the object. A few examples of such collision shapes are circles, spheres, rectangles, and boxes these are a lot simpler to work with compared to arbitrary meshes with hundreds of triangles.
GIDEROS COMPLEX COLLISION DETECTION CODE
We then check for collisions based on these simple shapes this makes the code easier and saves a lot of performance. For this reason, it is a common practice to use more simple shapes (that usually have a nice mathematical definition) for collision detection that we overlay on top of the original object. When trying to determine if a collision occurs between two objects, we generally do not use the vertex data of the objects themselves since these objects often have complicated shapes this in turn makes the collision detection complicated. Collision detection In-Practice/2D-Game/Collisions/Collision-detection
