OBB (Oriented Bounding Box)
-
Hi,
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.
-
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.
QRect
andQRectF
are normal rectangles, they can't be rotated as such.QTransform
can 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 (QPolygon::intersected
).