Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QMatrix4x4 Class Reference

The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space. More...

#include <qmatrix4x4.h>

+ Collaboration diagram for QMatrix4x4:

Public Types

enum  Flag {
  Identity = 0x0000 , Translation = 0x0001 , Scale = 0x0002 , Rotation2D = 0x0004 ,
  Rotation = 0x0008 , Perspective = 0x0010 , General = 0x001f
}
 

Public Member Functions

 QMatrix4x4 ()
 Constructs an identity matrix.
 
 QMatrix4x4 (Qt::Initialization)
 
 QMatrix4x4 (const float *values)
 Constructs a matrix from the given 16 floating-point values.
 
 QMatrix4x4 (float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)
 Constructs a matrix from the 16 elements m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, and m44.
 
template<int N, int M>
 QMatrix4x4 (const QGenericMatrix< N, M, float > &matrix)
 Constructs a 4x4 matrix from the left-most 4 columns and top-most 4 rows of matrix.
 
 QMatrix4x4 (const float *values, int cols, int rows)
 
 QMatrix4x4 (const QTransform &transform)
 Constructs a 4x4 matrix from the conventional Qt 2D transformation matrix transform.
 
const float & operator() (int row, int column) const
 Returns a constant reference to the element at position (row, column) in this matrix.
 
float & operator() (int row, int column)
 Returns a reference to the element at position (row, column) in this matrix so that the element can be assigned to.
 
QVector4D column (int index) const
 Returns the elements of column index as a 4D vector.
 
void setColumn (int index, const QVector4D &value)
 Sets the elements of column index to the components of value.
 
QVector4D row (int index) const
 Returns the elements of row index as a 4D vector.
 
void setRow (int index, const QVector4D &value)
 Sets the elements of row index to the components of value.
 
bool isAffine () const
 
bool isIdentity () const
 Returns true if this matrix is the identity; false otherwise.
 
void setToIdentity ()
 Sets this matrix to the identity.
 
void fill (float value)
 Fills all elements of this matrx with value.
 
double determinant () const
 Returns the determinant of this matrix.
 
QMatrix4x4 inverted (bool *invertible=nullptr) const
 Returns the inverse of this matrix.
 
QMatrix4x4 transposed () const
 Returns this matrix, transposed about its diagonal.
 
QMatrix3x3 normalMatrix () const
 Returns the normal matrix corresponding to this 4x4 transformation.
 
QMatrix4x4operator+= (const QMatrix4x4 &other)
 Adds the contents of other to this matrix.
 
QMatrix4x4operator-= (const QMatrix4x4 &other)
 Subtracts the contents of other from this matrix.
 
QMatrix4x4operator*= (const QMatrix4x4 &other)
 Multiplies the contents of other by this matrix.
 
QMatrix4x4operator*= (float factor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies all elements of this matrix by factor.
 
QMatrix4x4operator/= (float divisor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides all elements of this matrix by divisor.
 
bool operator== (const QMatrix4x4 &other) const
 Returns true if this matrix is identical to other; false otherwise.
 
bool operator!= (const QMatrix4x4 &other) const
 Returns true if this matrix is not identical to other; false otherwise.
 
void scale (const QVector3D &vector)
 Multiplies this matrix by another that scales coordinates by the components of vector.
 
void translate (const QVector3D &vector)
 Multiplies this matrix by another that translates coordinates by the components of vector.
 
void rotate (float angle, const QVector3D &vector)
 Multiples this matrix by another that rotates coordinates through angle degrees about vector.
 
void scale (float x, float y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that scales coordinates by the components x, and y.
 
void scale (float x, float y, float z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that scales coordinates by the components x, y, and z.
 
void scale (float factor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that scales coordinates by the given factor.
 
void translate (float x, float y)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that translates coordinates by the components x, and y.
 
void translate (float x, float y, float z)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that translates coordinates by the components x, y, and z.
 
void rotate (float angle, float x, float y, float z=0.0f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that rotates coordinates through angle degrees about the vector (x, y, z).
 
void rotate (const QQuaternion &quaternion)
 Multiples this matrix by another that rotates coordinates according to a specified quaternion.
 
void ortho (const QRect &rect)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect.
 
void ortho (const QRectF &rect)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect.
 
void ortho (float left, float right, float bottom, float top, float nearPlane, float farPlane)
 Multiplies this matrix by another that applies an orthographic projection for a window with lower-left corner (left, bottom), upper-right corner (right, top), and the specified nearPlane and farPlane clipping planes.
 
void frustum (float left, float right, float bottom, float top, float nearPlane, float farPlane)
 Multiplies this matrix by another that applies a perspective frustum projection for a window with lower-left corner (left, bottom), upper-right corner (right, top), and the specified nearPlane and farPlane clipping planes.
 
void perspective (float verticalAngle, float aspectRatio, float nearPlane, float farPlane)
 Multiplies this matrix by another that applies a perspective projection.
 
void lookAt (const QVector3D &eye, const QVector3D &center, const QVector3D &up)
 Multiplies this matrix by a viewing matrix derived from an eye point.
 
void viewport (const QRectF &rect)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets up viewport transform for viewport bounded by rect and with near and far set to 0 and 1 respectively.
 
void viewport (float left, float bottom, float width, float height, float nearPlane=0.0f, float farPlane=1.0f)
 Multiplies this matrix by another that performs the scale and bias transformation used by OpenGL to transform from normalized device coordinates (NDC) to viewport (window) coordinates.
 
void flipCoordinates ()
 
void copyDataTo (float *values) const
 Retrieves the 16 items in this matrix and copies them to values in row-major order.
 
QTransform toTransform () const
 Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
 
QTransform toTransform (float distanceToPlane) const
 Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
 
QPoint map (const QPoint &point) const
 Maps point by multiplying this matrix by point.
 
QPointF map (const QPointF &point) const
 Maps point by post-multiplying this matrix by point.
 
QVector3D map (const QVector3D &point) const
 Maps point by multiplying this matrix by point extended to a 4D vector by assuming 1.0 for the w coordinate.
 
QVector3D mapVector (const QVector3D &vector) const
 Maps vector by multiplying the top 3x3 portion of this matrix by vector.
 
QVector4D map (const QVector4D &point) const
 Maps point by multiplying this matrix by point.
 
QRect mapRect (const QRect &rect) const
 Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results.
 
QRectF mapRect (const QRectF &rect) const
 Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results.
 
template<int N, int M>
QGenericMatrix< N, M, float > toGenericMatrix () const
 Constructs a NxM generic matrix from the left-most N columns and top-most M rows of this 4x4 matrix.
 
float * data ()
 Returns a pointer to the raw data of this matrix.
 
const float * data () const
 Returns a constant pointer to the raw data of this matrix.
 
const float * constData () const
 Returns a constant pointer to the raw data of this matrix.
 
void optimize ()
 Optimize the usage of this matrix from its current elements.
 
 operator QVariant () const
 Returns the matrix as a QVariant.
 
void projectedRotate (float angle, float x, float y, float z, float distanceToPlane=1024.0)
 
Flags flags () const
 
template<int N, int M>
Q_INLINE_TEMPLATE QMatrix4x4 (const QGenericMatrix< N, M, float > &matrix)
 

Friends

class ::tst_QMatrixNxN
 
QMatrix4x4 operator+ (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns the sum of m1 and m2.
 
QMatrix4x4 operator- (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns the difference of m1 and m2.
 
QMatrix4x4 operator* (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns the product of m1 and m2.
 
QVector4D operator* (const QVector4D &vector, const QMatrix4x4 &matrix)
 Returns the result of transforming vector according to matrix, with the matrix applied post-vector.
 
QVector4D operator* (const QMatrix4x4 &matrix, const QVector4D &vector)
 Returns the result of transforming vector according to matrix, with the matrix applied pre-vector.
 
QPoint operator* (const QPoint &point, const QMatrix4x4 &matrix)
 Returns the result of transforming point according to matrix, with the matrix applied post-point.
 
QPointF operator* (const QPointF &point, const QMatrix4x4 &matrix)
 Returns the result of transforming point according to matrix, with the matrix applied post-point.
 
QMatrix4x4 operator- (const QMatrix4x4 &matrix)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QMatrix4x4 operator* (float factor, const QMatrix4x4 &matrix)
 Returns the result of multiplying all elements of matrix by factor.
 
QMatrix4x4 operator* (const QMatrix4x4 &matrix, float factor)
 Returns the result of multiplying all elements of matrix by factor.
 
Q_GUI_EXPORT QMatrix4x4 operator/ (const QMatrix4x4 &matrix, float divisor)
 Returns the result of dividing all elements of matrix by divisor.
 
Q_GUI_EXPORT bool qFuzzyCompare (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns true if m1 and m2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.
 
Q_GUI_EXPORT QDebug operator<< (QDebug dbg, const QMatrix4x4 &m)
 

Related Symbols

(Note that these are not member symbols.)

QMatrix4x4 operator+ (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns the sum of m1 and m2.
 
QMatrix4x4 operator- (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns the difference of m1 and m2.
 
QMatrix4x4 operator* (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns the product of m1 and m2.
 
QVector4D operator* (const QVector4D &vector, const QMatrix4x4 &matrix)
 Returns the result of transforming vector according to matrix, with the matrix applied post-vector.
 
QVector4D operator* (const QMatrix4x4 &matrix, const QVector4D &vector)
 Returns the result of transforming vector according to matrix, with the matrix applied pre-vector.
 
QPoint operator* (const QPoint &point, const QMatrix4x4 &matrix)
 Returns the result of transforming point according to matrix, with the matrix applied post-point.
 
QPointF operator* (const QPointF &point, const QMatrix4x4 &matrix)
 Returns the result of transforming point according to matrix, with the matrix applied post-point.
 
QMatrix4x4 operator- (const QMatrix4x4 &matrix)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QMatrix4x4 operator* (float factor, const QMatrix4x4 &matrix)
 Returns the result of multiplying all elements of matrix by factor.
 
QMatrix4x4 operator* (const QMatrix4x4 &matrix, float factor)
 Returns the result of multiplying all elements of matrix by factor.
 
QMatrix4x4 operator/ (const QMatrix4x4 &matrix, float divisor)
 Returns the result of dividing all elements of matrix by divisor.
 
bool qFuzzyCompare (const QMatrix4x4 &m1, const QMatrix4x4 &m2)
 Returns true if m1 and m2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.
 
QDataStreamoperator<< (QDataStream &stream, const QMatrix4x4 &matrix)
 Writes the given matrix to the given stream and returns a reference to the stream.
 
QDataStreamoperator>> (QDataStream &stream, QMatrix4x4 &matrix)
 Reads a 4x4 matrix from the given stream into the given matrix and returns a reference to the stream.
 

Detailed Description

The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.

Since
4.6

\inmodule QtGui

The QMatrix4x4 class in general is treated as a row-major matrix, in that the constructors and operator() functions take data in row-major format, as is familiar in C-style usage.

Internally the data is stored as column-major format, so as to be optimal for passing to OpenGL functions, which expect column-major data.

When using these functions be aware that they return data in {column-major} format: \list

See also
QVector3D, QGenericMatrix

Definition at line 24 of file qmatrix4x4.h.

Member Enumeration Documentation

◆ Flag

Enumerator
Identity 
Translation 
Scale 
Rotation2D 
Rotation 
Perspective 
General 

Definition at line 167 of file qmatrix4x4.h.

Constructor & Destructor Documentation

◆ QMatrix4x4() [1/8]

QMatrix4x4::QMatrix4x4 ( )
inline

Constructs an identity matrix.

Definition at line 27 of file qmatrix4x4.h.

Referenced by inverted().

+ Here is the caller graph for this function:

◆ QMatrix4x4() [2/8]

QMatrix4x4::QMatrix4x4 ( Qt::Initialization )
inlineexplicit
Since
5.5

Constructs a matrix without initializing the contents.

Definition at line 28 of file qmatrix4x4.h.

◆ QMatrix4x4() [3/8]

QMatrix4x4::QMatrix4x4 ( const float * values)
explicit

Constructs a matrix from the given 16 floating-point values.

The contents of the array values is assumed to be in row-major order.

If the matrix has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to optimize() if they wish QMatrix4x4 to optimize further calls to translate(), scale(), etc.

See also
copyDataTo(), optimize()

Definition at line 67 of file qmatrix4x4.cpp.

References General.

◆ QMatrix4x4() [4/8]

QMatrix4x4::QMatrix4x4 ( float m11,
float m12,
float m13,
float m14,
float m21,
float m22,
float m23,
float m24,
float m31,
float m32,
float m33,
float m34,
float m41,
float m42,
float m43,
float m44 )
inline

Constructs a matrix from the 16 elements m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, and m44.

The elements are specified in row-major order.

If the matrix has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to optimize() if they wish QMatrix4x4 to optimize further calls to translate(), scale(), etc.

See also
optimize()

Definition at line 196 of file qmatrix4x4.h.

References General.

◆ QMatrix4x4() [5/8]

template<int N, int M>
template< int N, int M > QMatrix4x4::QMatrix4x4 ( const QGenericMatrix< N, M, float > & matrix)
explicit

Constructs a 4x4 matrix from the left-most 4 columns and top-most 4 rows of matrix.

If matrix has less than 4 columns or rows, the remaining elements are filled with elements from the identity matrix.

See also
toGenericMatrix()

◆ QMatrix4x4() [6/8]

QMatrix4x4::QMatrix4x4 ( const float * values,
int cols,
int rows )

Definition at line 114 of file qmatrix4x4.cpp.

References General.

◆ QMatrix4x4() [7/8]

QMatrix4x4::QMatrix4x4 ( const QTransform & transform)

Constructs a 4x4 matrix from the conventional Qt 2D transformation matrix transform.

If transform has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to optimize() if they wish QMatrix4x4 to optimize further calls to translate(), scale(), etc.

See also
toTransform(), optimize()

Definition at line 140 of file qmatrix4x4.cpp.

◆ QMatrix4x4() [8/8]

template<int N, int M>
Q_INLINE_TEMPLATE QMatrix4x4::QMatrix4x4 ( const QGenericMatrix< N, M, float > & matrix)

Definition at line 210 of file qmatrix4x4.h.

References General, and M.

Member Function Documentation

◆ column()

QVector4D QMatrix4x4::column ( int index) const
inline

Returns the elements of column index as a 4D vector.

See also
setColumn(), row()

Definition at line 259 of file qmatrix4x4.h.

References Q_ASSERT.

Referenced by QSSGRenderCamera::calculateViewProjectionMatrix(), QSSGRenderCamera::calculateViewProjectionMatrix(), and QSSGRenderCamera::calculateViewProjectionWithoutTranslation().

+ Here is the caller graph for this function:

◆ constData()

const float * QMatrix4x4::constData ( ) const
inline

Returns a constant pointer to the raw data of this matrix.

This raw data is stored in column-major format.

See also
data()

Definition at line 147 of file qmatrix4x4.h.

Referenced by collectBoneTransforms(), getViewportHalfExtents(), getZNear(), DebugDrawPass::renderPrep(), rhiPrepareSkyBox_helper(), QQuick3DSkin::setInverseBindPoses(), QSSGMaterialShaderGenerator::setRhiMaterialProperties(), QSSGParticleRenderer::updateUniformsForParticles(), and QSGOpenVGNodeVisitor::visit().

+ Here is the caller graph for this function:

◆ copyDataTo()

void QMatrix4x4::copyDataTo ( float * values) const

Retrieves the 16 items in this matrix and copies them to values in row-major order.

Definition at line 1633 of file qmatrix4x4.cpp.

◆ data() [1/2]

float * QMatrix4x4::data ( )
inline

Returns a pointer to the raw data of this matrix.

See also
constData(), optimize()

Definition at line 1050 of file qmatrix4x4.h.

References General.

Referenced by QSSGRenderNode::calculateGlobalVariables(), QSSGRenderCamera::calculateProjection(), QBackingStoreDefaultCompositor::flush(), QSSGRenderNode::getDirection(), and RenderHelpers::rhiRenderShadowMap().

+ Here is the caller graph for this function:

◆ data() [2/2]

const float * QMatrix4x4::data ( ) const
inline

Returns a constant pointer to the raw data of this matrix.

This raw data is stored in column-major format.

See also
constData()

Definition at line 146 of file qmatrix4x4.h.

◆ determinant()

double QMatrix4x4::determinant ( ) const

Returns the determinant of this matrix.

Definition at line 290 of file qmatrix4x4.cpp.

References copyToDoubles(), Identity, matrixDet3(), matrixDet4(), Perspective, Rotation, Rotation2D, and Translation.

+ Here is the call graph for this function:

◆ fill()

void QMatrix4x4::fill ( float value)
inline

Fills all elements of this matrx with value.

Definition at line 337 of file qmatrix4x4.h.

References General.

◆ flags()

int QMatrix4x4::flags ( ) const
inline

Definition at line 178 of file qmatrix4x4.h.

◆ flipCoordinates()

void QMatrix4x4::flipCoordinates ( )
Deprecated

Flips between right-handed and left-handed coordinate systems by multiplying the y and z coordinates by -1. This is normally used to create a left-handed orthographic view without scaling the viewport as ortho() does.

See also
ortho()

Definition at line 1607 of file qmatrix4x4.cpp.

References Rotation2D, and Scale.

◆ frustum()

void QMatrix4x4::frustum ( float left,
float right,
float bottom,
float top,
float nearPlane,
float farPlane )

Multiplies this matrix by another that applies a perspective frustum projection for a window with lower-left corner (left, bottom), upper-right corner (right, top), and the specified nearPlane and farPlane clipping planes.

See also
ortho(), perspective()

Definition at line 1426 of file qmatrix4x4.cpp.

References General, and Qt::Uninitialized.

Referenced by QSSGRenderCamera::computeCustomFrustum(), and QGeoTiledMapScenePrivate::setupCamera().

+ Here is the caller graph for this function:

◆ inverted()

QMatrix4x4 QMatrix4x4::inverted ( bool * invertible = nullptr) const

Returns the inverse of this matrix.

Returns the identity if this matrix cannot be inverted; i.e. determinant() is zero. If invertible is not null, then true will be written to that location if the matrix can be inverted; false otherwise.

If the matrix is recognized as the identity or an orthonormal matrix, then this function will quickly invert the matrix using optimized routines.

See also
determinant(), normalMatrix()

Definition at line 316 of file qmatrix4x4.cpp.

References QMatrix4x4(), copyToDoubles(), Identity, matrixDet2(), matrixDet3(), matrixDet4(), Perspective, Rotation, Rotation2D, Translation, and Qt::Uninitialized.

Referenced by calculateParticleTransform(), QSSGRenderCamera::calculateViewProjectionMatrix(), QSSGRenderCamera::calculateViewProjectionMatrix(), computeFrustumBounds(), QSSGRenderRay::createRayData(), QQuick3DParticleEmitter::emitActivationNodeParticles(), QSSGRendererPrivate::intersectRayWithItem2D(), QQuickMatrix4x4ValueType::inverted(), QQuick3DCamera::mapFromViewport(), QQuick3DCamera::mapToViewport(), QSSGLayerRenderData::prepareInstancing(), QSSGRenderRay::relative(), RenderHelpers::rhiPrepareGrid(), QSSGMaterialShaderGenerator::setRhiMaterialProperties(), sortParticles(), QVector3D::unproject(), QQuick3DParticleModelBlendParticle::updateSpatialNode(), and QSGHiQSubPixelDistanceFieldTextMaterialRhiShader::updateUniformData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAffine()

bool QMatrix4x4::isAffine ( ) const
inline
Since
5.5

Returns true if this matrix is affine matrix; false otherwise.

An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1), e.g. no projective coefficients.

See also
isIdentity()

Definition at line 294 of file qmatrix4x4.h.

◆ isIdentity()

bool QMatrix4x4::isIdentity ( ) const
inline

Returns true if this matrix is the identity; false otherwise.

See also
setToIdentity()

Definition at line 299 of file qmatrix4x4.h.

References Identity.

Referenced by QSSGRenderImage::isImageTransformIdentity().

+ Here is the caller graph for this function:

◆ lookAt()

void QMatrix4x4::lookAt ( const QVector3D & eye,
const QVector3D & center,
const QVector3D & up )

Multiplies this matrix by a viewing matrix derived from an eye point.

The center value indicates the center of the view that the eye is looking at. The up value indicates which direction should be considered up with respect to the eye.

Note
The up vector must not be parallel to the line of sight from eye to center.

Definition at line 1516 of file qmatrix4x4.cpp.

References QVector3D::crossProduct(), QVector3D::normalize(), qFuzzyIsNull(), Rotation, translate(), Qt::Uninitialized, QVector3D::x(), QVector3D::y(), and QVector3D::z().

Referenced by QSSGReflectionMapEntry::renderMips(), renderToKTXFileInternal(), and QGeoTiledMapRootNode::updateTiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map() [1/4]

QPoint QMatrix4x4::map ( const QPoint & point) const
inline

Maps point by multiplying this matrix by point.

The matrix is applied pre-point.

See also
mapRect()

Definition at line 908 of file qmatrix4x4.h.

References Identity, Perspective, qRound(), Rotation2D, QPoint::x(), and QPoint::y().

Referenced by QQuick3DParticleAttractor::affectParticle(), QQuick3DParticleModelBlendParticle::particleEndPosition(), and QQuickMatrix4x4ValueType::times().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map() [2/4]

QPointF QMatrix4x4::map ( const QPointF & point) const
inline

Maps point by post-multiplying this matrix by point.

The matrix is applied pre-point.

See also
mapRect()

Definition at line 940 of file qmatrix4x4.h.

References Identity, Perspective, Rotation2D, QPointF::x(), and QPointF::y().

+ Here is the call graph for this function:

◆ map() [3/4]

QVector3D QMatrix4x4::map ( const QVector3D & point) const
inline

Maps point by multiplying this matrix by point extended to a 4D vector by assuming 1.0 for the w coordinate.

The matrix is applied pre-point.

Note
This function is not the same as mapVector(). For points, always use map(). mapVector() is suitable for vectors (directions) only.
See also
mapRect(), mapVector()

Definition at line 977 of file qmatrix4x4.h.

References Identity, Rotation, Rotation2D, QVector3D::x(), QVector3D::y(), and QVector3D::z().

+ Here is the call graph for this function:

◆ map() [4/4]

QVector4D QMatrix4x4::map ( const QVector4D & point) const
inline

Maps point by multiplying this matrix by point.

The matrix is applied pre-point.

See also
mapRect()

Definition at line 1043 of file qmatrix4x4.h.

◆ mapRect() [1/2]

QRect QMatrix4x4::mapRect ( const QRect & rect) const

Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results.

The returned rectangle will be an ordinary 2D rectangle with sides parallel to the horizontal and vertical axes.

See also
map()

Definition at line 1764 of file qmatrix4x4.cpp.

References map, qMax(), qMin(), qRound(), rect, Rotation2D, Scale, tr, QPoint::x(), and QPoint::y().

Referenced by QQuick3DSGRenderNode::prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapRect() [2/2]

QRectF QMatrix4x4::mapRect ( const QRectF & rect) const

Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results.

The returned rectangle will be an ordinary 2D rectangle with sides parallel to the horizontal and vertical axes.

See also
map()

Definition at line 1810 of file qmatrix4x4.cpp.

References map, qMax(), qMin(), rect, Rotation2D, Scale, tr, QRect::translated(), QPointF::x(), and QPointF::y().

+ Here is the call graph for this function:

◆ mapVector()

QVector3D QMatrix4x4::mapVector ( const QVector3D & vector) const
inline

Maps vector by multiplying the top 3x3 portion of this matrix by vector.

The translation and projection components of this matrix are ignored. The matrix is applied pre-vector.

See also
map()

Definition at line 1016 of file qmatrix4x4.h.

References Rotation2D, Scale, and vector.

◆ normalMatrix()

QMatrix3x3 QMatrix4x4::normalMatrix ( ) const

Returns the normal matrix corresponding to this 4x4 transformation.

The normal matrix is the transpose of the inverse of the top-left 3x3 part of this 4x4 matrix. If the 3x3 sub-matrix is not invertible, this function returns the identity.

See also
inverted()

Definition at line 436 of file qmatrix4x4.cpp.

References copyToDoubles(), QGenericMatrix< N, M, T >::data(), Identity, matrixDet3(), Rotation, Rotation2D, Scale, and Translation.

Referenced by QSSGRenderNode::calculateMVPAndNormalMatrix(), QSSGRenderNode::calculateNormalMatrix(), QQuick3DNodePrivate::emitChangesToSceneTransform(), QSSGRenderNode::getScalingCorrectDirection(), and QQuick3DNode::mapDirectionToScene().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator QVariant()

QMatrix4x4::operator QVariant ( ) const

Returns the matrix as a QVariant.

Definition at line 1976 of file qmatrix4x4.cpp.

References QVariant::fromValue().

+ Here is the call graph for this function:

◆ operator!=()

bool QMatrix4x4::operator!= ( const QMatrix4x4 & other) const
inline

Returns true if this matrix is not identical to other; false otherwise.

This operator uses an exact floating-point comparison.

Definition at line 543 of file qmatrix4x4.h.

References other().

+ Here is the call graph for this function:

◆ operator()() [1/2]

float & QMatrix4x4::operator() ( int row,
int column )
inline

Returns a reference to the element at position (row, column) in this matrix so that the element can be assigned to.

See also
optimize(), setColumn(), setRow()

Definition at line 251 of file qmatrix4x4.h.

References General, and Q_ASSERT.

◆ operator()() [2/2]

const float & QMatrix4x4::operator() ( int row,
int column ) const
inline

Returns a constant reference to the element at position (row, column) in this matrix.

See also
column(), row()

Definition at line 245 of file qmatrix4x4.h.

References Q_ASSERT.

◆ operator*=() [1/2]

QMatrix4x4 & QMatrix4x4::operator*= ( const QMatrix4x4 & other)
inline

Multiplies the contents of other by this matrix.

Definition at line 402 of file qmatrix4x4.h.

References o, other(), and Rotation2D.

+ Here is the call graph for this function:

◆ operator*=() [2/2]

QMatrix4x4 & QMatrix4x4::operator*= ( float factor)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies all elements of this matrix by factor.

Definition at line 501 of file qmatrix4x4.h.

References General.

◆ operator+=()

QMatrix4x4 & QMatrix4x4::operator+= ( const QMatrix4x4 & other)
inline

Adds the contents of other to this matrix.

Definition at line 358 of file qmatrix4x4.h.

References General, and other().

+ Here is the call graph for this function:

◆ operator-=()

QMatrix4x4 & QMatrix4x4::operator-= ( const QMatrix4x4 & other)
inline

Subtracts the contents of other from this matrix.

Definition at line 380 of file qmatrix4x4.h.

References General, and other().

+ Here is the call graph for this function:

◆ operator/=()

QMatrix4x4 & QMatrix4x4::operator/= ( float divisor)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Divides all elements of this matrix by divisor.

Definition at line 535 of file qmatrix4x4.cpp.

References General.

◆ operator==()

bool QMatrix4x4::operator== ( const QMatrix4x4 & other) const
inline

Returns true if this matrix is identical to other; false otherwise.

This operator uses an exact floating-point comparison.

Definition at line 523 of file qmatrix4x4.h.

References other().

+ Here is the call graph for this function:

◆ optimize()

void QMatrix4x4::optimize ( )

Optimize the usage of this matrix from its current elements.

Some operations such as translate(), scale(), and rotate() can be performed more efficiently if the matrix being modified is already known to be the identity, a previous translate(), a previous scale(), etc.

Normally the QMatrix4x4 class keeps track of this special type internally as operations are performed. However, if the matrix is modified directly with operator()(int, int) or data(), then QMatrix4x4 will lose track of the special type and will revert to the safest but least efficient operations thereafter.

By calling optimize() after directly modifying the matrix, the programmer can force QMatrix4x4 to recover the special type if the elements appear to conform to one of the known optimized types.

See also
operator()(int, int), data(), translate()

Definition at line 1921 of file qmatrix4x4.cpp.

References copyToDoubles(), General, matrixDet2(), matrixDet3(), and qFuzzyCompare.

+ Here is the call graph for this function:

◆ ortho() [1/3]

void QMatrix4x4::ortho ( const QRect & rect)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect.

The near and far clipping planes will be -1 and 1 respectively.

See also
frustum(), perspective()

Definition at line 1354 of file qmatrix4x4.cpp.

References ortho(), and rect.

Referenced by QSSGRenderCamera::computeFrustumOrtho(), ortho(), ortho(), QSGAbstractRenderer::setProjectionMatrixToRect(), and src_gui_qopenglshaderprogram::wrapper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ortho() [2/3]

void QMatrix4x4::ortho ( const QRectF & rect)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect.

The near and far clipping planes will be -1 and 1 respectively.

See also
frustum(), perspective()

Definition at line 1372 of file qmatrix4x4.cpp.

References ortho(), and rect.

+ Here is the call graph for this function:

◆ ortho() [3/3]

void QMatrix4x4::ortho ( float left,
float right,
float bottom,
float top,
float nearPlane,
float farPlane )

Multiplies this matrix by another that applies an orthographic projection for a window with lower-left corner (left, bottom), upper-right corner (right, top), and the specified nearPlane and farPlane clipping planes.

See also
frustum(), perspective()

Definition at line 1385 of file qmatrix4x4.cpp.

References Scale, Translation, and Qt::Uninitialized.

◆ perspective()

void QMatrix4x4::perspective ( float verticalAngle,
float aspectRatio,
float nearPlane,
float farPlane )

Multiplies this matrix by another that applies a perspective projection.

The vertical field of view will be verticalAngle degrees within a window with a given aspectRatio that determines the horizontal field of view. The projection will have the specified nearPlane and farPlane clipping planes which are the distances from the viewer to the corresponding planes.

See also
ortho(), frustum()

Definition at line 1469 of file qmatrix4x4.cpp.

References General, qDegreesToRadians(), and Qt::Uninitialized.

Referenced by QSSGRenderCamera::computeFrustumPerspective(), ExampleRhiWidget::initialize(), ExampleRhiItemRenderer::initialize(), main(), and QSSGReflectionMapEntry::renderMips().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ projectedRotate()

void QMatrix4x4::projectedRotate ( float angle,
float x,
float y,
float z,
float distanceToPlane = 1024.0 )

Definition at line 1167 of file qmatrix4x4.cpp.

References d, General, qDegreesToRadians(), qFuzzyCompare, qFuzzyIsNull(), qIsNull(), rotate(), Rotation2D, and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ rotate() [1/3]

void QMatrix4x4::rotate ( const QQuaternion & quaternion)

Multiples this matrix by another that rotates coordinates according to a specified quaternion.

The quaternion is assumed to have been normalized.

See also
scale(), translate(), QQuaternion

Definition at line 1303 of file qmatrix4x4.cpp.

References Rotation, and Qt::Uninitialized.

◆ rotate() [2/3]

void QMatrix4x4::rotate ( float angle,
const QVector3D & vector )

Multiples this matrix by another that rotates coordinates through angle degrees about vector.

See also
scale(), translate()

Definition at line 1045 of file qmatrix4x4.cpp.

References rotate(), and vector.

Referenced by QQuick3DParticlePointRotator::affectParticle(), QSSGRenderImage::calculateTextureTransform(), QGeoCameraTilesPrivate::createFrustum(), main(), projectedRotate(), ExampleRhiWidget::render(), ExampleRhiItemRenderer::render(), rotate(), QOpenGLCompositor::setRotation(), and QQuickUniversalBusyIndicatorNode::updateCurrentTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rotate() [3/3]

void QMatrix4x4::rotate ( float angle,
float x,
float y,
float z = 0.0f )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that rotates coordinates through angle degrees about the vector (x, y, z).

See also
scale(), translate()

Definition at line 1060 of file qmatrix4x4.cpp.

References qDegreesToRadians(), qFuzzyCompare, qFuzzyIsNull(), Rotation, Rotation2D, and Qt::Uninitialized.

+ Here is the call graph for this function:

◆ row()

QVector4D QMatrix4x4::row ( int index) const
inline

Returns the elements of row index as a 4D vector.

See also
setRow(), column()

Definition at line 275 of file qmatrix4x4.h.

References Q_ASSERT.

◆ scale() [1/4]

void QMatrix4x4::scale ( const QVector3D & vector)

Multiplies this matrix by another that scales coordinates by the components of vector.

See also
translate(), rotate()

Definition at line 767 of file qmatrix4x4.cpp.

References Rotation, Rotation2D, Scale, and vector.

Referenced by QVideoWindowPrivate::render(), QGeoTiledMapScene::updateSceneGraph(), and QSGCurveStrokeMaterialShader::updateUniformData().

+ Here is the caller graph for this function:

◆ scale() [2/4]

void QMatrix4x4::scale ( float factor)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that scales coordinates by the given factor.

See also
translate(), rotate()

Definition at line 888 of file qmatrix4x4.cpp.

References Rotation, Rotation2D, and Scale.

◆ scale() [3/4]

void QMatrix4x4::scale ( float x,
float y )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that scales coordinates by the components x, and y.

See also
translate(), rotate()

Definition at line 813 of file qmatrix4x4.cpp.

References Rotation, Rotation2D, and Scale.

◆ scale() [4/4]

void QMatrix4x4::scale ( float x,
float y,
float z )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that scales coordinates by the components x, y, and z.

See also
translate(), rotate()

Definition at line 847 of file qmatrix4x4.cpp.

References Rotation, Rotation2D, and Scale.

◆ setColumn()

void QMatrix4x4::setColumn ( int index,
const QVector4D & value )
inline

Sets the elements of column index to the components of value.

See also
column(), setRow()

Definition at line 265 of file qmatrix4x4.h.

References General, and Q_ASSERT.

◆ setRow()

void QMatrix4x4::setRow ( int index,
const QVector4D & value )
inline

Sets the elements of row index to the components of value.

See also
row(), setColumn()

Definition at line 281 of file qmatrix4x4.h.

References General, and Q_ASSERT.

Referenced by QSSGRenderInstanceTable::getTransform().

+ Here is the caller graph for this function:

◆ setToIdentity()

void QMatrix4x4::setToIdentity ( )
inline

Sets this matrix to the identity.

See also
isIdentity()

Definition at line 316 of file qmatrix4x4.h.

References Identity.

Referenced by QSSGRenderCamera::computeCustomFrustum(), QQuick3DParticlePointRotator::prepareToAffect(), QOpenGLCompositor::setRotation(), and QGeoTiledMapScenePrivate::setupCamera().

+ Here is the caller graph for this function:

◆ toGenericMatrix()

template<int N, int M>
QGenericMatrix< N, M, float > QMatrix4x4::toGenericMatrix ( ) const

Constructs a NxM generic matrix from the left-most N columns and top-most M rows of this 4x4 matrix.

If N or M is greater than 4, then the remaining elements are filled with elements from the identity matrix.

Definition at line 228 of file qmatrix4x4.h.

References M.

◆ toTransform() [1/2]

QTransform QMatrix4x4::toTransform ( ) const

Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.

The returned QTransform is formed by simply dropping the third row and third column of the QMatrix4x4. This is suitable for implementing orthographic projections where the z coordinate should be dropped rather than projected.

Definition at line 1649 of file qmatrix4x4.cpp.

Referenced by QSGSoftwareRenderableNodeUpdater::visit().

+ Here is the caller graph for this function:

◆ toTransform() [2/2]

QTransform QMatrix4x4::toTransform ( float distanceToPlane) const

Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.

If distanceToPlane is non-zero, it indicates a projection factor to use to adjust for the z coordinate. The value of 1024 corresponds to the projection factor used by QTransform::rotate() for the x and y axes.

If distanceToPlane is zero, then the returned QTransform is formed by simply dropping the third row and third column of the QMatrix4x4. This is suitable for implementing orthographic projections where the z coordinate should be dropped rather than projected.

Definition at line 1671 of file qmatrix4x4.cpp.

References d, and inv_dist_to_plane.

◆ translate() [1/3]

◆ translate() [2/3]

void QMatrix4x4::translate ( float x,
float y )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that translates coordinates by the components x, and y.

See also
scale(), rotate()

Definition at line 972 of file qmatrix4x4.cpp.

References Identity, Rotation, Scale, and Translation.

◆ translate() [3/3]

void QMatrix4x4::translate ( float x,
float y,
float z )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Multiplies this matrix by another that translates coordinates by the components x, y, and z.

See also
scale(), rotate()

Definition at line 1006 of file qmatrix4x4.cpp.

References Identity, Rotation, Scale, and Translation.

◆ transposed()

QMatrix4x4 QMatrix4x4::transposed ( ) const

Returns this matrix, transposed about its diagonal.

Definition at line 492 of file qmatrix4x4.cpp.

References General, Translation, and Qt::Uninitialized.

Referenced by QQuickMatrix4x4ValueType::transposed().

+ Here is the caller graph for this function:

◆ viewport() [1/2]

void QMatrix4x4::viewport ( const QRectF & rect)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets up viewport transform for viewport bounded by rect and with near and far set to 0 and 1 respectively.

Definition at line 1058 of file qmatrix4x4.h.

References rect, and viewport().

+ Here is the call graph for this function:

◆ viewport() [2/2]

void QMatrix4x4::viewport ( float left,
float bottom,
float width,
float height,
float nearPlane = 0.0f,
float farPlane = 1.0f )

Multiplies this matrix by another that performs the scale and bias transformation used by OpenGL to transform from normalized device coordinates (NDC) to viewport (window) coordinates.

That is it maps points from the cube ranging over [-1, 1] in each dimension to the viewport with it's near-lower-left corner at (left, bottom, nearPlane) and with size (width, height, farPlane - nearPlane).

This matches the transform used by the fixed function OpenGL viewport transform controlled by the functions glViewport() and glDepthRange().

Definition at line 1570 of file qmatrix4x4.cpp.

References General, and Qt::Uninitialized.

Friends And Related Symbol Documentation

◆ ::tst_QMatrixNxN

friend class ::tst_QMatrixNxN
friend

Definition at line 186 of file qmatrix4x4.h.

◆ operator*() [1/14]

QMatrix4x4 operator* ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
related

Returns the product of m1 and m2.

Definition at line 607 of file qmatrix4x4.h.

◆ operator* [2/14]

QMatrix4x4 operator* ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
friend

Returns the product of m1 and m2.

Definition at line 607 of file qmatrix4x4.h.

◆ operator*() [3/14]

QVector4D operator* ( const QMatrix4x4 & matrix,
const QVector4D & vector )
related

Returns the result of transforming vector according to matrix, with the matrix applied pre-vector.

Definition at line 759 of file qmatrix4x4.h.

◆ operator* [4/14]

QVector4D operator* ( const QMatrix4x4 & matrix,
const QVector4D & vector )
friend

Returns the result of transforming vector according to matrix, with the matrix applied pre-vector.

Definition at line 759 of file qmatrix4x4.h.

◆ operator*() [5/14]

QMatrix4x4 operator* ( const QMatrix4x4 & matrix,
float factor )
related

Returns the result of multiplying all elements of matrix by factor.

Definition at line 886 of file qmatrix4x4.h.

◆ operator* [6/14]

QMatrix4x4 operator* ( const QMatrix4x4 & matrix,
float factor )
friend

Returns the result of multiplying all elements of matrix by factor.

Definition at line 886 of file qmatrix4x4.h.

◆ operator*() [7/14]

QPoint operator* ( const QPoint & point,
const QMatrix4x4 & matrix )
related

Returns the result of transforming point according to matrix, with the matrix applied post-point.

Definition at line 783 of file qmatrix4x4.h.

◆ operator* [8/14]

QPoint operator* ( const QPoint & point,
const QMatrix4x4 & matrix )
friend

Returns the result of transforming point according to matrix, with the matrix applied post-point.

Definition at line 783 of file qmatrix4x4.h.

◆ operator*() [9/14]

QPointF operator* ( const QPointF & point,
const QMatrix4x4 & matrix )
related

Returns the result of transforming point according to matrix, with the matrix applied post-point.

Definition at line 804 of file qmatrix4x4.h.

◆ operator* [10/14]

QPointF operator* ( const QPointF & point,
const QMatrix4x4 & matrix )
friend

Returns the result of transforming point according to matrix, with the matrix applied post-point.

Definition at line 804 of file qmatrix4x4.h.

◆ operator*() [11/14]

QVector4D operator* ( const QVector4D & vector,
const QMatrix4x4 & matrix )
related

Returns the result of transforming vector according to matrix, with the matrix applied post-vector.

Definition at line 737 of file qmatrix4x4.h.

◆ operator* [12/14]

QVector4D operator* ( const QVector4D & vector,
const QMatrix4x4 & matrix )
friend

Returns the result of transforming vector according to matrix, with the matrix applied post-vector.

Definition at line 737 of file qmatrix4x4.h.

◆ operator*() [13/14]

QMatrix4x4 operator* ( float factor,
const QMatrix4x4 & matrix )
related

Returns the result of multiplying all elements of matrix by factor.

Definition at line 864 of file qmatrix4x4.h.

◆ operator* [14/14]

QMatrix4x4 operator* ( float factor,
const QMatrix4x4 & matrix )
friend

Returns the result of multiplying all elements of matrix by factor.

Definition at line 864 of file qmatrix4x4.h.

◆ operator+() [1/2]

QMatrix4x4 operator+ ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
related

Returns the sum of m1 and m2.

Definition at line 563 of file qmatrix4x4.h.

◆ operator+ [2/2]

QMatrix4x4 operator+ ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
friend

Returns the sum of m1 and m2.

Definition at line 563 of file qmatrix4x4.h.

◆ operator-() [1/4]

QMatrix4x4 operator- ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
related

Returns the difference of m1 and m2.

Definition at line 585 of file qmatrix4x4.h.

◆ operator- [2/4]

QMatrix4x4 operator- ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
friend

Returns the difference of m1 and m2.

Definition at line 585 of file qmatrix4x4.h.

◆ operator-() [3/4]

QMatrix4x4 operator- ( const QMatrix4x4 & matrix)
related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns the negation of matrix.

Definition at line 842 of file qmatrix4x4.h.

◆ operator- [4/4]

QMatrix4x4 operator- ( const QMatrix4x4 & matrix)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns the negation of matrix.

Definition at line 842 of file qmatrix4x4.h.

◆ operator/() [1/2]

QMatrix4x4 operator/ ( const QMatrix4x4 & matrix,
float divisor )
related

Returns the result of dividing all elements of matrix by divisor.

Definition at line 708 of file qmatrix4x4.cpp.

◆ operator/ [2/2]

QMatrix4x4 operator/ ( const QMatrix4x4 & matrix,
float divisor )
friend

Returns the result of dividing all elements of matrix by divisor.

Definition at line 708 of file qmatrix4x4.cpp.

◆ operator<<() [1/2]

QDataStream & operator<< ( QDataStream & stream,
const QMatrix4x4 & matrix )
related

Writes the given matrix to the given stream and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 2031 of file qmatrix4x4.cpp.

◆ operator<< [2/2]

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

Definition at line 1983 of file qmatrix4x4.cpp.

◆ operator>>()

QDataStream & operator>> ( QDataStream & stream,
QMatrix4x4 & matrix )
related

Reads a 4x4 matrix from the given stream into the given matrix and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 2049 of file qmatrix4x4.cpp.

◆ qFuzzyCompare() [1/2]

bool qFuzzyCompare ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
related

Returns true if m1 and m2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.

Definition at line 738 of file qmatrix4x4.cpp.

◆ qFuzzyCompare [2/2]

bool qFuzzyCompare ( const QMatrix4x4 & m1,
const QMatrix4x4 & m2 )
friend

Returns true if m1 and m2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.

Definition at line 738 of file qmatrix4x4.cpp.

Referenced by optimize(), projectedRotate(), and rotate().


The documentation for this class was generated from the following files: