diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2017-03-15 10:17:05 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2018-02-02 13:58:34 +0000 |
commit | 437a33de9336a5c50711e63dd6dfcd86ad28d5a5 (patch) | |
tree | 6f6cbf6fa5285a79cda6a849a0b96e744ec840c6 /src/render/jobs/calcboundingvolumejob.cpp | |
parent | 46319648436814afb5a77755dde6681e304befaf (diff) |
Render: Use SIMD Vectors and Matrices in the backend
Change-Id: I19b3b2f8fcb06eb2bc600ebe370465dd15a8eabc
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/jobs/calcboundingvolumejob.cpp')
-rw-r--r-- | src/render/jobs/calcboundingvolumejob.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/render/jobs/calcboundingvolumejob.cpp b/src/render/jobs/calcboundingvolumejob.cpp index e81836502..7504b4ebd 100644 --- a/src/render/jobs/calcboundingvolumejob.cpp +++ b/src/render/jobs/calcboundingvolumejob.cpp @@ -93,8 +93,8 @@ public: const float zDist2 = (findExtremePoints.zMaxPt - findExtremePoints.zMinPt).lengthSquared(); // Select most distant pair - QVector3D p = findExtremePoints.xMinPt; - QVector3D q = findExtremePoints.xMaxPt; + Vector3D p = findExtremePoints.xMinPt; + Vector3D q = findExtremePoints.xMaxPt; if (yDist2 > xDist2 && yDist2 > zDist2) { p = findExtremePoints.yMinPt; q = findExtremePoints.yMaxPt; @@ -104,7 +104,7 @@ public: q = findExtremePoints.zMaxPt; } - const QVector3D c = 0.5f * (p + q); + const Vector3D c = 0.5f * (p + q); m_volume.setCenter(c); m_volume.setRadius((q - c).length()); @@ -128,40 +128,40 @@ private: { } float xMin, xMax, yMin, yMax, zMin, zMax; - QVector3D xMinPt, xMaxPt, yMinPt, yMaxPt, zMinPt, zMaxPt; + Vector3D xMinPt, xMaxPt, yMinPt, yMaxPt, zMinPt, zMaxPt; void visit(uint ndx, float x, float y, float z) override { if (ndx) { if (x < xMin) { xMin = x; - xMinPt = QVector3D(x, y, z); + xMinPt = Vector3D(x, y, z); } if (x > xMax) { xMax = x; - xMaxPt = QVector3D(x, y, z); + xMaxPt = Vector3D(x, y, z); } if (y < yMin) { yMin = y; - yMinPt = QVector3D(x, y, z); + yMinPt = Vector3D(x, y, z); } if (y > yMax) { yMax = y; - yMaxPt = QVector3D(x, y, z); + yMaxPt = Vector3D(x, y, z); } if (z < zMin) { zMin = z; - zMinPt = QVector3D(x, y, z); + zMinPt = Vector3D(x, y, z); } if (z > zMax) { zMax = z; - zMaxPt = QVector3D(x, y, z); + zMaxPt = Vector3D(x, y, z); } } else { xMin = xMax = x; yMin = yMax = y; zMin = zMax = z; - xMinPt = xMaxPt = yMinPt = yMaxPt = zMinPt = zMaxPt = QVector3D(x, y, z); + xMinPt = xMaxPt = yMinPt = yMaxPt = zMinPt = zMaxPt = Vector3D(x, y, z); } } }; @@ -177,7 +177,7 @@ private: void visit(uint ndx, float x, float y, float z) override { Q_UNUSED(ndx); - m_volume.expandToContain(QVector3D(x, y, z)); + m_volume.expandToContain(Vector3D(x, y, z)); } }; }; |