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?
Share
I think you can convert
QRectintoQPolygonusingQMatrix::mapToPolygon.Here is the description: http://doc.qt.io/qt-5/qmatrix.html#mapToPolygon
I believe you will be able to convert your
QRectintoQPolygontaking the rotation matrix into account.Edit: Actually
QTransform::mapToPolygoncan be more suitable in this case. Please try:http://doc.qt.io/qt-5/qtransform.html#mapToPolygon
as well.