summaryrefslogtreecommitdiffstats
path: root/src/gui/math3d/qgenericmatrix.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-04-07 06:16:22 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-04-08 00:19:12 (GMT)
commita83faaf1bedfd321c4fc759156369d2f86fbbbed (patch)
tree9fefa2840ae8a784fcd323551de6a74835e5b267 /src/gui/math3d/qgenericmatrix.h
parent939623b2bc8e441618ee1a1886cc656880bee62b (diff)
downloadQt-a83faaf1bedfd321c4fc759156369d2f86fbbbed.zip
Qt-a83faaf1bedfd321c4fc759156369d2f86fbbbed.tar.gz
Qt-a83faaf1bedfd321c4fc759156369d2f86fbbbed.tar.bz2
Remove fixed-point support from math3d
The main use case for fixed-point support is to build large arrays of vertices. This can be handled using qvertextype or something similar at higher levels. So it isn't worth risking numerical instability in the core classes. Reviewed-by: trustme
Diffstat (limited to 'src/gui/math3d/qgenericmatrix.h')
-rw-r--r--src/gui/math3d/qgenericmatrix.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h
index dbeaaf3..d0b22de 100644
--- a/src/gui/math3d/qgenericmatrix.h
+++ b/src/gui/math3d/qgenericmatrix.h
@@ -42,8 +42,8 @@
#ifndef QGENERICMATRIX_H
#define QGENERICMATRIX_H
-#include <QtGui/qmath3dglobal.h>
#include <QtCore/qmetatype.h>
+#include <QtCore/qdebug.h>
QT_BEGIN_HEADER
@@ -134,7 +134,7 @@ template <int N, int M, typename T, typename InnerT>
Q_INLINE_TEMPLATE T QGenericMatrix<N, M, T, InnerT>::operator()(int row, int column) const
{
Q_ASSERT(row >= 0 && row < M && column >= 0 && column < N);
- return qt_math3d_convert<T, InnerT>(m[column][row]);
+ return T(m[column][row]);
}
template <int N, int M, typename T, typename InnerT>
@@ -323,18 +323,18 @@ Q_OUTOFLINE_TEMPLATE void QGenericMatrix<N, M, T, InnerT>::toValueArray(T *value
{
for (int col = 0; col < N; ++col)
for (int row = 0; row < M; ++row)
- values[row * N + col] = qt_math3d_convert<T, InnerT>(m[col][row]);
+ values[row * N + col] = T(m[col][row]);
}
// Define aliases for the useful variants of QGenericMatrix.
-typedef QGenericMatrix<2, 2, qreal, qrealinner> QMatrix2x2;
-typedef QGenericMatrix<2, 3, qreal, qrealinner> QMatrix2x3;
-typedef QGenericMatrix<2, 4, qreal, qrealinner> QMatrix2x4;
-typedef QGenericMatrix<3, 2, qreal, qrealinner> QMatrix3x2;
-typedef QGenericMatrix<3, 3, qreal, qrealinner> QMatrix3x3;
-typedef QGenericMatrix<3, 4, qreal, qrealinner> QMatrix3x4;
-typedef QGenericMatrix<4, 2, qreal, qrealinner> QMatrix4x2;
-typedef QGenericMatrix<4, 3, qreal, qrealinner> QMatrix4x3;
+typedef QGenericMatrix<2, 2, qreal, float> QMatrix2x2;
+typedef QGenericMatrix<2, 3, qreal, float> QMatrix2x3;
+typedef QGenericMatrix<2, 4, qreal, float> QMatrix2x4;
+typedef QGenericMatrix<3, 2, qreal, float> QMatrix3x2;
+typedef QGenericMatrix<3, 3, qreal, float> QMatrix3x3;
+typedef QGenericMatrix<3, 4, qreal, float> QMatrix3x4;
+typedef QGenericMatrix<4, 2, qreal, float> QMatrix4x2;
+typedef QGenericMatrix<4, 3, qreal, float> QMatrix4x3;
#ifndef QT_NO_DEBUG_STREAM