35 inline QDoubleMatrix4x4() { setToIdentity(); }
36 explicit QDoubleMatrix4x4(Qt::Initialization) : flagBits(General) {}
37 explicit QDoubleMatrix4x4(
const double *values);
38 inline QDoubleMatrix4x4(
double m11,
double m12,
double m13,
double m14,
39 double m21,
double m22,
double m23,
double m24,
40 double m31,
double m32,
double m33,
double m34,
41 double m41,
double m42,
double m43,
double m44);
43 QDoubleMatrix4x4(
const double *values,
int cols,
int rows);
45 inline const double& operator()(
int row,
int column)
const;
46 inline double& operator()(
int row,
int column);
48 inline bool isAffine()
const;
50 inline bool isIdentity()
const;
51 inline void setToIdentity();
53 inline void fill(
double value);
55 double determinant()
const;
56 QDoubleMatrix4x4 inverted(
bool *invertible =
nullptr)
const;
57 QDoubleMatrix4x4 transposed()
const;
59 inline QDoubleMatrix4x4& operator+=(
const QDoubleMatrix4x4& other);
60 inline QDoubleMatrix4x4& operator-=(
const QDoubleMatrix4x4& other);
61 inline QDoubleMatrix4x4& operator*=(
const QDoubleMatrix4x4& other);
62 inline QDoubleMatrix4x4& operator*=(
double factor);
63 QDoubleMatrix4x4& operator/=(
double divisor);
64 inline bool operator==(
const QDoubleMatrix4x4& other)
const;
65 inline bool operator!=(
const QDoubleMatrix4x4& other)
const;
67 friend QDoubleMatrix4x4 operator+(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
68 friend QDoubleMatrix4x4 operator-(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
69 friend QDoubleMatrix4x4 operator*(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
71 friend QDoubleVector3D operator*(
const QDoubleMatrix4x4& matrix,
const QDoubleVector3D& vector);
72 friend QDoubleVector3D operator*(
const QDoubleVector3D& vector,
const QDoubleMatrix4x4& matrix);
74 friend QPoint operator*(
const QPoint& point,
const QDoubleMatrix4x4& matrix);
75 friend QPointF operator*(
const QPointF& point,
const QDoubleMatrix4x4& matrix);
76 friend QDoubleMatrix4x4 operator-(
const QDoubleMatrix4x4& matrix);
77 friend QPoint operator*(
const QDoubleMatrix4x4& matrix,
const QPoint& point);
78 friend QPointF operator*(
const QDoubleMatrix4x4& matrix,
const QPointF& point);
79 friend QDoubleMatrix4x4 operator*(
double factor,
const QDoubleMatrix4x4& matrix);
80 friend QDoubleMatrix4x4 operator*(
const QDoubleMatrix4x4& matrix,
double factor);
81 friend Q_POSITIONING_EXPORT QDoubleMatrix4x4 operator/(
const QDoubleMatrix4x4& matrix,
double divisor);
83 friend inline bool qFuzzyCompare(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2);
86 void scale(
const QDoubleVector3D& vector);
87 void translate(
const QDoubleVector3D& vector);
88 void rotate(
double angle,
const QDoubleVector3D& vector);
90 void scale(
double x,
double y);
91 void scale(
double x,
double y,
double z);
92 void scale(
double factor);
93 void translate(
double x,
double y);
94 void translate(
double x,
double y,
double z);
95 void rotate(
double angle,
double x,
double y,
double z = 0.0f);
97 void ortho(
const QRect& rect);
98 void ortho(
const QRectF& rect);
99 void ortho(
double left,
double right,
double bottom,
double top,
double nearPlane,
double farPlane);
100 void frustum(
double left,
double right,
double bottom,
double top,
double nearPlane,
double farPlane);
101 void perspective(
double verticalAngle,
double aspectRatio,
double nearPlane,
double farPlane);
103 void lookAt(
const QDoubleVector3D& eye,
const QDoubleVector3D& center,
const QDoubleVector3D& up);
105 void viewport(
const QRectF &rect);
106 void viewport(
double left,
double bottom,
double width,
double height,
double nearPlane = 0.0f,
double farPlane = 1.0f);
107 void flipCoordinates();
109 void copyDataTo(
double *values)
const;
111 QPoint map(
const QPoint& point)
const;
112 QPointF map(
const QPointF& point)
const;
114 QDoubleVector3D map(
const QDoubleVector3D& point)
const;
115 QDoubleVector3D mapVector(
const QDoubleVector3D& vector)
const;
117 QRect mapRect(
const QRect& rect)
const;
118 QRectF mapRect(
const QRectF& rect)
const;
120 inline double *data();
121 inline const double *data()
const {
return *m; }
122 inline const double *constData()
const {
return *m; }
126#ifndef QT_NO_DEBUG_STREAM
127 friend Q_POSITIONING_EXPORT QDebug operator<<(QDebug dbg,
const QDoubleMatrix4x4 &m);
137 Translation = 0x0001,
141 Perspective = 0x0010,
146 explicit QDoubleMatrix4x4(
int) { }
148 QDoubleMatrix4x4 orthonormalInverse()
const;
150 void projectedRotate(
double angle,
double x,
double y,
double z,
151 double distanceToPlane = 1024.0);
248inline QDoubleMatrix4x4& QDoubleMatrix4x4::operator+=(
const QDoubleMatrix4x4& other)
250 m[0][0] += other.m[0][0];
251 m[0][1] += other.m[0][1];
252 m[0][2] += other.m[0][2];
253 m[0][3] += other.m[0][3];
254 m[1][0] += other.m[1][0];
255 m[1][1] += other.m[1][1];
256 m[1][2] += other.m[1][2];
257 m[1][3] += other.m[1][3];
258 m[2][0] += other.m[2][0];
259 m[2][1] += other.m[2][1];
260 m[2][2] += other.m[2][2];
261 m[2][3] += other.m[2][3];
262 m[3][0] += other.m[3][0];
263 m[3][1] += other.m[3][1];
264 m[3][2] += other.m[3][2];
265 m[3][3] += other.m[3][3];
270inline QDoubleMatrix4x4& QDoubleMatrix4x4::operator-=(
const QDoubleMatrix4x4& other)
272 m[0][0] -= other.m[0][0];
273 m[0][1] -= other.m[0][1];
274 m[0][2] -= other.m[0][2];
275 m[0][3] -= other.m[0][3];
276 m[1][0] -= other.m[1][0];
277 m[1][1] -= other.m[1][1];
278 m[1][2] -= other.m[1][2];
279 m[1][3] -= other.m[1][3];
280 m[2][0] -= other.m[2][0];
281 m[2][1] -= other.m[2][1];
282 m[2][2] -= other.m[2][2];
283 m[2][3] -= other.m[2][3];
284 m[3][0] -= other.m[3][0];
285 m[3][1] -= other.m[3][1];
286 m[3][2] -= other.m[3][2];
287 m[3][3] -= other.m[3][3];
292inline QDoubleMatrix4x4& QDoubleMatrix4x4::operator*=(
const QDoubleMatrix4x4& other)
294 flagBits |= other.flagBits;
296 if (flagBits < Rotation2D) {
297 m[3][0] += m[0][0] * other.m[3][0];
298 m[3][1] += m[1][1] * other.m[3][1];
299 m[3][2] += m[2][2] * other.m[3][2];
301 m[0][0] *= other.m[0][0];
302 m[1][1] *= other.m[1][1];
303 m[2][2] *= other.m[2][2];
308 m0 = m[0][0] * other.m[0][0]
309 + m[1][0] * other.m[0][1]
310 + m[2][0] * other.m[0][2]
311 + m[3][0] * other.m[0][3];
312 m1 = m[0][0] * other.m[1][0]
313 + m[1][0] * other.m[1][1]
314 + m[2][0] * other.m[1][2]
315 + m[3][0] * other.m[1][3];
316 m2 = m[0][0] * other.m[2][0]
317 + m[1][0] * other.m[2][1]
318 + m[2][0] * other.m[2][2]
319 + m[3][0] * other.m[2][3];
320 m[3][0] = m[0][0] * other.m[3][0]
321 + m[1][0] * other.m[3][1]
322 + m[2][0] * other.m[3][2]
323 + m[3][0] * other.m[3][3];
328 m0 = m[0][1] * other.m[0][0]
329 + m[1][1] * other.m[0][1]
330 + m[2][1] * other.m[0][2]
331 + m[3][1] * other.m[0][3];
332 m1 = m[0][1] * other.m[1][0]
333 + m[1][1] * other.m[1][1]
334 + m[2][1] * other.m[1][2]
335 + m[3][1] * other.m[1][3];
336 m2 = m[0][1] * other.m[2][0]
337 + m[1][1] * other.m[2][1]
338 + m[2][1] * other.m[2][2]
339 + m[3][1] * other.m[2][3];
340 m[3][1] = m[0][1] * other.m[3][0]
341 + m[1][1] * other.m[3][1]
342 + m[2][1] * other.m[3][2]
343 + m[3][1] * other.m[3][3];
348 m0 = m[0][2] * other.m[0][0]
349 + m[1][2] * other.m[0][1]
350 + m[2][2] * other.m[0][2]
351 + m[3][2] * other.m[0][3];
352 m1 = m[0][2] * other.m[1][0]
353 + m[1][2] * other.m[1][1]
354 + m[2][2] * other.m[1][2]
355 + m[3][2] * other.m[1][3];
356 m2 = m[0][2] * other.m[2][0]
357 + m[1][2] * other.m[2][1]
358 + m[2][2] * other.m[2][2]
359 + m[3][2] * other.m[2][3];
360 m[3][2] = m[0][2] * other.m[3][0]
361 + m[1][2] * other.m[3][1]
362 + m[2][2] * other.m[3][2]
363 + m[3][2] * other.m[3][3];
368 m0 = m[0][3] * other.m[0][0]
369 + m[1][3] * other.m[0][1]
370 + m[2][3] * other.m[0][2]
371 + m[3][3] * other.m[0][3];
372 m1 = m[0][3] * other.m[1][0]
373 + m[1][3] * other.m[1][1]
374 + m[2][3] * other.m[1][2]
375 + m[3][3] * other.m[1][3];
376 m2 = m[0][3] * other.m[2][0]
377 + m[1][3] * other.m[2][1]
378 + m[2][3] * other.m[2][2]
379 + m[3][3] * other.m[2][3];
380 m[3][3] = m[0][3] * other.m[3][0]
381 + m[1][3] * other.m[3][1]
382 + m[2][3] * other.m[3][2]
383 + m[3][3] * other.m[3][3];
412inline bool QDoubleMatrix4x4::operator==(
const QDoubleMatrix4x4& other)
const
414 return m[0][0] == other.m[0][0] &&
415 m[0][1] == other.m[0][1] &&
416 m[0][2] == other.m[0][2] &&
417 m[0][3] == other.m[0][3] &&
418 m[1][0] == other.m[1][0] &&
419 m[1][1] == other.m[1][1] &&
420 m[1][2] == other.m[1][2] &&
421 m[1][3] == other.m[1][3] &&
422 m[2][0] == other.m[2][0] &&
423 m[2][1] == other.m[2][1] &&
424 m[2][2] == other.m[2][2] &&
425 m[2][3] == other.m[2][3] &&
426 m[3][0] == other.m[3][0] &&
427 m[3][1] == other.m[3][1] &&
428 m[3][2] == other.m[3][2] &&
429 m[3][3] == other.m[3][3];
432inline bool QDoubleMatrix4x4::operator!=(
const QDoubleMatrix4x4& other)
const
434 return m[0][0] != other.m[0][0] ||
435 m[0][1] != other.m[0][1] ||
436 m[0][2] != other.m[0][2] ||
437 m[0][3] != other.m[0][3] ||
438 m[1][0] != other.m[1][0] ||
439 m[1][1] != other.m[1][1] ||
440 m[1][2] != other.m[1][2] ||
441 m[1][3] != other.m[1][3] ||
442 m[2][0] != other.m[2][0] ||
443 m[2][1] != other.m[2][1] ||
444 m[2][2] != other.m[2][2] ||
445 m[2][3] != other.m[2][3] ||
446 m[3][0] != other.m[3][0] ||
447 m[3][1] != other.m[3][1] ||
448 m[3][2] != other.m[3][2] ||
449 m[3][3] != other.m[3][3];
455 m.m[0][0] = m1.m[0][0] + m2.m[0][0];
456 m.m[0][1] = m1.m[0][1] + m2.m[0][1];
457 m.m[0][2] = m1.m[0][2] + m2.m[0][2];
458 m.m[0][3] = m1.m[0][3] + m2.m[0][3];
459 m.m[1][0] = m1.m[1][0] + m2.m[1][0];
460 m.m[1][1] = m1.m[1][1] + m2.m[1][1];
461 m.m[1][2] = m1.m[1][2] + m2.m[1][2];
462 m.m[1][3] = m1.m[1][3] + m2.m[1][3];
463 m.m[2][0] = m1.m[2][0] + m2.m[2][0];
464 m.m[2][1] = m1.m[2][1] + m2.m[2][1];
465 m.m[2][2] = m1.m[2][2] + m2.m[2][2];
466 m.m[2][3] = m1.m[2][3] + m2.m[2][3];
467 m.m[3][0] = m1.m[3][0] + m2.m[3][0];
468 m.m[3][1] = m1.m[3][1] + m2.m[3][1];
469 m.m[3][2] = m1.m[3][2] + m2.m[3][2];
470 m.m[3][3] = m1.m[3][3] + m2.m[3][3];
471 m.flagBits = QDoubleMatrix4x4::General;
478 m.m[0][0] = m1.m[0][0] - m2.m[0][0];
479 m.m[0][1] = m1.m[0][1] - m2.m[0][1];
480 m.m[0][2] = m1.m[0][2] - m2.m[0][2];
481 m.m[0][3] = m1.m[0][3] - m2.m[0][3];
482 m.m[1][0] = m1.m[1][0] - m2.m[1][0];
483 m.m[1][1] = m1.m[1][1] - m2.m[1][1];
484 m.m[1][2] = m1.m[1][2] - m2.m[1][2];
485 m.m[1][3] = m1.m[1][3] - m2.m[1][3];
486 m.m[2][0] = m1.m[2][0] - m2.m[2][0];
487 m.m[2][1] = m1.m[2][1] - m2.m[2][1];
488 m.m[2][2] = m1.m[2][2] - m2.m[2][2];
489 m.m[2][3] = m1.m[2][3] - m2.m[2][3];
490 m.m[3][0] = m1.m[3][0] - m2.m[3][0];
491 m.m[3][1] = m1.m[3][1] - m2.m[3][1];
492 m.m[3][2] = m1.m[3][2] - m2.m[3][2];
493 m.m[3][3] = m1.m[3][3] - m2.m[3][3];
494 m.flagBits = QDoubleMatrix4x4::General;
500 int flagBits = m1.flagBits | m2.flagBits;
501 if (flagBits < QDoubleMatrix4x4::Rotation2D) {
503 m.m[3][0] += m.m[0][0] * m2.m[3][0];
504 m.m[3][1] += m.m[1][1] * m2.m[3][1];
505 m.m[3][2] += m.m[2][2] * m2.m[3][2];
507 m.m[0][0] *= m2.m[0][0];
508 m.m[1][1] *= m2.m[1][1];
509 m.m[2][2] *= m2.m[2][2];
510 m.flagBits = flagBits;
515 m.m[0][0] = m1.m[0][0] * m2.m[0][0]
516 + m1.m[1][0] * m2.m[0][1]
517 + m1.m[2][0] * m2.m[0][2]
518 + m1.m[3][0] * m2.m[0][3];
519 m.m[0][1] = m1.m[0][1] * m2.m[0][0]
520 + m1.m[1][1] * m2.m[0][1]
521 + m1.m[2][1] * m2.m[0][2]
522 + m1.m[3][1] * m2.m[0][3];
523 m.m[0][2] = m1.m[0][2] * m2.m[0][0]
524 + m1.m[1][2] * m2.m[0][1]
525 + m1.m[2][2] * m2.m[0][2]
526 + m1.m[3][2] * m2.m[0][3];
527 m.m[0][3] = m1.m[0][3] * m2.m[0][0]
528 + m1.m[1][3] * m2.m[0][1]
529 + m1.m[2][3] * m2.m[0][2]
530 + m1.m[3][3] * m2.m[0][3];
532 m.m[1][0] = m1.m[0][0] * m2.m[1][0]
533 + m1.m[1][0] * m2.m[1][1]
534 + m1.m[2][0] * m2.m[1][2]
535 + m1.m[3][0] * m2.m[1][3];
536 m.m[1][1] = m1.m[0][1] * m2.m[1][0]
537 + m1.m[1][1] * m2.m[1][1]
538 + m1.m[2][1] * m2.m[1][2]
539 + m1.m[3][1] * m2.m[1][3];
540 m.m[1][2] = m1.m[0][2] * m2.m[1][0]
541 + m1.m[1][2] * m2.m[1][1]
542 + m1.m[2][2] * m2.m[1][2]
543 + m1.m[3][2] * m2.m[1][3];
544 m.m[1][3] = m1.m[0][3] * m2.m[1][0]
545 + m1.m[1][3] * m2.m[1][1]
546 + m1.m[2][3] * m2.m[1][2]
547 + m1.m[3][3] * m2.m[1][3];
549 m.m[2][0] = m1.m[0][0] * m2.m[2][0]
550 + m1.m[1][0] * m2.m[2][1]
551 + m1.m[2][0] * m2.m[2][2]
552 + m1.m[3][0] * m2.m[2][3];
553 m.m[2][1] = m1.m[0][1] * m2.m[2][0]
554 + m1.m[1][1] * m2.m[2][1]
555 + m1.m[2][1] * m2.m[2][2]
556 + m1.m[3][1] * m2.m[2][3];
557 m.m[2][2] = m1.m[0][2] * m2.m[2][0]
558 + m1.m[1][2] * m2.m[2][1]
559 + m1.m[2][2] * m2.m[2][2]
560 + m1.m[3][2] * m2.m[2][3];
561 m.m[2][3] = m1.m[0][3] * m2.m[2][0]
562 + m1.m[1][3] * m2.m[2][1]
563 + m1.m[2][3] * m2.m[2][2]
564 + m1.m[3][3] * m2.m[2][3];
566 m.m[3][0] = m1.m[0][0] * m2.m[3][0]
567 + m1.m[1][0] * m2.m[3][1]
568 + m1.m[2][0] * m2.m[3][2]
569 + m1.m[3][0] * m2.m[3][3];
570 m.m[3][1] = m1.m[0][1] * m2.m[3][0]
571 + m1.m[1][1] * m2.m[3][1]
572 + m1.m[2][1] * m2.m[3][2]
573 + m1.m[3][1] * m2.m[3][3];
574 m.m[3][2] = m1.m[0][2] * m2.m[3][0]
575 + m1.m[1][2] * m2.m[3][1]
576 + m1.m[2][2] * m2.m[3][2]
577 + m1.m[3][2] * m2.m[3][3];
578 m.m[3][3] = m1.m[0][3] * m2.m[3][0]
579 + m1.m[1][3] * m2.m[3][1]
580 + m1.m[2][3] * m2.m[3][2]
581 + m1.m[3][3] * m2.m[3][3];
582 m.flagBits = flagBits;
589 x = vector.x() * matrix.m[0][0] +
590 vector.y() * matrix.m[0][1] +
591 vector.z() * matrix.m[0][2] +
593 y = vector.x() * matrix.m[1][0] +
594 vector.y() * matrix.m[1][1] +
595 vector.z() * matrix.m[1][2] +
597 z = vector.x() * matrix.m[2][0] +
598 vector.y() * matrix.m[2][1] +
599 vector.z() * matrix.m[2][2] +
601 w = vector.x() * matrix.m[3][0] +
602 vector.y() * matrix.m[3][1] +
603 vector.z() * matrix.m[3][2] +
606 return QDoubleVector3D(x, y, z);
608 return QDoubleVector3D(x / w, y / w, z / w);
614 if (matrix.flagBits == QDoubleMatrix4x4::Identity) {
616 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation2D) {
618 return QDoubleVector3D(vector.x() * matrix.m[0][0] + matrix.m[3][0],
619 vector.y() * matrix.m[1][1] + matrix.m[3][1],
620 vector.z() * matrix.m[2][2] + matrix.m[3][2]);
621 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation) {
623 return QDoubleVector3D(vector.x() * matrix.m[0][0] + vector.y() * matrix.m[1][0] + matrix.m[3][0],
624 vector.x() * matrix.m[0][1] + vector.y() * matrix.m[1][1] + matrix.m[3][1],
625 vector.z() * matrix.m[2][2] + matrix.m[3][2]);
627 x = vector.x() * matrix.m[0][0] +
628 vector.y() * matrix.m[1][0] +
629 vector.z() * matrix.m[2][0] +
631 y = vector.x() * matrix.m[0][1] +
632 vector.y() * matrix.m[1][1] +
633 vector.z() * matrix.m[2][1] +
635 z = vector.x() * matrix.m[0][2] +
636 vector.y() * matrix.m[1][2] +
637 vector.z() * matrix.m[2][2] +
639 w = vector.x() * matrix.m[0][3] +
640 vector.y() * matrix.m[1][3] +
641 vector.z() * matrix.m[2][3] +
644 return QDoubleVector3D(x, y, z);
646 return QDoubleVector3D(x / w, y / w, z / w);
699 if (matrix.flagBits == QDoubleMatrix4x4::Identity) {
701 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation2D) {
703 return QPoint(qRound(xin * matrix.m[0][0] + matrix.m[3][0]),
704 qRound(yin * matrix.m[1][1] + matrix.m[3][1]));
705 }
else if (matrix.flagBits < QDoubleMatrix4x4::Perspective) {
706 return QPoint(qRound(xin * matrix.m[0][0] + yin * matrix.m[1][0] + matrix.m[3][0]),
707 qRound(xin * matrix.m[0][1] + yin * matrix.m[1][1] + matrix.m[3][1]));
709 x = xin * matrix.m[0][0] +
710 yin * matrix.m[1][0] +
712 y = xin * matrix.m[0][1] +
713 yin * matrix.m[1][1] +
715 w = xin * matrix.m[0][3] +
716 yin * matrix.m[1][3] +
719 return QPoint(qRound(x), qRound(y));
721 return QPoint(qRound(x / w), qRound(y / w));
731 if (matrix.flagBits == QDoubleMatrix4x4::Identity) {
733 }
else if (matrix.flagBits < QDoubleMatrix4x4::Rotation2D) {
735 return QPointF(xin * matrix.m[0][0] + matrix.m[3][0],
736 yin * matrix.m[1][1] + matrix.m[3][1]);
737 }
else if (matrix.flagBits < QDoubleMatrix4x4::Perspective) {
738 return QPointF(xin * matrix.m[0][0] + yin * matrix.m[1][0] + matrix.m[3][0],
739 xin * matrix.m[0][1] + yin * matrix.m[1][1] + matrix.m[3][1]);
741 x = xin * matrix.m[0][0] +
742 yin * matrix.m[1][0] +
744 y = xin * matrix.m[0][1] +
745 yin * matrix.m[1][1] +
747 w = xin * matrix.m[0][3] +
748 yin * matrix.m[1][3] +
751 return QPointF(
double(x),
double(y));
753 return QPointF(
double(x / w),
double(y / w));
761 m.m[0][0] = -matrix.m[0][0];
762 m.m[0][1] = -matrix.m[0][1];
763 m.m[0][2] = -matrix.m[0][2];
764 m.m[0][3] = -matrix.m[0][3];
765 m.m[1][0] = -matrix.m[1][0];
766 m.m[1][1] = -matrix.m[1][1];
767 m.m[1][2] = -matrix.m[1][2];
768 m.m[1][3] = -matrix.m[1][3];
769 m.m[2][0] = -matrix.m[2][0];
770 m.m[2][1] = -matrix.m[2][1];
771 m.m[2][2] = -matrix.m[2][2];
772 m.m[2][3] = -matrix.m[2][3];
773 m.m[3][0] = -matrix.m[3][0];
774 m.m[3][1] = -matrix.m[3][1];
775 m.m[3][2] = -matrix.m[3][2];
776 m.m[3][3] = -matrix.m[3][3];
777 m.flagBits = QDoubleMatrix4x4::General;
784 m.m[0][0] = matrix.m[0][0] * factor;
785 m.m[0][1] = matrix.m[0][1] * factor;
786 m.m[0][2] = matrix.m[0][2] * factor;
787 m.m[0][3] = matrix.m[0][3] * factor;
788 m.m[1][0] = matrix.m[1][0] * factor;
789 m.m[1][1] = matrix.m[1][1] * factor;
790 m.m[1][2] = matrix.m[1][2] * factor;
791 m.m[1][3] = matrix.m[1][3] * factor;
792 m.m[2][0] = matrix.m[2][0] * factor;
793 m.m[2][1] = matrix.m[2][1] * factor;
794 m.m[2][2] = matrix.m[2][2] * factor;
795 m.m[2][3] = matrix.m[2][3] * factor;
796 m.m[3][0] = matrix.m[3][0] * factor;
797 m.m[3][1] = matrix.m[3][1] * factor;
798 m.m[3][2] = matrix.m[3][2] * factor;
799 m.m[3][3] = matrix.m[3][3] * factor;
800 m.flagBits = QDoubleMatrix4x4::General;
807 m.m[0][0] = matrix.m[0][0] * factor;
808 m.m[0][1] = matrix.m[0][1] * factor;
809 m.m[0][2] = matrix.m[0][2] * factor;
810 m.m[0][3] = matrix.m[0][3] * factor;
811 m.m[1][0] = matrix.m[1][0] * factor;
812 m.m[1][1] = matrix.m[1][1] * factor;
813 m.m[1][2] = matrix.m[1][2] * factor;
814 m.m[1][3] = matrix.m[1][3] * factor;
815 m.m[2][0] = matrix.m[2][0] * factor;
816 m.m[2][1] = matrix.m[2][1] * factor;
817 m.m[2][2] = matrix.m[2][2] * factor;
818 m.m[2][3] = matrix.m[2][3] * factor;
819 m.m[3][0] = matrix.m[3][0] * factor;
820 m.m[3][1] = matrix.m[3][1] * factor;
821 m.m[3][2] = matrix.m[3][2] * factor;
822 m.m[3][3] = matrix.m[3][3] * factor;
823 m.flagBits = QDoubleMatrix4x4::General;
827inline bool qFuzzyCompare(
const QDoubleMatrix4x4& m1,
const QDoubleMatrix4x4& m2)
829 return qFuzzyCompare(m1.m[0][0], m2.m[0][0]) &&
830 qFuzzyCompare(m1.m[0][1], m2.m[0][1]) &&
831 qFuzzyCompare(m1.m[0][2], m2.m[0][2]) &&
832 qFuzzyCompare(m1.m[0][3], m2.m[0][3]) &&
833 qFuzzyCompare(m1.m[1][0], m2.m[1][0]) &&
834 qFuzzyCompare(m1.m[1][1], m2.m[1][1]) &&
835 qFuzzyCompare(m1.m[1][2], m2.m[1][2]) &&
836 qFuzzyCompare(m1.m[1][3], m2.m[1][3]) &&
837 qFuzzyCompare(m1.m[2][0], m2.m[2][0]) &&
838 qFuzzyCompare(m1.m[2][1], m2.m[2][1]) &&
839 qFuzzyCompare(m1.m[2][2], m2.m[2][2]) &&
840 qFuzzyCompare(m1.m[2][3], m2.m[2][3]) &&
841 qFuzzyCompare(m1.m[3][0], m2.m[3][0]) &&
842 qFuzzyCompare(m1.m[3][1], m2.m[3][1]) &&
843 qFuzzyCompare(m1.m[3][2], m2.m[3][2]) &&
844 qFuzzyCompare(m1.m[3][3], m2.m[3][3]);