From 74c8aac8f6e22d7fb84d98cc7a5bf44bc3a50c51 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 26 Aug 2015 14:38:36 +0200 Subject: 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 --- src/render/frontend/sphere.cpp | 8 ++++---- 1 file 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)); } -- cgit v1.2.3