I am trying to check collisions between a QPolygon and a QRect by turning the QRect into a QPolygon. However, the rectangle might also have a rotation that I have added, so I am wondering how I would turn that QRect into a QPolygon taking into account the rotation?
I think you can convert QRect
into QPolygon
using QMatrix::mapToPolygon
.
Here is the description: http://doc.qt.io/qt-5/qmatrix.html#mapToPolygon
I believe you will be able to convert your QRect
into QPolygon
taking the rotation matrix into account.
Edit: Actually QTransform::mapToPolygon
can be more suitable in this case. Please try:
http://doc.qt.io/qt-5/qtransform.html#mapToPolygon
as well.