36 inline QDoubleMatrix4x4() { setToIdentity(); }
37 explicit QDoubleMatrix4x4(Qt::Initialization) : flagBits(General) {}
38 explicit QDoubleMatrix4x4(
const double *values);
39 inline QDoubleMatrix4x4(
double m11,
double m12,
double m13,
double m14,
40 double m21,
double m22,
double m23,
double m24,
41 double m31,
double m32,
double m33,
double m34,
42 double m41,
double m42,
double m43,
double m44);
44 QDoubleMatrix4x4(
const double *values,
int cols,
int rows);
46 inline const double& operator()(
int row,
int column)
const;
47 inline double& operator()(
int row,
int column);
49 inline bool isAffine()
const;
51 inline bool isIdentity()
const;
52 inline void setToIdentity();
54 inline void fill(
double value);
56 double determinant()
const;
57 QDoubleMatrix4x4 inverted(
bool *invertible =
nullptr)
const;
58 QDoubleMatrix4x4 transposed()
const;
60 inline QDoubleMatrix4x4& operator+=(
const QDoubleMatrix4x4& other);
61 inline QDoubleMatrix4x4& operator-=(
const QDoubleMatrix4x4& other);
62 inline QDoubleMatrix4x4& operator*=(
const QDoubleMatrix4x4& other);
63 inline QDoubleMatrix4x4& operator*=(
double factor);
64 QDoubleMatrix4x4& operator/=(
double divisor);
65 inline bool operator==(
const QDoubleMatrix4x4& other)
const;
66 inline bool operator!=(
const QDoubleMatrix4x4& other)
const;
68 friend QDoubleMatrix4x4 operator+(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
69 friend QDoubleMatrix4x4 operator-(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
70 friend QDoubleMatrix4x4 operator*(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
72 friend QDoubleVector3D operator*(
const QDoubleMatrix4x4& matrix,
const QDoubleVector3D& vector);
73 friend QDoubleVector3D operator*(
const QDoubleVector3D& vector,
const QDoubleMatrix4x4& matrix);
75 friend QPoint operator*(
const QPoint& point,
const QDoubleMatrix4x4& matrix);
76 friend QPointF operator*(
const QPointF& point,
const QDoubleMatrix4x4& matrix);
77 friend QDoubleMatrix4x4 operator-(
const QDoubleMatrix4x4& matrix);
78 friend QPoint operator*(
const QDoubleMatrix4x4& matrix,
const QPoint& point);
79 friend QPointF operator*(
const QDoubleMatrix4x4& matrix,
const QPointF& point);
80 friend QDoubleMatrix4x4 operator*(
double factor,
const QDoubleMatrix4x4& matrix);
81 friend QDoubleMatrix4x4 operator*(
const QDoubleMatrix4x4& matrix,
double factor);
82 friend Q_POSITIONING_EXPORT QDoubleMatrix4x4 operator/(
const QDoubleMatrix4x4& matrix,
double divisor);
84 friend inline bool qFuzzyCompare(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
87 void scale(
const QDoubleVector3D& vector);
88 void translate(
const QDoubleVector3D& vector);
89 void rotate(
double angle,
const QDoubleVector3D& vector);
91 void scale(
double x,
double y);
92 void scale(
double x,
double y,
double z);
93 void scale(
double factor);
94 void translate(
double x,
double y);
95 void translate(
double x,
double y,
double z);
96 void rotate(
double angle,
double x,
double y,
double z = 0.0f);
98 void ortho(
const QRect& rect);
99 void ortho(
const QRectF& rect);
100 void ortho(
double left,
double right,
double bottom,
double top,
double nearPlane,
double farPlane);
101 void frustum(
double left,
double right,
double bottom,
double top,
double nearPlane,
double farPlane);
102 void perspective(
double verticalAngle,
double aspectRatio,
double nearPlane,
double farPlane);
104 void lookAt(
const QDoubleVector3D& eye,
const QDoubleVector3D& center,
const QDoubleVector3D& up);
106 void viewport(
const QRectF &rect);
107 void viewport(
double left,
double bottom,
double width,
double height,
double nearPlane = 0.0f,
double farPlane = 1.0f);
108 void flipCoordinates();
110 void copyDataTo(
double *values)
const;
112 QPoint map(
const QPoint& point)
const;
113 QPointF map(
const QPointF& point)
const;
115 QDoubleVector3D map(
const QDoubleVector3D& point)
const;
116 QDoubleVector3D mapVector(
const QDoubleVector3D& vector)
const;
118 QRect mapRect(
const QRect& rect)
const;
119 QRectF mapRect(
const QRectF& rect)
const;
121 inline double *data();
122 inline const double *data()
const {
return *m; }
123 inline const double *constData()
const {
return *m; }
127#ifndef QT_NO_DEBUG_STREAM
128 friend Q_POSITIONING_EXPORT QDebug operator<<(QDebug dbg,
const QDoubleMatrix4x4 &m);
138 Translation = 0x0001,
142 Perspective = 0x0010,
147 explicit QDoubleMatrix4x4(
int) { }
149 QDoubleMatrix4x4 orthonormalInverse()
const;
151 void projectedRotate(
double angle,
double x,
double y,
double z,
152 double distanceToPlane = 1024.0);
249inline QDoubleMatrix4x4& QDoubleMatrix4x4::operator+=(
const QDoubleMatrix4x4& other)
251 m[0][0] += other.m[0][0];
252 m[0][1] += other.m[0][1];
253 m[0][2] += other.m[0][2];
254 m[0][3] += other.m[0][3];
255 m[1][0] += other.m[1][0];
256 m[1][1] += other.m[1][1];
257 m[1][2] += other.m[1][2];
258 m[1][3] += other.m[1][3];
259 m[2][0] += other.m[2][0];
260 m[2][1] += other.m[2][1];
261 m[2][2] += other.m[2][2];
262 m[2][3] += other.m[2][3];
263 m[3][0] += other.m[3][0];
264 m[3][1] += other.m[3][1];
265 m[3][2] += other.m[3][2];
266 m[3][3] += other.m[3][3];
271inline QDoubleMatrix4x4& QDoubleMatrix4x4::operator-=(
const QDoubleMatrix4x4& other)
273 m[0][0] -= other.m[0][0];
274 m[0][1] -= other.m[0][1];
275 m[0][2] -= other.m[0][2];
276 m[0][3] -= other.m[0][3];
277 m[1][0] -= other.m[1][0];
278 m[1][1] -= other.m[1][1];
279 m[1][2] -= other.m[1][2];
280 m[1][3] -= other.m[1][3];
281 m[2][0] -= other.m[2][0];
282 m[2][1] -= other.m[2][1];
283 m[2][2] -= other.m[2][2];
284 m[2][3] -= other.m[2][3];
285 m[3][0] -= other.m[3][0];
286 m[3][1] -= other.m[3][1];
287 m[3][2] -= other.m[3][2];
288 m[3][3] -= other.m[3][3];
293inline QDoubleMatrix4x4& QDoubleMatrix4x4::operator*=(
const QDoubleMatrix4x4& other)
295 flagBits |= other.flagBits;
297 if (flagBits < Rotation2D) {
298 m[3][0] += m[0][0] * other.m[3][0];
299 m[3][1] += m[1][1] * other.m[3][1];
300 m[3][2] += m[2][2] * other.m[3][2];
302 m[0][0] *= other.m[0][0];
303 m[1][1] *= other.m[1][1];
304 m[2][2] *= other.m[2][2];
309 m0 = m[0][0] * other.m[0][0]
310 + m[1][0] * other.m[0][1]
311 + m[2][0] * other.m[0][2]
312 + m[3][0] * other.m[0][3];
313 m1 = m[0][0] * other.m[1][0]
314 + m[1][0] * other.m[1][1]
315 + m[2][0] * other.m[1][2]
316 + m[3][0] * other.m[1][3];
317 m2 = m[0][0] * other.m[2][0]
318 + m[1][0] * other.m[2][1]
319 + m[2][0] * other.m[2][2]
320 + m[3][0] * other.m[2][3];
321 m[3][0] = m[0][0] * other.m[3][0]
322 + m[1][0] * other.m[3][1]
323 + m[2][0] * other.m[3][2]
324 + m[3][0] * other.m[3][3];
329 m0 = m[0][1] * other.m[0][0]
330 + m[1][1] * other.m[0][1]
331 + m[2][1] * other.m[0][2]
332 + m[3][1] * other.m[0][3];
333 m1 = m[0][1] * other.m[1][0]
334 + m[1][1] * other.m[1][1]
335 + m[2][1] * other.m[1][2]
336 + m[3][1] * other.m[1][3];
337 m2 = m[0][1] * other.m[2][0]
338 + m[1][1] * other.m[2][1]
339 + m[2][1] * other.m[2][2]
340 + m[3][1] * other.m[2][3];
341 m[3][1] = m[0][1] * other.m[3][0]
342 + m[1][1] * other.m[3][1]
343 + m[2][1] * other.m[3][2]
344 + m[3][1] * other.m[3][3];
349 m0 = m[0][2] * other.m[0][0]
350 + m[1][2] * other.m[0][1]
351 + m[2][2] * other.m[0][2]
352 + m[3][2] * other.m[0][3];
353 m1 = m[0][2] * other.m[1][0]
354 + m[1][2] * other.m[1][1]
355 + m[2][2] * other.m[1][2]
356 + m[3][2] * other.m[1][3];
357 m2 = m[0][2] * other.m[2][0]
358 + m[1][2] * other.m[2][1]
359 + m[2][2] * other.m[2][2]
360 + m[3][2] * other.m[2][3];
361 m[3][2] = m[0][2] * other.m[3][0]
362 + m[1][2] * other.m[3][1]
363 + m[2][2] * other.m[3][2]
364 + m[3][2] * other.m[3][3];
369 m0 = m[0][3] * other.m[0][0]
370 + m[1][3] * other.m[0][1]
371 + m[2][3] * other.m[0][2]
372 + m[3][3] * other.m[0][3];
373 m1 = m[0][3] * other.m[1][0]
374 + m[1][3] * other.m[1][1]
375 + m[2][3] * other.m[1][2]
376 + m[3][3] * other.m[1][3];
377 m2 = m[0][3] * other.m[2][0]
378 + m[1][3] * other.m[2][1]
379 + m[2][3] * other.m[2][2]
380 + m[3][3] * other.m[2][3];
381 m[3][3] = m[0][3] * other.m[3][0]
382 + m[1][3] * other.m[3][1]
383 + m[2][3] * other.m[3][2]
384 + m[3][3] * other.m[3][3];
413inline bool QDoubleMatrix4x4::operator==(
const QDoubleMatrix4x4& other)
const
415 return m[0][0] == other.m[0][0] &&
416 m[0][1] == other.m[0][1] &&
417 m[0][2] == other.m[0][2] &&
418 m[0][3] == other.m[0][3] &&
419 m[1][0] == other.m[1][0] &&
420 m[1][1] == other.m[1][1] &&
421 m[1][2] == other.m[1][2] &&
422 m[1][3] == other.m[1][3] &&
423 m[2][0] == other.m[2][0] &&
424 m[2][1] == other.m[2][1] &&
425 m[2][2] == other.m[2][2] &&
426 m[2][3] == other.m[2][3] &&
427 m[3][0] == other.m[3][0] &&
428 m[3][1] == other.m[3][1] &&
429 m[3][2] == other.m[3][2] &&
430 m[3][3] == other.m[3][3];
433inline bool QDoubleMatrix4x4::operator!=(
const QDoubleMatrix4x4& other)
const
435 return m[0][0] != other.m[0][0] ||
436 m[0][1] != other.m[0][1] ||
437 m[0][2] != other.m[0][2] ||
438 m[0][3] != other.m[0][3] ||
439 m[1][0] != other.m[1][0] ||
440 m[1][1] != other.m[1][1] ||
441 m[1][2] != other.m[1][2] ||
442 m[1][3] != other.m[1][3] ||
443 m[2][0] != other.m[2][0] ||
444 m[2][1] != other.m[2][1] ||
445 m[2][2] != other.m[2][2] ||
446 m[2][3] != other.m[2][3] ||
447 m[3][0] != other.m[3][0] ||
448 m[3][1] != other.m[3][1] ||
449 m[3][2] != other.m[3][2] ||
450 m[3][3] != other.m[3][3];
456 m.m[0][0] = m1.m[0][0] + m2.m[0][0];
457 m.m[0][1] = m1.m[0][1] + m2.m[0][1];
458 m.m[0][2] = m1.m[0][2] + m2.m[0][2];
459 m.m[0][3] = m1.m[0][3] + m2.m[0][3];
460 m.m[1][0] = m1.m[1][0] + m2.m[1][0];
461 m.m[1][1] = m1.m[1][1] + m2.m[1][1];
462 m.m[1][2] = m1.m[1][2] + m2.m[1][2];
463 m.m[1][3] = m1.m[1][3] + m2.m[1][3];
464 m.m[2][0] = m1.m[2][0] + m2.m[2][0];
465 m.m[2][1] = m1.m[2][1] + m2.m[2][1];
466 m.m[2][2] = m1.m[2][2] + m2.m[2][2];
467 m.m[2][3] = m1.m[2][3] + m2.m[2][3];
468 m.m[3][0] = m1.m[3][0] + m2.m[3][0];
469 m.m[3][1] = m1.m[3][1] + m2.m[3][1];
470 m.m[3][2] = m1.m[3][2] + m2.m[3][2];
471 m.m[3][3] = m1.m[3][3] + m2.m[3][3];
472 m.flagBits = QDoubleMatrix4x4::General;
479 m.m[0][0] = m1.m[0][0] - m2.m[0][0];
480 m.m[0][1] = m1.m[0][1] - m2.m[0][1];
481 m.m[0][2] = m1.m[0][2] - m2.m[0][2];
482 m.m[0][3] = m1.m[0][3] - m2.m[0][3];
483 m.m[1][0] = m1.m[1][0] - m2.m[1][0];
484 m.m[1][1] = m1.m[1][1] - m2.m[1][1];
485 m.m[1][2] = m1.m[1][2] - m2.m[1][2];
486 m.m[1][3] = m1.m[1][3] - m2.m[1][3];
487 m.m[2][0] = m1.m[2][0] - m2.m[2][0];
488 m.m[2][1] = m1.m[2][1] - m2.m[2][1];
489 m.m[2][2] = m1.m[2][2] - m2.m[2][2];
490 m.m[2][3] = m1.m[2][3] - m2.m[2][3];
491 m.m[3][0] = m1.m[3][0] - m2.m[3][0];
492 m.m[3][1] = m1.m[3][1] - m2.m[3][1];
493 m.m[3][2] = m1.m[3][2] - m2.m[3][2];
494 m.m[3][3] = m1.m[3][3] - m2.m[3][3];
495 m.flagBits = QDoubleMatrix4x4::General;
501 int flagBits = m1.flagBits | m2.flagBits;
502 if (flagBits < QDoubleMatrix4x4::Rotation2D) {
504 m.m[3][0] += m.m[0][0] * m2.m[3][0];
505 m.m[3][1] += m.m[1][1] * m2.m[3][1];
506 m.m[3][2] += m.m[2][2] * m2.m[3][2];
508 m.m[0][0] *= m2.m[0][0];
509 m.m[1][1] *= m2.m[1][1];
510 m.m[2][2] *= m2.m[2][2];
511 m.flagBits = flagBits;
516 m.m[0][0] = m1.m[0][0] * m2.m[0][0]
517 + m1.m[1][0] * m2.m[0][1]
518 + m1.m[2][0] * m2.m[0][2]
519 + m1.m[3][0] * m2.m[0][3];
520 m.m[0][1] = m1.m[0][1] * m2.m[0][0]
521 + m1.m[1][1] * m2.m[0][1]
522 + m1.m[2][1] * m2.m[0][2]
523 + m1.m[3][1] * m2.m[0][3];
524 m.m[0][2] = m1.m[0][2] * m2.m[0][0]
525 + m1.m[1][2] * m2.m[0][1]
526 + m1.m[2][2] * m2.m[0][2]
527 + m1.m[3][2] * m2.m[0][3];
528 m.m[0][3] = m1.m[0][3] * m2.m[0][0]
529 + m1.m[1][3] * m2.m[0][1]
530 + m1.m[2][3] * m2.m[0][2]
531 + m1.m[3][3] * m2.m[0][3];
533 m.m[1][0] = m1.m[0][0] * m2.m[1][0]
534 + m1.m[1][0] * m2.m[1][1]
535 + m1.m[2][0] * m2.m[1][2]
536 + m1.m[3][0] * m2.m[1][3];
537 m.m[1][1] = m1.m[0][1] * m2.m[1][0]
538 + m1.m[1][1] * m2.m[1][1]
539 + m1.m[2][1] * m2.m[1][2]
540 + m1.m[3][1] * m2.m[1][3];
541 m.m[1][2] = m1.m[0][2] * m2.m[1][0]
542 + m1.m[1][2] * m2.m[1][1]
543 + m1.m[2][2] * m2.m[1][2]
544 + m1.m[3][2] * m2.m[1][3];
545 m.m[1][3] = m1.m[0][3] * m2.m[1][0]
546 + m1.m[1][3] * m2.m[1][1]
547 + m1.m[2][3] * m2.m[1][2]
548 + m1.m[3][3] * m2.m[1][3];
550 m.m[2][0] = m1.m[0][0] * m2.m[2][0]
551 + m1.m[1][0] * m2.m[2][1]
552 + m1.m[2][0] * m2.m[2][2]
553 + m1.m[3][0] * m2.m[2][3];
554 m.m[2][1] = m1.m[0][1] * m2.m[2][0]
555 + m1.m[1][1] * m2.m[2][1]
556 + m1.m[2][1] * m2.m[2][2]
557 + m1.m[3][1] * m2.m[2][3];
558 m.m[2][2] = m1.m[0][2] * m2.m[2][0]
559 + m1.m[1][2] * m2.m[2][1]
560 + m1.m[2][2] * m2.m[2][2]
561 + m1.m[3][2] * m2.m[2][3];
562 m.m[2][3] = m1.m[0][3] * m2.m[2][0]
563 + m1.m[1][3] * m2.m[2][1]
564 + m1.m[2][3] * m2.m[2][2]
565 + m1.m[3][3] * m2.m[2][3];
567 m.m[3][0] = m1.m[0][0] * m2.m[3][0]
568 + m1.m[1][0] * m2.m[3][1]
569 + m1.m[2][0] * m2.m[3][2]
570 + m1.m[3][0] * m2.m[3][3];
571 m.m[3][1] = m1.m[0][1] * m2.m[3][0]
572 + m1.m[1][1] * m2.m[3][1]
573 + m1.m[2][1] * m2.m[3][2]
574 + m1.m[3][1] * m2.m[3][3];
575 m.m[3][2] = m1.m[0][2] * m2.m[3][0]
576 + m1.m[1][2] * m2.m[3][1]
577 + m1.m[2][2] * m2.m[3][2]
578 + m1.m[3][2] * m2.m[3][3];
579 m.m[3][3] = m1.m[0][3] * m2.m[3][0]
580 + m1.m[1][3] * m2.m[3][1]
581 + m1.m[2][3] * m2.m[3][2]
582 + m1.m[3][3] * m2.m[3][3];
583 m.flagBits = flagBits;
590 x = vector.x() * matrix.m[0][0] +
591 vector.y() * matrix.m[0][1] +
592 vector.z() * matrix.m[0][2] +
594 y = vector.x() * matrix.m[1][0] +
595 vector.y() * matrix.m[1][1] +
596 vector.z() * matrix.m[1][2] +
598 z = vector.x() * matrix.m[2][0] +
599 vector.y() * matrix.m[2][1] +
600 vector.z() * matrix.m[2][2] +
602 w = vector.x() * matrix.m[3][0] +
603 vector.y() * matrix.m[3][1] +
604 vector.z() * matrix.m[3][2] +
607 return QDoubleVector3D(x, y, z);
609 return QDoubleVector3D(x / w, y / w, z / w);
615 if (matrix.flagBits == QDoubleMatrix4x4::Identity) {
617 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation2D) {
619 return QDoubleVector3D(vector.x() * matrix.m[0][0] + matrix.m[3][0],
620 vector.y() * matrix.m[1][1] + matrix.m[3][1],
621 vector.z() * matrix.m[2][2] + matrix.m[3][2]);
622 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation) {
624 return QDoubleVector3D(vector.x() * matrix.m[0][0] + vector.y() * matrix.m[1][0] + matrix.m[3][0],
625 vector.x() * matrix.m[0][1] + vector.y() * matrix.m[1][1] + matrix.m[3][1],
626 vector.z() * matrix.m[2][2] + matrix.m[3][2]);
628 x = vector.x() * matrix.m[0][0] +
629 vector.y() * matrix.m[1][0] +
630 vector.z() * matrix.m[2][0] +
632 y = vector.x() * matrix.m[0][1] +
633 vector.y() * matrix.m[1][1] +
634 vector.z() * matrix.m[2][1] +
636 z = vector.x() * matrix.m[0][2] +
637 vector.y() * matrix.m[1][2] +
638 vector.z() * matrix.m[2][2] +
640 w = vector.x() * matrix.m[0][3] +
641 vector.y() * matrix.m[1][3] +
642 vector.z() * matrix.m[2][3] +
645 return QDoubleVector3D(x, y, z);
647 return QDoubleVector3D(x / w, y / w, z / w);
700 if (matrix.flagBits == QDoubleMatrix4x4::Identity) {
702 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation2D) {
704 return QPoint(qRound(xin * matrix.m[0][0] + matrix.m[3][0]),
705 qRound(yin * matrix.m[1][1] + matrix.m[3][1]));
706 }
else if (matrix.flagBits < QDoubleMatrix4x4::Perspective) {
707 return QPoint(qRound(xin * matrix.m[0][0] + yin * matrix.m[1][0] + matrix.m[3][0]),
708 qRound(xin * matrix.m[0][1] + yin * matrix.m[1][1] + matrix.m[3][1]));
710 x = xin * matrix.m[0][0] +
711 yin * matrix.m[1][0] +
713 y = xin * matrix.m[0][1] +
714 yin * matrix.m[1][1] +
716 w = xin * matrix.m[0][3] +
717 yin * matrix.m[1][3] +
720 return QPoint(qRound(x), qRound(y));
722 return QPoint(qRound(x / w), qRound(y / w));
732 if (matrix.flagBits == QDoubleMatrix4x4::Identity) {
734 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation2D) {
736 return QPointF(xin * matrix.m[0][0] + matrix.m[3][0],
737 yin * matrix.m[1][1] + matrix.m[3][1]);
738 }
else if (matrix.flagBits < QDoubleMatrix4x4::Perspective) {
739 return QPointF(xin * matrix.m[0][0] + yin * matrix.m[1][0] + matrix.m[3][0],
740 xin * matrix.m[0][1] + yin * matrix.m[1][1] + matrix.m[3][1]);
742 x = xin * matrix.m[0][0] +
743 yin * matrix.m[1][0] +
745 y = xin * matrix.m[0][1] +
746 yin * matrix.m[1][1] +
748 w = xin * matrix.m[0][3] +
749 yin * matrix.m[1][3] +
752 return QPointF(
double(x),
double(y));
754 return QPointF(
double(x / w),
double(y / w));
762 m.m[0][0] = -matrix.m[0][0];
763 m.m[0][1] = -matrix.m[0][1];
764 m.m[0][2] = -matrix.m[0][2];
765 m.m[0][3] = -matrix.m[0][3];
766 m.m[1][0] = -matrix.m[1][0];
767 m.m[1][1] = -matrix.m[1][1];
768 m.m[1][2] = -matrix.m[1][2];
769 m.m[1][3] = -matrix.m[1][3];
770 m.m[2][0] = -matrix.m[2][0];
771 m.m[2][1] = -matrix.m[2][1];
772 m.m[2][2] = -matrix.m[2][2];
773 m.m[2][3] = -matrix.m[2][3];
774 m.m[3][0] = -matrix.m[3][0];
775 m.m[3][1] = -matrix.m[3][1];
776 m.m[3][2] = -matrix.m[3][2];
777 m.m[3][3] = -matrix.m[3][3];
778 m.flagBits = QDoubleMatrix4x4::General;
785 m.m[0][0] = matrix.m[0][0] * factor;
786 m.m[0][1] = matrix.m[0][1] * factor;
787 m.m[0][2] = matrix.m[0][2] * factor;
788 m.m[0][3] = matrix.m[0][3] * factor;
789 m.m[1][0] = matrix.m[1][0] * factor;
790 m.m[1][1] = matrix.m[1][1] * factor;
791 m.m[1][2] = matrix.m[1][2] * factor;
792 m.m[1][3] = matrix.m[1][3] * factor;
793 m.m[2][0] = matrix.m[2][0] * factor;
794 m.m[2][1] = matrix.m[2][1] * factor;
795 m.m[2][2] = matrix.m[2][2] * factor;
796 m.m[2][3] = matrix.m[2][3] * factor;
797 m.m[3][0] = matrix.m[3][0] * factor;
798 m.m[3][1] = matrix.m[3][1] * factor;
799 m.m[3][2] = matrix.m[3][2] * factor;
800 m.m[3][3] = matrix.m[3][3] * factor;
801 m.flagBits = QDoubleMatrix4x4::General;
808 m.m[0][0] = matrix.m[0][0] * factor;
809 m.m[0][1] = matrix.m[0][1] * factor;
810 m.m[0][2] = matrix.m[0][2] * factor;
811 m.m[0][3] = matrix.m[0][3] * factor;
812 m.m[1][0] = matrix.m[1][0] * factor;
813 m.m[1][1] = matrix.m[1][1] * factor;
814 m.m[1][2] = matrix.m[1][2] * factor;
815 m.m[1][3] = matrix.m[1][3] * factor;
816 m.m[2][0] = matrix.m[2][0] * factor;
817 m.m[2][1] = matrix.m[2][1] * factor;
818 m.m[2][2] = matrix.m[2][2] * factor;
819 m.m[2][3] = matrix.m[2][3] * factor;
820 m.m[3][0] = matrix.m[3][0] * factor;
821 m.m[3][1] = matrix.m[3][1] * factor;
822 m.m[3][2] = matrix.m[3][2] * factor;
823 m.m[3][3] = matrix.m[3][3] * factor;
824 m.flagBits = QDoubleMatrix4x4::General;
828inline bool qFuzzyCompare(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2)
830 return QtPrivate::fuzzyCompare(m1.m[0][0], m2.m[0][0])
831 && QtPrivate::fuzzyCompare(m1.m[0][1], m2.m[0][1])
832 && QtPrivate::fuzzyCompare(m1.m[0][2], m2.m[0][2])
833 && QtPrivate::fuzzyCompare(m1.m[0][3], m2.m[0][3])
834 && QtPrivate::fuzzyCompare(m1.m[1][0], m2.m[1][0])
835 && QtPrivate::fuzzyCompare(m1.m[1][1], m2.m[1][1])
836 && QtPrivate::fuzzyCompare(m1.m[1][2], m2.m[1][2])
837 && QtPrivate::fuzzyCompare(m1.m[1][3], m2.m[1][3])
838 && QtPrivate::fuzzyCompare(m1.m[2][0], m2.m[2][0])
839 && QtPrivate::fuzzyCompare(m1.m[2][1], m2.m[2][1])
840 && QtPrivate::fuzzyCompare(m1.m[2][2], m2.m[2][2])
841 && QtPrivate::fuzzyCompare(m1.m[2][3], m2.m[2][3])
842 && QtPrivate::fuzzyCompare(m1.m[3][0], m2.m[3][0])
843 && QtPrivate::fuzzyCompare(m1.m[3][1], m2.m[3][1])
844 && QtPrivate::fuzzyCompare(m1.m[3][2], m2.m[3][2])
845 && QtPrivate::fuzzyCompare(m1.m[3][3], m2.m[3][3]);