OBB (Oriented Bounding Box)
is there any class in Qt for OBB?
I have checked QRectf but it seems that it is AABB (Axis aligned bounding box). Infact, I couldn't find any method in it for rotating it or setting angle in it.
Are you looking for QTransform ?
I suppose it only transforms(rotates) the QRectf. What I really need is QRectf::intersect method. I seems to me it only works when two QRectf are aligned to the axies.
I have tested QGraphicsItem::collidesWithItem. it works finely with rotted objects. yet it is a graphic item, not a class for testing collision.
QRectFare normal rectangles, they can't be rotated as such.
QTransformcan be used with them, but will give you again a normal rectangle (i.e. the bounding box of the operation). You can however apply the transformation to points (
QPoint), lines (
QLine), polygons (
QPolygon) and paths (
QPainterPath). You can get the intersection of polygons though (