summaryrefslogtreecommitdiffstats
path: root/src/gui/math3d/qvector3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/math3d/qvector3d.cpp')
-rw-r--r--src/gui/math3d/qvector3d.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/math3d/qvector3d.cpp b/src/gui/math3d/qvector3d.cpp
index b3bf292f9b..5537562b61 100644
--- a/src/gui/math3d/qvector3d.cpp
+++ b/src/gui/math3d/qvector3d.cpp
@@ -348,6 +348,19 @@ QVector3D QVector3D::normal
}
/*!
+ \since 5.1
+
+ Returns the distance from this vertex to a point defined by
+ the vertex \a point.
+
+ \sa distanceToPlane(), distanceToLine()
+*/
+float QVector3D::distanceToPoint(const QVector3D& point) const
+{
+ return (*this - point).length();
+}
+
+/*!
Returns the distance from this vertex to a plane defined by
the vertex \a plane and a \a normal unit vector. The \a normal
parameter is assumed to have been normalized to a unit vector.