- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

Classes | Functions

# qmatrix4x4.h File Reference

`#include <QtGui/qvector3d.h>`
`#include <QtGui/qvector4d.h>`
`#include <QtGui/qquaternion.h>`
`#include <QtGui/qgenericmatrix.h>`
`#include <QtCore/qrect.h>`

Go to the source code of this file.

## Classes
class | QMatrix4x4
## Functions
| Q_DECLARE_TYPEINFO (QMatrix4x4, Q_MOVABLE_TYPE)
Q_GUI_EXPORT QMatrix4x4 | operator/ (const QMatrix4x4 &matrix, qreal divisor)
QMatrix4x4 | operator+ (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
QMatrix4x4 | operator- (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
QMatrix4x4 | operator* (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
QVector3D | operator* (const QVector3D &vector, const QMatrix4x4 &matrix)
QVector3D | operator* (const QMatrix4x4 &matrix, const QVector3D &vector)
QVector4D | operator* (const QVector4D &vector, const QMatrix4x4 &matrix)
QVector4D | operator* (const QMatrix4x4 &matrix, const QVector4D &vector)
QPoint | operator* (const QPoint &point, const QMatrix4x4 &matrix)
QPointF | operator* (const QPointF &point, const QMatrix4x4 &matrix)
QPoint | operator* (const QMatrix4x4 &matrix, const QPoint &point)
QPointF | operator* (const QMatrix4x4 &matrix, const QPointF &point)
QMatrix4x4 | operator- (const QMatrix4x4 &matrix)
QMatrix4x4 | operator* (qreal factor, const QMatrix4x4 &matrix)
QMatrix4x4 | operator* (const QMatrix4x4 &matrix, qreal factor)
bool | qFuzzyCompare (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
Q_GUI_EXPORT QDebug | operator<< (QDebug dbg, const QMatrix4x4 &m)
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QMatrix4x4 &)
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QMatrix4x4 &)
template<int N, int M>
QMatrix4x4 | qGenericMatrixToMatrix4x4 (const QGenericMatrix< N, M, qreal > &matrix)
template<int N, int M>
QGenericMatrix< N, M, qreal > | qGenericMatrixFromMatrix4x4 (const QMatrix4x4 &matrix)

## Function Documentation

Q_DECLARE_TYPEINFO | ( | QMatrix4x4 | ,
|  | Q_MOVABLE_TYPE |
| ) |  |

Search for all occurrences

Q_GUI_EXPORT QMatrix4x4 operator/ | ( | const QMatrix4x4 & | matrix,
|  | qreal | divisor
| ) |  |

QMatrix4x4 operator+ | ( | const QMatrix4x4 & | m1,
|  | const QMatrix4x4 & | m2
| ) |  | `[inline]`

Definition at line 491 of file qmatrix4x4.h.

    {
        QMatrix4x4 m(1);
        m.m[0][0] = m1.m[0][0] + m2.m[0][0];
        m.m[0][1] = m1.m[0][1] + m2.m[0][1];
        m.m[0][2] = m1.m[0][2] + m2.m[0][2];
        m.m[0][3] = m1.m[0][3] + m2.m[0][3];
        m.m[1][0] = m1.m[1][0] + m2.m[1][0];
        m.m[1][1] = m1.m[1][1] + m2.m[1][1];
        m.m[1][2] = m1.m[1][2] + m2.m[1][2];
        m.m[1][3] = m1.m[1][3] + m2.m[1][3];
        m.m[2][0] = m1.m[2][0] + m2.m[2][0];
        m.m[2][1] = m1.m[2][1] + m2.m[2][1];
        m.m[2][2] = m1.m[2][2] + m2.m[2][2];
        m.m[2][3] = m1.m[2][3] + m2.m[2][3];
        m.m[3][0] = m1.m[3][0] + m2.m[3][0];
        m.m[3][1] = m1.m[3][1] + m2.m[3][1];
        m.m[3][2] = m1.m[3][2] + m2.m[3][2];
        m.m[3][3] = m1.m[3][3] + m2.m[3][3];
        return m;
    }

QMatrix4x4 operator- | ( | const QMatrix4x4 & | m1,
|  | const QMatrix4x4 & | m2
| ) |  | `[inline]`

Definition at line 513 of file qmatrix4x4.h.

    {
        QMatrix4x4 m(1);
        m.m[0][0] = m1.m[0][0] - m2.m[0][0];
        m.m[0][1] = m1.m[0][1] - m2.m[0][1];
        m.m[0][2] = m1.m[0][2] - m2.m[0][2];
        m.m[0][3] = m1.m[0][3] - m2.m[0][3];
        m.m[1][0] = m1.m[1][0] - m2.m[1][0];
        m.m[1][1] = m1.m[1][1] - m2.m[1][1];
        m.m[1][2] = m1.m[1][2] - m2.m[1][2];
        m.m[1][3] = m1.m[1][3] - m2.m[1][3];
        m.m[2][0] = m1.m[2][0] - m2.m[2][0];
        m.m[2][1] = m1.m[2][1] - m2.m[2][1];
        m.m[2][2] = m1.m[2][2] - m2.m[2][2];
        m.m[2][3] = m1.m[2][3] - m2.m[2][3];
        m.m[3][0] = m1.m[3][0] - m2.m[3][0];
        m.m[3][1] = m1.m[3][1] - m2.m[3][1];
        m.m[3][2] = m1.m[3][2] - m2.m[3][2];
        m.m[3][3] = m1.m[3][3] - m2.m[3][3];
        return m;
    }

QMatrix4x4 operator* | ( | const QMatrix4x4 & | m1,
|  | const QMatrix4x4 & | m2
| ) |  | `[inline]`

Definition at line 535 of file qmatrix4x4.h.

    {
        if (m1.flagBits == QMatrix4x4::Identity)
            return m2;
        else if (m2.flagBits == QMatrix4x4::Identity)
            return m1;

        QMatrix4x4 m(1);
        m.m[0][0] = m1.m[0][0] * m2.m[0][0] +
                    m1.m[1][0] * m2.m[0][1] +
                    m1.m[2][0] * m2.m[0][2] +
                    m1.m[3][0] * m2.m[0][3];
        m.m[0][1] = m1.m[0][1] * m2.m[0][0] +
                    m1.m[1][1] * m2.m[0][1] +
                    m1.m[2][1] * m2.m[0][2] +
                    m1.m[3][1] * m2.m[0][3];
        m.m[0][2] = m1.m[0][2] * m2.m[0][0] +
                    m1.m[1][2] * m2.m[0][1] +
                    m1.m[2][2] * m2.m[0][2] +
                    m1.m[3][2] * m2.m[0][3];
        m.m[0][3] = m1.m[0][3] * m2.m[0][0] +
                    m1.m[1][3] * m2.m[0][1] +
                    m1.m[2][3] * m2.m[0][2] +
                    m1.m[3][3] * m2.m[0][3];
        m.m[1][0] = m1.m[0][0] * m2.m[1][0] +
                    m1.m[1][0] * m2.m[1][1] +
                    m1.m[2][0] * m2.m[1][2] +
                    m1.m[3][0] * m2.m[1][3];
        m.m[1][1] = m1.m[0][1] * m2.m[1][0] +
                    m1.m[1][1] * m2.m[1][1] +
                    m1.m[2][1] * m2.m[1][2] +
                    m1.m[3][1] * m2.m[1][3];
        m.m[1][2] = m1.m[0][2] * m2.m[1][0] +
                    m1.m[1][2] * m2.m[1][1] +
                    m1.m[2][2] * m2.m[1][2] +
                    m1.m[3][2] * m2.m[1][3];
        m.m[1][3] = m1.m[0][3] * m2.m[1][0] +
                    m1.m[1][3] * m2.m[1][1] +
                    m1.m[2][3] * m2.m[1][2] +
                    m1.m[3][3] * m2.m[1][3];
        m.m[2][0] = m1.m[0][0] * m2.m[2][0] +
                    m1.m[1][0] * m2.m[2][1] +
                    m1.m[2][0] * m2.m[2][2] +
                    m1.m[3][0] * m2.m[2][3];
        m.m[2][1] = m1.m[0][1] * m2.m[2][0] +
                    m1.m[1][1] * m2.m[2][1] +
                    m1.m[2][1] * m2.m[2][2] +
                    m1.m[3][1] * m2.m[2][3];
        m.m[2][2] = m1.m[0][2] * m2.m[2][0] +
                    m1.m[1][2] * m2.m[2][1] +
                    m1.m[2][2] * m2.m[2][2] +
                    m1.m[3][2] * m2.m[2][3];
        m.m[2][3] = m1.m[0][3] * m2.m[2][0] +
                    m1.m[1][3] * m2.m[2][1] +
                    m1.m[2][3] * m2.m[2][2] +
                    m1.m[3][3] * m2.m[2][3];
        m.m[3][0] = m1.m[0][0] * m2.m[3][0] +
                    m1.m[1][0] * m2.m[3][1] +
                    m1.m[2][0] * m2.m[3][2] +
                    m1.m[3][0] * m2.m[3][3];
        m.m[3][1] = m1.m[0][1] * m2.m[3][0] +
                    m1.m[1][1] * m2.m[3][1] +
                    m1.m[2][1] * m2.m[3][2] +
                    m1.m[3][1] * m2.m[3][3];
        m.m[3][2] = m1.m[0][2] * m2.m[3][0] +
                    m1.m[1][2] * m2.m[3][1] +
                    m1.m[2][2] * m2.m[3][2] +
                    m1.m[3][2] * m2.m[3][3];
        m.m[3][3] = m1.m[0][3] * m2.m[3][0] +
                    m1.m[1][3] * m2.m[3][1] +
                    m1.m[2][3] * m2.m[3][2] +
                    m1.m[3][3] * m2.m[3][3];
        return m;
    }

QVector3D operator* | ( | const QVector3D & | vector,
|  | const QMatrix4x4 & | matrix
| ) |  | `[inline]`

Definition at line 612 of file qmatrix4x4.h.

    {
        qreal x, y, z, w;
        x = vector.x() * matrix.m[0][0] +
            vector.y() * matrix.m[0][1] +
            vector.z() * matrix.m[0][2] +
            matrix.m[0][3];
        y = vector.x() * matrix.m[1][0] +
            vector.y() * matrix.m[1][1] +
            vector.z() * matrix.m[1][2] +
            matrix.m[1][3];
        z = vector.x() * matrix.m[2][0] +
            vector.y() * matrix.m[2][1] +
            vector.z() * matrix.m[2][2] +
            matrix.m[2][3];
        w = vector.x() * matrix.m[3][0] +
            vector.y() * matrix.m[3][1] +
            vector.z() * matrix.m[3][2] +
            matrix.m[3][3];
        if (w == 1.0f)
            return QVector3D(x, y, z);
        else
            return QVector3D(x / w, y / w, z / w);
    }

QVector3D operator* | ( | const QMatrix4x4 & | matrix,
|  | const QVector3D & | vector
| ) |  | `[inline]`

Definition at line 637 of file qmatrix4x4.h.

    {
        qreal x, y, z, w;
        if (matrix.flagBits == QMatrix4x4::Identity) {
            return vector;
        } else if (matrix.flagBits == QMatrix4x4::Translation) {
            return QVector3D(vector.x() + matrix.m[3][0],
                             vector.y() + matrix.m[3][1],
                             vector.z() + matrix.m[3][2]);
        } else if (matrix.flagBits ==
                        (QMatrix4x4::Translation | QMatrix4x4::Scale)) {
            return QVector3D(vector.x() * matrix.m[0][0] + matrix.m[3][0],
                             vector.y() * matrix.m[1][1] + matrix.m[3][1],
                             vector.z() * matrix.m[2][2] + matrix.m[3][2]);
        } else if (matrix.flagBits == QMatrix4x4::Scale) {
            return QVector3D(vector.x() * matrix.m[0][0],
                             vector.y() * matrix.m[1][1],
                             vector.z() * matrix.m[2][2]);
        } else {
            x = vector.x() * matrix.m[0][0] +
                vector.y() * matrix.m[1][0] +
                vector.z() * matrix.m[2][0] +
                matrix.m[3][0];
            y = vector.x() * matrix.m[0][1] +
                vector.y() * matrix.m[1][1] +
                vector.z() * matrix.m[2][1] +
                matrix.m[3][1];
            z = vector.x() * matrix.m[0][2] +
                vector.y() * matrix.m[1][2] +
                vector.z() * matrix.m[2][2] +
                matrix.m[3][2];
            w = vector.x() * matrix.m[0][3] +
                vector.y() * matrix.m[1][3] +
                vector.z() * matrix.m[2][3] +
                matrix.m[3][3];
            if (w == 1.0f)
                return QVector3D(x, y, z);
            else
                return QVector3D(x / w, y / w, z / w);
        }
    }

QVector4D operator* | ( | const QVector4D & | vector,
|  | const QMatrix4x4 & | matrix
| ) |  | `[inline]`

Definition at line 683 of file qmatrix4x4.h.

    {
        qreal x, y, z, w;
        x = vector.x() * matrix.m[0][0] +
            vector.y() * matrix.m[0][1] +
            vector.z() * matrix.m[0][2] +
            vector.w() * matrix.m[0][3];
        y = vector.x() * matrix.m[1][0] +
            vector.y() * matrix.m[1][1] +
            vector.z() * matrix.m[1][2] +
            vector.w() * matrix.m[1][3];
        z = vector.x() * matrix.m[2][0] +
            vector.y() * matrix.m[2][1] +
            vector.z() * matrix.m[2][2] +
            vector.w() * matrix.m[2][3];
        w = vector.x() * matrix.m[3][0] +
            vector.y() * matrix.m[3][1] +
            vector.z() * matrix.m[3][2] +
            vector.w() * matrix.m[3][3];
        return QVector4D(x, y, z, w);
    }

QVector4D operator* | ( | const QMatrix4x4 & | matrix,
|  | const QVector4D & | vector
| ) |  | `[inline]`

Definition at line 705 of file qmatrix4x4.h.

    {
        qreal x, y, z, w;
        x = vector.x() * matrix.m[0][0] +
            vector.y() * matrix.m[1][0] +
            vector.z() * matrix.m[2][0] +
            vector.w() * matrix.m[3][0];
        y = vector.x() * matrix.m[0][1] +
            vector.y() * matrix.m[1][1] +
            vector.z() * matrix.m[2][1] +
            vector.w() * matrix.m[3][1];
        z = vector.x() * matrix.m[0][2] +
            vector.y() * matrix.m[1][2] +
            vector.z() * matrix.m[2][2] +
            vector.w() * matrix.m[3][2];
        w = vector.x() * matrix.m[0][3] +
            vector.y() * matrix.m[1][3] +
            vector.z() * matrix.m[2][3] +
            vector.w() * matrix.m[3][3];
        return QVector4D(x, y, z, w);
    }

QPoint operator* | ( | const QPoint & | point,
|  | const QMatrix4x4 & | matrix
| ) |  | `[inline]`

Definition at line 729 of file qmatrix4x4.h.

    {
        qreal xin, yin;
        qreal x, y, w;
        xin = point.x();
        yin = point.y();
        x = xin * matrix.m[0][0] +
            yin * matrix.m[0][1] +
            matrix.m[0][3];
        y = xin * matrix.m[1][0] +
            yin * matrix.m[1][1] +
            matrix.m[1][3];
        w = xin * matrix.m[3][0] +
            yin * matrix.m[3][1] +
            matrix.m[3][3];
        if (w == 1.0f)
            return QPoint(qRound(x), qRound(y));
        else
            return QPoint(qRound(x / w), qRound(y / w));
    }

QPointF operator* | ( | const QPointF & | point,
|  | const QMatrix4x4 & | matrix
| ) |  | `[inline]`

Definition at line 750 of file qmatrix4x4.h.

    {
        qreal xin, yin;
        qreal x, y, w;
        xin = point.x();
        yin = point.y();
        x = xin * matrix.m[0][0] +
            yin * matrix.m[0][1] +
            matrix.m[0][3];
        y = xin * matrix.m[1][0] +
            yin * matrix.m[1][1] +
            matrix.m[1][3];
        w = xin * matrix.m[3][0] +
            yin * matrix.m[3][1] +
            matrix.m[3][3];
        if (w == 1.0f) {
            return QPointF(qreal(x), qreal(y));
        } else {
            return QPointF(qreal(x / w), qreal(y / w));
        }
    }

QPoint operator* | ( | const QMatrix4x4 & | matrix,
|  | const QPoint & | point
| ) |  | `[inline]`

Definition at line 772 of file qmatrix4x4.h.

    {
        qreal xin, yin;
        qreal x, y, w;
        xin = point.x();
        yin = point.y();
        if (matrix.flagBits == QMatrix4x4::Identity) {
            return point;
        } else if (matrix.flagBits == QMatrix4x4::Translation) {
            return QPoint(qRound(xin + matrix.m[3][0]),
                          qRound(yin + matrix.m[3][1]));
        } else if (matrix.flagBits ==
                        (QMatrix4x4::Translation | QMatrix4x4::Scale)) {
            return QPoint(qRound(xin * matrix.m[0][0] + matrix.m[3][0]),
                          qRound(yin * matrix.m[1][1] + matrix.m[3][1]));
        } else if (matrix.flagBits == QMatrix4x4::Scale) {
            return QPoint(qRound(xin * matrix.m[0][0]),
                          qRound(yin * matrix.m[1][1]));
        } else {
            x = xin * matrix.m[0][0] +
                yin * matrix.m[1][0] +
                matrix.m[3][0];
            y = xin * matrix.m[0][1] +
                yin * matrix.m[1][1] +
                matrix.m[3][1];
            w = xin * matrix.m[0][3] +
                yin * matrix.m[1][3] +
                matrix.m[3][3];
            if (w == 1.0f)
                return QPoint(qRound(x), qRound(y));
            else
                return QPoint(qRound(x / w), qRound(y / w));
        }
    }

QPointF operator* | ( | const QMatrix4x4 & | matrix,
|  | const QPointF & | point
| ) |  | `[inline]`

Definition at line 807 of file qmatrix4x4.h.

    {
        qreal xin, yin;
        qreal x, y, w;
        xin = point.x();
        yin = point.y();
        if (matrix.flagBits == QMatrix4x4::Identity) {
            return point;
        } else if (matrix.flagBits == QMatrix4x4::Translation) {
            return QPointF(xin + matrix.m[3][0],
                           yin + matrix.m[3][1]);
        } else if (matrix.flagBits ==
                        (QMatrix4x4::Translation | QMatrix4x4::Scale)) {
            return QPointF(xin * matrix.m[0][0] + matrix.m[3][0],
                           yin * matrix.m[1][1] + matrix.m[3][1]);
        } else if (matrix.flagBits == QMatrix4x4::Scale) {
            return QPointF(xin * matrix.m[0][0],
                           yin * matrix.m[1][1]);
        } else {
            x = xin * matrix.m[0][0] +
                yin * matrix.m[1][0] +
                matrix.m[3][0];
            y = xin * matrix.m[0][1] +
                yin * matrix.m[1][1] +
                matrix.m[3][1];
            w = xin * matrix.m[0][3] +
                yin * matrix.m[1][3] +
                matrix.m[3][3];
            if (w == 1.0f) {
                return QPointF(qreal(x), qreal(y));
            } else {
                return QPointF(qreal(x / w), qreal(y / w));
            }
        }
    }

QMatrix4x4 operator- | ( | const QMatrix4x4 & | matrix | ) | `[inline]`

Definition at line 843 of file qmatrix4x4.h.

    {
        QMatrix4x4 m(1);
        m.m[0][0] = -matrix.m[0][0];
        m.m[0][1] = -matrix.m[0][1];
        m.m[0][2] = -matrix.m[0][2];
        m.m[0][3] = -matrix.m[0][3];
        m.m[1][0] = -matrix.m[1][0];
        m.m[1][1] = -matrix.m[1][1];
        m.m[1][2] = -matrix.m[1][2];
        m.m[1][3] = -matrix.m[1][3];
        m.m[2][0] = -matrix.m[2][0];
        m.m[2][1] = -matrix.m[2][1];
        m.m[2][2] = -matrix.m[2][2];
        m.m[2][3] = -matrix.m[2][3];
        m.m[3][0] = -matrix.m[3][0];
        m.m[3][1] = -matrix.m[3][1];
        m.m[3][2] = -matrix.m[3][2];
        m.m[3][3] = -matrix.m[3][3];
        return m;
    }

QMatrix4x4 operator* | ( | qreal | factor,
|  | const QMatrix4x4 & | matrix
| ) |  | `[inline]`

Definition at line 865 of file qmatrix4x4.h.

    {
        QMatrix4x4 m(1);
        m.m[0][0] = matrix.m[0][0] * factor;
        m.m[0][1] = matrix.m[0][1] * factor;
        m.m[0][2] = matrix.m[0][2] * factor;
        m.m[0][3] = matrix.m[0][3] * factor;
        m.m[1][0] = matrix.m[1][0] * factor;
        m.m[1][1] = matrix.m[1][1] * factor;
        m.m[1][2] = matrix.m[1][2] * factor;
        m.m[1][3] = matrix.m[1][3] * factor;
        m.m[2][0] = matrix.m[2][0] * factor;
        m.m[2][1] = matrix.m[2][1] * factor;
        m.m[2][2] = matrix.m[2][2] * factor;
        m.m[2][3] = matrix.m[2][3] * factor;
        m.m[3][0] = matrix.m[3][0] * factor;
        m.m[3][1] = matrix.m[3][1] * factor;
        m.m[3][2] = matrix.m[3][2] * factor;
        m.m[3][3] = matrix.m[3][3] * factor;
        return m;
    }

QMatrix4x4 operator* | ( | const QMatrix4x4 & | matrix,
|  | qreal | factor
| ) |  | `[inline]`

Definition at line 887 of file qmatrix4x4.h.

    {
        QMatrix4x4 m(1);
        m.m[0][0] = matrix.m[0][0] * factor;
        m.m[0][1] = matrix.m[0][1] * factor;
        m.m[0][2] = matrix.m[0][2] * factor;
        m.m[0][3] = matrix.m[0][3] * factor;
        m.m[1][0] = matrix.m[1][0] * factor;
        m.m[1][1] = matrix.m[1][1] * factor;
        m.m[1][2] = matrix.m[1][2] * factor;
        m.m[1][3] = matrix.m[1][3] * factor;
        m.m[2][0] = matrix.m[2][0] * factor;
        m.m[2][1] = matrix.m[2][1] * factor;
        m.m[2][2] = matrix.m[2][2] * factor;
        m.m[2][3] = matrix.m[2][3] * factor;
        m.m[3][0] = matrix.m[3][0] * factor;
        m.m[3][1] = matrix.m[3][1] * factor;
        m.m[3][2] = matrix.m[3][2] * factor;
        m.m[3][3] = matrix.m[3][3] * factor;
        return m;
    }

bool qFuzzyCompare | ( | const QMatrix4x4 & | m1,
|  | const QMatrix4x4 & | m2
| ) |  | `[inline]`

Search for all occurrences

Definition at line 909 of file qmatrix4x4.h.

    {
        return qFuzzyCompare(m1.m[0][0], m2.m[0][0]) &&
               qFuzzyCompare(m1.m[0][1], m2.m[0][1]) &&
               qFuzzyCompare(m1.m[0][2], m2.m[0][2]) &&
               qFuzzyCompare(m1.m[0][3], m2.m[0][3]) &&
               qFuzzyCompare(m1.m[1][0], m2.m[1][0]) &&
               qFuzzyCompare(m1.m[1][1], m2.m[1][1]) &&
               qFuzzyCompare(m1.m[1][2], m2.m[1][2]) &&
               qFuzzyCompare(m1.m[1][3], m2.m[1][3]) &&
               qFuzzyCompare(m1.m[2][0], m2.m[2][0]) &&
               qFuzzyCompare(m1.m[2][1], m2.m[2][1]) &&
               qFuzzyCompare(m1.m[2][2], m2.m[2][2]) &&
               qFuzzyCompare(m1.m[2][3], m2.m[2][3]) &&
               qFuzzyCompare(m1.m[3][0], m2.m[3][0]) &&
               qFuzzyCompare(m1.m[3][1], m2.m[3][1]) &&
               qFuzzyCompare(m1.m[3][2], m2.m[3][2]) &&
               qFuzzyCompare(m1.m[3][3], m2.m[3][3]);
    }

Q_GUI_EXPORT QDebug operator<< | ( | QDebug | dbg,
|  | const QMatrix4x4 & | m
| ) |  |

Q_GUI_EXPORT QDataStream& operator<< | ( | QDataStream & | ,
|  | const QMatrix4x4 & |
| ) |  |

Q_GUI_EXPORT QDataStream& operator>> | ( | QDataStream & | ,
|  | QMatrix4x4 & |
| ) |  |

QMatrix4x4 qGenericMatrixToMatrix4x4 | ( | const QGenericMatrix< N, M, qreal > & | matrix | ) |

Search for all occurrences

Definition at line 996 of file qmatrix4x4.h.

    {
        return QMatrix4x4(matrix.constData(), N, M);
    }

QGenericMatrix<N, M, qreal> qGenericMatrixFromMatrix4x4 | ( | const QMatrix4x4 & | matrix | ) |

Search for all occurrences

Definition at line 1002 of file qmatrix4x4.h.

    {
        QGenericMatrix<N, M, qreal> result;
        const qreal *m = matrix.constData();
        qreal *values = result.data();
        for (int col = 0; col < N; ++col) {
            for (int row = 0; row < M; ++row) {
                if (col < 4 && row < 4)
                    values[col * M + row] = m[col * 4 + row];
                else if (col == row)
                    values[col * M + row] = 1.0f;
                else
                    values[col * M + row] = 0.0f;
            }
        }
        return result;
    }