summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2013-02-07 13:36:00 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-08 08:39:13 +0100
commit1786d093e76587480e2c2c1a99fe5551dc69c728 (patch)
tree0f882d199ac55adcb62ff677e244f1e7e3800f7b
parent94f110b0a4c06b83b75d2eb354095387981a7efa (diff)
downloadqt3d-1786d093e76587480e2c2c1a99fe5551dc69c728.tar.gz
Fixed QTriangle3D::contains() being too strict for large triangles.
The scale of the triangle should not determine whether a given point is deemed to lie on the triangle's plane or not. Task-number: QTBUG-29158 Change-Id: I035718063c3e46ddd28ced233ecf901270fb2dbb Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/threed/math3d/qtriangle3d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/threed/math3d/qtriangle3d.cpp b/src/threed/math3d/qtriangle3d.cpp
index 30223b5b3..5ac0103c0 100644
--- a/src/threed/math3d/qtriangle3d.cpp
+++ b/src/threed/math3d/qtriangle3d.cpp
@@ -181,7 +181,7 @@ bool QTriangle3D::contains(const QVector3D &point) const
{
// Check if the point is on the triangle's plane first.
QVector3D normal = QVector3D::crossProduct(m_q - m_p, m_r - m_q);
- if (!qFuzzyIsNull(float(QVector3D::dotProduct(normal, m_p - point))))
+ if (!qFuzzyIsNull(float(QVector3D::dotProduct(normal.normalized(), m_p - point))))
return false;
// Compute the barycentric co-ordinates and use them to determine