Collision detection

Home / Features / Collision detection

EDGELIB supports two types of collision detection: bounding box and pixel precision, for respectively comparing two rectangles for intersection and comparing two surfaces (with pixel data) for pixel precise collision detection.

Collision can be checked between 2D surfaces, RGBA surfaces or a combination.

Optionally, the point of collision can be retrieved as well. As of EDGELIB 2.60, you can check rectangle intersection and if a point is inside a rectangle.

The following images demonstrate bounding box collision detection:

Bounding box collision 1
Bounding box collision 1
Bounding box collision 2
Bounding box collision 2

The next images demonstrate pixel precise collision detection:

Pixel precise collision 1
Pixel precise collision 1
Pixel precise collision 2
Pixel precise collision 2

Back to Features

Latest forum posts