summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-26 14:38:36 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-27 13:48:18 +0000
commit74c8aac8f6e22d7fb84d98cc7a5bf44bc3a50c51 (patch)
tree6de45385063c2ce0b8039bf883482f4a26cff4cd
parent85dedd0d7ef220f6437b39c2aa8fcd26a61aa1ef (diff)
Fix Sphere transformation
mapVector() treats the vector as a direction, not as point, which is not what we want. Change-Id: Ibfdd238ca5923b65f1e8cdeff44c01aeeee156fc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/frontend/sphere.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/render/frontend/sphere.cpp b/src/render/frontend/sphere.cpp
index 12077c87a..0c7620dcf 100644
--- a/src/render/frontend/sphere.cpp
+++ b/src/render/frontend/sphere.cpp
@@ -201,12 +201,12 @@ Sphere Sphere::transformed(const QMatrix4x4 &mat)
{
// Transform extremities in x, y, and z directions to find extremities
// of the resulting ellipsoid
- QVector3D x = mat.mapVector(m_center + QVector3D(m_radius, 0.0f, 0.0f));
- QVector3D y = mat.mapVector(m_center + QVector3D(0.0f, m_radius, 0.0f));
- QVector3D z = mat.mapVector(m_center + QVector3D(0.0f, 0.0f, m_radius));
+ QVector3D x = mat.map(m_center + QVector3D(m_radius, 0.0f, 0.0f));
+ QVector3D y = mat.map(m_center + QVector3D(0.0f, m_radius, 0.0f));
+ QVector3D z = mat.map(m_center + QVector3D(0.0f, 0.0f, m_radius));
// Transform center and find maximum radius of ellipsoid
- QVector3D c = mat.mapVector(m_center);
+ QVector3D c = mat.map(m_center);
float rSquared = qMax(qMax((x - c).lengthSquared(), (y - c).lengthSquared()), (z - c).lengthSquared());
return Sphere(c, sqrt(rSquared));
}